Файл: world-faces.ru/world-faces.ru/forum/new_t.php
Строк: 77
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/dbPDO.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Форум - новые темы';
include_once '../sys/inc/thead.php';
title();
aut(); // форма авторизации
echo "<div class="menu">n";
echo "• <a href="index.php" title="Вернуться к подфорумам">Форум</a> / Новые темыn";
echo "</div>n";
$adm_add=NULL;
$adm_add2=NULL;
if (!isset($user) || $user['level']==0){
$adm_add2=' WHERE';
$q222=DB::$dbs->query("SELECT * FROM `forum_f` WHERE `adm` = '1'");
while ($adm_f = $q222->fetch())
{
$adm_add[]="`id_forum` <> '$adm_f[id]'";
}
$adm_add2.=implode(' AND ', $adm_add);
}
$k_post=DB::$dbs->querySingle("SELECT COUNT(*) FROM `forum_t`$adm_add");
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=DB::$dbs->query("SELECT * FROM `forum_t`$adm_add ORDER BY `time_create` DESC LIMIT $start, $set[p_str]");
if ($k_post==0) {
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет темn";
echo " </td>n";
echo " </tr>n";
}
while ($them = $q->fetch())
{
$forum =DB::$dbs->queryFetch("SELECT * FROM `forum_f` WHERE `id` =? LIMIT 1",array($them['id_forum']));
$razdel=DB::$dbs->queryFetch("SELECT * FROM `forum_r` WHERE `id` =? LIMIT 1",array($them['id_razdel']));
$ank =DB::$dbs->queryFetch("SELECT * FROM `user` WHERE `id` =? LIMIT 1",array($them['id_user']));
if($num==1){
echo "<div class='adm2'>";
$num=0;
}else{
echo "<div class='adm'>";
$num=1;}
echo "".online($ank['id'])." n";
echo "<span style="color:$ank[ncolor]">$ank[nick]</span>n";
echo "<span class="ank_n"><small>(".vr($them['time_create']).")</small></span><br/>n";
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";
$cc = DB::$dbs->querySingle("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` =? AND `id_razdel` =? AND `id_them` =?",array($forum['id'],$razdel['id'],$them['id']));
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> (".$cc.") <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>»</a><br/>n";
echo "</div>";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
include_once '../sys/inc/tfoot.php';
?>