Модератор: [mweb team]
<?php
define("TOPIC_COUNT", $conf["site_topics_on_main"]);
init_userprefs($userdata);
$_sql = "
SELECT
DISTINCT t.topic_id, t.topic_title, t.topic_last_post_id,
t.topic_views, t.topic_replies, p.post_time, f.forum_id,
f.forum_name, u.user_id, u.username
FROM
" . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p,
" . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
WHERE
t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND
p.topic_id = t.topic_id AND p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_time DESC
LIMIT 0, " . 7 ;//TOPIC_COUNT;
$nt_result = $db->sql_query($_sql);
if(!$nt_result)
{
die("Failed obtaining list of active topics".mysql_error());
} else {
$nt_data = $db->sql_fetchrowset($nt_result);
$tpl->assign ('topics',$nt_data);
$tpl->assign ('last_topics', $tpl->fetch ("top_forum.tpl"));
}
?>
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 42