tid = $tid; $thread->getinfo(); $fid = $thread->fid; // we need this for the breadcrumbs if ($fid == '') { header('Location: http://thai360.com/delphi/'); exit(); } if (($fid == 3) || ($fid == 9) || ($fid == 11) || ($fid == 13)) { // not showing GoogleAds on Regional Sanuk, Trip Reports, Nightlife and Interesting Links $showingGoogleAds = false; } else { $showingGoogleAds = true; } // now get a list of the posts in this thread if (($_SESSION['thread_query'] == '') || ($usequery != 1)) { // build the query $query = "SELECT * FROM posts LEFT JOIN posters ON posts.posterid=posters.posterid WHERE tid='".$tid."' ORDER BY postno ASC"; // store the query in a session to prevent us from losing it when switching to other pages $_SESSION['thread_query'] = $query; } else { // we have only moved to another page, so use the query stored in the SESSION $query = $_SESSION['thread_query']; } // get the limit $limit = 10; // find number of pages $result_count = mysql_query($query); $totalrows = mysql_num_rows($result_count); if(empty($page)) { $page = 1; } // update the query with the LIMIT settings, and run it $limitvalue = $page * $limit - ($limit); $query = $query." LIMIT $limitvalue, $limit"; $poster = New poster(); $mysql->query($query); if ($mysql->num_rows() > 0) { $postno = 0; while ($mysql->movenext()) { // get the reply to name if ($mysql->getfield("reply_to_id") != '0') { $poster->posterid = $mysql->getfield("reply_to_id"); $poster->getname(); $reply_to_name = $poster->postername; } else { $reply_to_name = ''; } $postlistHMTL .= "
"; $postlistHMTL .= "
".$mysql->getfield("postdate")."
"; $postlistHMTL .= "From : ".$mysql->getfield("postername")."
"; $postlistHMTL .= "To : ".$reply_to_name."
"; $postlistHMTL .= $mysql->getfield("postcontent"); $postlistHMTL .= "
"; if (($postno == 0) && $showingGoogleAds) { // display some Google ads after the first post $postlistHMTL .= "
"; $postlistHMTL .= "\n"; $postlistHMTL .= ""; $postlistHMTL .= "
"; } $postno++; } } if (($postno >= 5) && $showingGoogleAds) { // display some Google ads after the last post, but only if there were more than 5 $postlistHMTL .= "
"; $postlistHMTL .= "\n"; $postlistHMTL .= ""; $postlistHMTL .= "
"; } $scriptname = "/delphi/thread.php?id=".$tid; // build the pagination HTML $perpageoptions = build_per_page_options($limit); $pagesstring = build_pagination($scriptname, $page, $totalrows, $limit); } $browsertitle = $thread->threadname; $description = $thread->threadname; if ($fid != '') { $forum = New forum(); $forum->fid = $fid; $forum->getinfo(); $forumname = $forum->forumname; } $returnlink = ($returnpage != '') ? "/delphi/forum.php?id=".$fid."&page=".$returnpage."&usequery=1" : "/delphi/forum.php?id=".$fid; $breadcrumbs = "Home > ".$forumname." > ".$thread->threadname; include('header.inc.php'); ?>