Файл: forum/inc/razdel.php
Строк: 69
<?php
/*
* Форум
* DCMS Special
* Модифицировал densnet
* Файл razdel.php
*/
err();
aut();
if (isset($user) && (!isset($_SESSION['time_c_t_forum']) || $_SESSION['time_c_t_forum'] < $time - 600 || $user['level'] > 0)) {
echo "<div class = 'razd'>";
echo "<span class = 'icon icon68' /> <a href = '/forum/$forum[id]/$razdel[id]/?act=new'>Новая тема</a><br /><br />";
echo "<span class = 'icon icon178' /> <a href = '/forum/$forum[id]/$razdel[id]/?act=newop'>Новый опрос</a>";
echo "</div>";
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = mysql_query("SELECT * FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' ORDER BY `up` DESC,`time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q) == 0) {
echo "<table class = 'razd'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет тем в разделе "$razdel[name]"";
echo "</td></tr></table>";
}
while ($them = mysql_fetch_assoc($q)) {
echo "<table class = 'razd'><tr><td class = 'null'>";
$prosm = mysql_result(mysql_query("SELECT `prosm` FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id` = '$them[id]'"), 0);
echo "<span class = 'icon icon46' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> ";
if ($them['close'] == 00){
echo "<font color = 'green'>(Открыта)</font>";
}elseif ($them['close'] == 01) {
echo "<font color = 'red'>(Закрыта)</font>";
}elseif ($them['close'] == 10) {
echo "<font color = 'green'>(Закреплена | Открыта)</font>";
}elseif ($them['close'] == 11) {
echo "<font color = 'red'>(Закреплена | Закрыта)</font>";
}
echo "<span class = 'count'>";
//echo "<img src = '/style/icons/them_$them[up]$them[close].png' />";
echo "<img src = '/style/icons/comment_white_mini.png' />" . mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"), 0);
echo "</span><span class = 'count'>";
echo "<img src = '/style/icons/eye_mini.png' /> $prosm";
echo "</span><br />";
$post1 = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` ASC LIMIT 1"));
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post1[id_user] LIMIT 1"));
echo "Автор: ";
echo "<a href = '/info.php?id=$ank[id]'>n";
echo text::gradient("$ank[nick] ", "$ank[ncolor]", "$ank[ncolor2]");
echo "</a> | ";
$post = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
$ank2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if ($ank2 == 0){
echo "Не писали еще";
}
echo "<a href = '/info.php?id=$ank2[id]'>n";
echo text::gradient("$ank2[nick] ", "$ank2[ncolor]", "$ank2[ncolor2]");
echo "</a>";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str("/forum/$forum[id]/$razdel[id]/?", $k_page, $page);
}