Код:
<?php
if (!defined('BLOCK_FILE')) {
Header("Location: ../index.php");
exit;
}
global $prefix, $db,$bgcolor1, $bgcolor4;
$forum_url = "forum"; //íàçâàíèå ïàïêè â êîòîðîé ëåæèò ôîðóì
$forum_id = ""; // çäåñü âû ìîæèòå óêàçàòü id ôîðóìà êîòîðîãî âû íå õîòèòå ïîêàçûâàòü â ýòîì áëîêå.
$limit = "8"; //ñêîëüêî îòîáðàæàòü òåì â áëîêå
$txtlimit = "30"; // ñêîëüêî ñèìâîîëîâ áóäåò ïîêàçàçàíî èç íàçâàíèÿ òåì
$tableprefix ="forum_"; // prefix âàøåé áàçû vb
@include_once("$forum_url/includes/config.php");
if ($forum_id) {
$forumid = "AND t.forumid=$forum_id";
}
if(_SNSS_LANG == "ru") {
define("_FB_TOPIC","<b>Ïîñëåäíèå òåìû ôîðóìà</b>");
define("_FB_AUTHOR","<b>ÀâÒîÐ</b>");
define("_FB_VIEW","<b>Ïð.</b>");
define("_FB_REPLY","<b>Îò.</b>");
define("_FB_LAST","<b>Îòâåòèë</b>");
define("_FB_INFORM","Èíôîðìàöèÿ ïîëüçîâàòåëÿ");
} else {
define("_FB_TOPIC","<b>Ïîñëåäíèå òåìû ôîðóìà</b>");
define("_FB_AUTHOR","<b>ÀâÒîÐ</b>");
define("_FB_VIEW","<b>Ïð.</b>");
define("_FB_REPLY","<b>Îò.</b>");
define("_FB_LAST","<b>Îòâåòèë</b>");
define("_FB_INFORM","Èíôîðìàöèÿ ïîëüçîâàòåëÿ");
}
if ($limit) {
$limited = "LIMIT $limit";
}
$thread_sql = $db->sql_query("SELECT t.threadid, t.title, t.lastpost, t.lastposter, t.postusername, t.postuserid, t.forumid, t.replycount, t.views, p.postid FROM ".$tableprefix."thread AS t LEFT JOIN ".$tableprefix."post AS p ON(p.postid=t.threadid) WHERE t.visible=1 AND t.open=1 $forumid ORDER BY t.lastpost DESC $limited");
while($thread_get=$db->sql_fetchrow($thread_sql)) {
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$firstposter = $thread_get['postusername'];
$tid = $thread_get['threadid'];
$for = $thread_get['forumid'];
$replycount = $thread_get['replycount'];
$views = $thread_get['views'];
$pid = $thread_get['postid'];
$date2 = date ("d/m/y G:i" ,$lastpost);
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);
$Topic_Buffer .= "<tr bgcolor=\"$bgcolor1\"><td height=\"20\"><a href=\"$forum_url/showthread.php?goto=newpost&t=$pid\">$title</a></td><td align=\"center\"><a href=\"$forum_url/member.php?u=$thread_get[postuserid]\" title=\"Èíôîðìàöèÿ ïîëüçîâàòåëÿ\">$firstposter</a></td><td align=\"center\">$views</td><td align=\"center\">$replycount</td><td align=\"center\">$poster</td></tr>";
}
$content .= "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"$bgcolor4\"><tr><th height=\"20\" align=\"center\"><font class=\"block-title\">Òåìû</font></th><th align=\"center\"><font class=\"block-title\">Àâòîð</font></th><th align=\"center\"><font class=\"block-title\">Ïð.</font></th><th align=\"center\"><font class=\"block-title\">Îò.</font></th><th align=\"center\"><font class=\"block-title\">Ïîñëåäíèé</font></th></tr>";
$content .= "$Topic_Buffer";
$content .= "</table>";
?>