openside($locale['global_030']);
$result = dbquery(
"SELECT ta.article_id, ta.article_reads, ta.article_subject, tac.article_cat_id, tac.article_cat_access FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
".(iSUPERADMIN ? "" : "WHERE ".groupaccess('article_cat_access'))." AND article_draft='0' ORDER BY article_datestamp DESC LIMIT 0,5"
);
$i = 0;
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>Article</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>Reads</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>Comments</strong></td>\n";
echo "</tr>\n<tr>";
if (dbrows($result)) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 23);
$row_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".THEME_BULLET." <a href='".BASEDIR."articles.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a></td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['article_reads']."</td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".dbcount("(comment_id)", DB_COMMENTS, "comment_type='A' AND comment_item_id='".$data['article_id']."'")."</td>\n";
echo "</tr>\n";
$i++;
}
echo "</table>\n";
} else {
echo "<div style='text-align:center'>".$locale['global_031']."</div>\n";
}
closeside();
openside($locale['global_020']);
echo "<div class='side-label'><strong>".$locale['global_021']."</strong></div>\n";
$result = dbquery("
SELECT tt.forum_id, tt.thread_postcount, tt.thread_views, tt.thread_id, tt.thread_subject, tt.thread_lastpost FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE ".groupaccess('tf.forum_access')." AND tt.thread_hidden='0'
ORDER BY thread_lastpost DESC LIMIT 5
");
$i = 0;
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['global_045']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['global_046']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>Reads</strong></td>\n";
echo "</tr>\n<tr>\n";
if (dbrows($result)) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 23);
$row_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".THEME_BULLET." <a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."' title='".$data['thread_subject']."' class='side'>$itemsubject</a></td>\n";
echo "<td width='1%' class='".$row_color."'>[".($data['thread_postcount'] - 1)."]</td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['thread_views']."</td>\n";
echo "</tr>\n";
$i++;
}
echo "</table>\n";
} else {
echo "<div style='text-align:center'>".$locale['global_023']."</div>\n";
}
closeside();
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions