";
print "| Subject | Replies | Views | Last Reply | ";
$bgcolouralt = "rgb(235,235,235)"; $bgcolour = "";
$ignoredcount = 0; $ignoredtext = "";
$displayed = 0;
$sql_threads = "select * from MB_Threads $sqlselect order by MBT_Sticky desc, MBT_Date2 desc limit " . (($PARM_PAGE * $indexrecs) - $indexrecs) . "," . $indexrecs;
# if (isset($PARM_SEARCH)) $sql_threads = "select MBT_ID, MBT_Domain, MBT_Category, MBT_Subject, MBT_Text, MBT_Date1, MBT_Date2, MBT_User, MBT_Sticky, MBT_Views, MBT_GoodPost, MBT_BadPost from MB_Threads, MB_Replies $sqlselect and MBR_Thread = MBT_ID and (MBR_Text like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Subject like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Subject like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Text like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\") group BY MBT_ID order by MBT_Sticky desc, MBT_Date2 desc limit " . (($PARM_PAGE * $indexrecs) - $indexrecs) . "," . $indexrecs;
# if (isset($PARM_CATEGORY) and $PARM_CATEGORY == "z" and $PARM_CATEGORY != "0" and isset($PARM_SEARCH)) $sql_threads = "select MBT_ID, MBT_Domain, MBT_Category, MBT_Subject, MBT_Text, MBT_Date1, MBT_Date2, MBT_User, MBT_Sticky, MBT_Views, MBT_GoodPost, MBT_BadPost from MB_Threads, MB_Replies $sqlselect and MBR_Thread = MBT_ID and MBR_User = $US_ID and (MBR_Text like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Subject like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Subject like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\" or MBT_Text like \"%" . mysql_real_escape_string($PARM_SEARCH) . "%\") group BY MBT_ID order by MBT_Sticky desc, MBT_Date2 desc limit " . (($PARM_PAGE * $indexrecs) - $indexrecs) . "," . $indexrecs;
if (isset($PARM_CATEGORY) and $PARM_CATEGORY == "z" and $PARM_CATEGORY != "0") $sql_threads = "select MBT_ID, MBT_Domain, MBT_Category, MBT_Subject, MBT_Text, MBT_Date1, MBT_Date2, MBT_User, MBT_Sticky, MBT_Views, MBT_GoodPost, MBT_BadPost from MB_Threads, MB_Replies $sqlselect and MBR_Thread = MBT_ID and MBR_User = $US_ID group BY MBT_ID order by MBT_Sticky desc, MBT_Date2 desc limit " . (($PARM_PAGE * $indexrecs) - $indexrecs) . "," . $indexrecs;
$res_threads = mysql_query($sql_threads);
if (mysql_num_rows($res_threads)) {
$displayed++;
while ($row_threads = mysql_fetch_array($res_threads)) {
if ((!strpos($US_IGNORED, "," . $row_threads['MBT_User'] . ";")) and (!isset($US_ID) or strpos($row_threads['MBT_BadPost'], "<$US_ID>") === false)) {
if ($bgcolour == $bgcolouralt) $bgcolour = "rgb(255,255,255)"; else $bgcolour = $bgcolouralt;
$sel_count_posts = "select count(*) from MB_Replies where MBR_Thread = " . $row_threads["MBT_ID"] ." and MBR_Initial = 0";
$res_count_posts = mysql_query($sel_count_posts);
$row_count_posts = mysql_fetch_row($res_count_posts);
$posts = $row_count_posts[0];
$pagecount = ceil($posts / $pagerecs);
$pagedets = ""; $lastpage = 0;
for ($x=2; $x <= $pagecount; $x++) $pagedets .= " $x ";
if ($pagedets != "") { $pagedets = "[" . $pagedets . "]"; $lastpage = $pagecount; }
if ($row_threads['MBT_Sticky']==1) $sticky = " "; else $sticky = '';
if (strpos($row_threads['MBT_Text'], "[poll_") !== false) $poll = "y"; else $poll = "n";
$records_per_pg = 10;
$no_pg = ceil($posts / $records_per_pg);
$sel_user = "select US_Username from US_Users where US_ID = " . $row_threads["MBT_User"];
$res_user = mysql_query($sel_user);
$row_user = mysql_fetch_array($res_user);
$pos = strpos($row_threads["MBT_Text"], "<");
if ($pos !== false) $row_threads["MBT_Text"] = substr($row_threads["MBT_Text"], 0, $pos);
$minitext = str_replace("\n", "", substr(strip_tags($row_threads["MBT_Text"]), 0, 70));
$minitext = str_replace("\r", " ", $minitext);
$minitext = str_replace("", "", $minitext);
$minitext = str_replace("<", "<", $minitext);
$minitext = str_replace(">", ">", $minitext);
$minitext = str_replace("\"", "", $minitext);
$minitext = stripslashes($minitext);
$icon = "";
$score = ((substr_count($row_threads['MBT_GoodPost'], '[')) - (substr_count($row_threads['MBT_BadPost'], '[')));
if ($score > 0) $icon = " ";
if ($score < 0) $icon = " ";
if ($poll == "y") $icon .= " ";
$mypost = "n";
if (isset($US_ID)) {
$sel_count_posts = "select count(*) from MB_Replies where MBR_Thread = " . $row_threads["MBT_ID"] ." and MBR_User = $US_ID";
$res_count_posts = mysql_query($sel_count_posts);
$row_count_posts = mysql_fetch_row($res_count_posts);
if ($row_count_posts[0] > 0) $icon .= " ";
}
$date = twitter_time_format($row_threads['MBT_Date1']);
$last = ""; $lastreply = 0;
if ($posts > 0) {
$sql_last = "select * from MB_Replies where MBR_Thread = " . $row_threads["MBT_ID"] ." order by MBR_Date desc";
$res_last = mysql_query($sql_last);
if ($row_last = mysql_fetch_array($res_last)) {
$lastreply = $row_last['MBR_ID'];
$lastdate = $row_last['MBR_Date'];
if ($lastpage > 1) $last = "" . twitter_time_format($row_last['MBR_Date']) . ' '; else $last = "" . twitter_time_format($row_last['MBR_Date']) . ' ';
$sel_users = "select * from US_Users where US_ID = {$row_last['MBR_User']}";
$res_users = mysql_query($sel_users) or die (mysql_error());
$row_users = mysql_fetch_array($res_users) or die (mysql_error());
$last .= " by {$row_users['US_Username']}";
}
}
if (isset($US_ID) and $lastreply > 0) {
$sqlR = "select LR_Reply from MB_LastRead where LR_User = $US_ID and LR_Thread = {$row_threads['MBT_ID']} and LR_Reply <= $lastreply";
$resR = mysql_query($sqlR);
while ($rowR = mysql_fetch_array($resR)) {
if ($rowR['LR_Reply'] < $lastreply) $icon .= " ";
}
}
print "| $sticky$icon" . stripslashes($row_threads['MBT_Subject']) . " $pagedets by {$row_user['US_Username']} $date $minitext | ";
print "$posts | {$row_threads['MBT_Views']} | $last | ";
} else $ignoredtext = "Some threads have been hidden";
} }
print "| $ignoredtext | ";
print "";
echo ' | | ';
$adtype = "Match"; include ("adserver.php");
if ($SITE_ID == 1073) print " ";
#$adtype = "localad_forum"; include ("adserver.php");
if ($SITE_ID == 1) { # TWTD podcasts
print "";
print "Latest Podcasts | ";
$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PH_Category like '%[$TEAM_NAME]%' order by PF_DateTime desc limit 2;";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
print " | {$row['PH_Title']} " . date('jS F Y G:i', strtotime($row['PF_DateTime'])) . " | ";
}
#$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PF_Feed = 23 order by PF_DateTime desc limit 1;";
$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PH_Category like '%[General Football]%' order by PF_DateTime desc limit 1;";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
print " | {$row['PH_Title']} " . date('jS F Y G:i', strtotime($row['PF_DateTime'])) . " | ";
}
print "| More Podcasts | ";
} else if ($SITE_ID == 1073) { # QPR podcasts
print "";
print "Latest Podcasts | ";
$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PH_ID = 33 order by PF_DateTime desc limit 2;";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
print " | {$row['PH_Title']} " . date('jS F Y G:i', strtotime($row['PF_DateTime'])) . " | ";
}
$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PH_Category like '%[$TEAM_NAME]%' order by PF_DateTime desc limit 1;";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
print " | {$row['PH_Title']} " . date('jS F Y G:i', strtotime($row['PF_DateTime'])) . " | ";
}
$sql = "select * from PF_PodcastFiles, PH_PodcastHeader where PH_ID = PF_Feed and PF_Feed = 23 order by PF_DateTime desc limit 1;";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
print " | Second Tier. The Championship Football Podcast " . date('jS F Y G:i', strtotime($row['PF_DateTime'])) . " | ";
}
print "| More Podcasts | ";
}
$adtype = "SuperMPU"; include ("adserver.php");
#if ($TOP == "top960") $adtype = "MPU"; else $adtype = "SuperMPU"; include ("adserver.php");
# $adtype = "SuperMPU"; include ("adserver.php");
boardContent();
print "";$adtype = "MPU_Forum1"; include ("adserver.php"); print " ";
# print "";$adtype = "MPU_Forum2"; include ("adserver.php"); print " ";
echo ' |