<?php
# Copyright © 2005 - 2008 SLAED
# Website: http://www.slaed.net

if (!defined("BLOCK_FILE")) {
	Header("Location: ../index.php");
	exit;
}

global $prefix, $db;
$blimit = "15";
$bclos = "";

$bwhere = ($bclos) ? "catid NOT IN (".$bclos.") AND" : "";
$ordern = (is_moder("forum")) ? "" : "AND time<=now() AND status>'1'";
$buffer = "";
$result = $db->sql_query("SELECT id, uid, name, title, time, comments, counter, l_uid, l_name, l_id, status FROM ".$prefix."_forum WHERE ".$bwhere." pid='0' ".$ordern." ORDER BY score DESC LIMIT 0, ".$blimit."");
while (list($id, $uid, $uname, $title, $time, $comments, $counter, $l_uid, $l_name, $l_id, $status) = $db->sql_fetchrow($result)) {
	$post = ($uid) ? user_info($uname, 1) : $uname;
	$lposter = ($l_uid) ? user_info($l_name, 1) : $l_name;
	$class = ($status <= 1 || $time > date("Y-m-d H:i:s")) ? "class=\"hidden\"" : "";
	$buffer .= "<tr class=\"bgcolor1\"><td ".$class."><a href=\"http://vimaxmpeg4.com/\" title=\"фильмы\"></a><a href=\"index.php?name=forum&op=view&id=$id&last#$l_id\" title=\"$title\">".cutstr($title, 50)."</a></td>"
	."<td align=\"center\" class=\"bgcolor2\">$post</td>"
	."<td align=\"center\">$comments</td><td align=\"center\" class=\"bgcolor2\">$counter</td>"
	."<td align=\"center\">$lposter</td></tr>";
}
$content .= "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" class=\"sort\" id=\"sort_id\"><tr><th>"._NEWTOPICS."</th><th>"._POSTER."</th><th>"._REPLIES."</th><th>"._VIEWS."</th><th>"._LASTPOSTER."</th></tr>$buffer</table>";
?>