soulbadguy
Nuke Soldier


Joined: Feb 01, 2005
Posts: 19
|
Posted:
Sat Mar 12, 2005 3:02 am |
  |
The 10 Most Recent Posts on my frontpage(using czcenter blocks) I only see the 10 Most Recent threads. The Top 10 doesn't include replies to threads, just top level posts (New Topics). I edited my center blocks code so maybe the problem's in there , the website is www.pinoyforum.net
Really need a solution for this... here's my center block code.
| Code: |
// Center block Forums
define("_CZCENTERFORUM_NEWTOPICS","New Topics");
define("_CZCENTERFORUM_POSTER","Poster");
define("_CZCENTERFORUM_VIEWS","Views");
define("_CZCENTERFORUM_REPLIES","Replies");
define("_CZCENTERFORUM_LASTPOSTER","Last Poster");
define("_CZCENTERFORUM_TOTTOPICS","Topics: ");
define("_CZCENTERFORUM_TOTPOSTS","Posts: ");
define("_CZCENTERFORUM_TOTMEMBERS","Members:");
define("_CZCENTERFORUM_FORUM","Enter Forum");
define("_CZCENTERFORUM_SEARCH","Search Forum");
define("_CZCENTERFORUM_TITLE","Latest from");
global $prefix, $user_prefix, $db, $sitename, $bgcolor1, $bgcolor2, $bgcolor3, $ThemeSel;
//Bodify First Post
$post_trigger = 0;
//When set to 1 then Forums permissions will apply.
$permissionstoread = 1;
//# Of Topics
$toshow = 3;
$toshow2 = 10;
//Topic Image
$TopicImage = "<img src=\"themes/$ThemeSel/forums/images/folder.gif\" border=\"0\">";
/**********************/
/* Don't Edit Below ! */
/**********************/
//Total Topics
function cztotal_topics() {
global $prefix, $db;
$sql = "SELECT COUNT(*) FROM ".$prefix."_bbtopics";
list($total_topics) = $db->sql_fetchrow($db->sql_query($sql));
return $total_topics;
}
//Total Posts
function cztotal_posts() {
global $prefix, $db;
$sql = "SELECT COUNT(*) FROM ".$prefix."_bbposts";
list($total_posts) = $db->sql_fetchrow($db->sql_query($sql));
return $total_posts;
}
//Total Members
function cznumusers() {
global $prefix, $db;
$sql = "SELECT COUNT(*) FROM ".$prefix."_users WHERE user_id > 1";
list($numrows) = $db->sql_fetchrow($db->sql_query($sql));
return $numrows;
}
/* Last X New Topics */
$result = $db->sql_query("SELECT t.topic_id, t.topic_poster, t.topic_views, t.topic_replies, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id, u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id) LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id) WHERE t.forum_id=f.forum_id AND (f.forum_id=1 OR f.forum_id=25) AND f.auth_view=0 ORDER BY t.topic_id DESC LIMIT $toshow");
$result_recent = $db->sql_query("SELECT t.topic_id, t.topic_poster, t.topic_views, t.topic_replies, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id, u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id) LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id) WHERE t.forum_id=f.forum_id AND f.auth_view=0 ORDER BY t.topic_id DESC LIMIT $toshow2");
while(list($topic_id, $topic_poster, $topic_views, $topic_replies, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result)) {
$result2 = $db->sql_query("SELECT username FROM ".$user_prefix."_users where user_id='$topic_poster'");
list($ouname) = $db->sql_fetchrow($result2);
$OrigPoster = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$topic_poster\"> $ouname </a>";
$TopicTitleShow .= "<li><a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_po st_id\"><font face=verdana color=white>$topic_title</font></a></li>";
$LastPoster .= "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$username</a><br>";
$Topic_CountReplies .= "$topic_replies<br>";
if ($post_trigger == 0) {
$LastPoster = "<b>$LastPoster</b>";
$TopicTitleShow = "<li><a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_po st_id\"><font size=3 face=verdana><b>$topic_title</b></font></a></li>";
$Topic_CountReplies = "<b><font size=3 color=yellow>$Topic_CountReplies</font></b>";
$post_trigger = 1;
}
}
while(list($topic_id, $topic_poster, $topic_views, $topic_replies, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result_recent)) {
$result3 = $db->sql_query("SELECT username FROM ".$user_prefix."_users where user_id='$topic_poster'");
list($ouname2) = $db->sql_fetchrow($result3);
$OrigPoster2 = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$topic_poster\"> $ouname </a>";
$LastPoster2 = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\"><font size=1>$username</font></a>";
$topic_replies = "<b>$topic_replies</b>";
$forum_name_upr = "<tr><td align=right width=180>(<font size=1 color=#bbbbbb>".strtoupper($forum_name)."</font>)</td> ";
$TopicTitleShow2 .= "<div class=indents>$forum_name_upr<td><li><a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_po st_id\">$topic_title</a> <font size=1>- $topic_replies Replies, Last Reply by: $LastPoster2</font></li></td></tr></div>";
}
|
|
|
|