Файл: forum/new_p.php
Строк: 73
<?
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/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Форум - новое в темах';
include_once '../sys/inc/thead.php';
title();
aut(); // форма авторизации
$adm_add=NULL;
$adm_add2=NULL;
if (!isset($user) || $user['level']==0){
$q222=mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");
while ($adm_f = mysql_fetch_assoc($q222))
{
$adm_add[]="`id_forum` <> '$adm_f[id]'";
}
if (sizeof($adm_add)!=0)
$adm_add2=' WHERE'.implode(' AND ', $adm_add);
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`$adm_add2"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<table class='post'>n";
$q=mysql_query("SELECT * FROM `forum_t`$adm_add2 ORDER BY `time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет темn";
echo " </td>n";
echo " </tr>n";
}
while ($them = mysql_fetch_assoc($q))
{
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
//$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$post[id_them]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
if($num==1){
echo '<div class="frends">';
$num=0;
}else{
echo '<div class="frends2">';
$num=1;}
echo "".avatar2($ank['id'])."<br />n";
echo "".online($ank['id'])." ";
echo "<a href='/info.php?id=$ank[id]'>$ank[nick]</a>n";
echo " ".medal($ank['id'])."";
echo "<br />";
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' /> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> (".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).") <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>»</a>n";
echo "</div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<div class="foot">n";
echo "»<a href="new_p.php">Новые темы</a><br />n";
echo "«<a href="index.php" title="Вернуться к подфорумам">Форум</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
?>