Файл: www/adforum/us_t.php
Строк: 44
<?
##########################################
## Автор модификации -=DEN=- aka PITBULL##
## icq 647732 ##
## mail mobilas91@gmail.com ##
## запрещено торговать скриптом ##
##########################################
require_once"../system/start.php";
require_once"../system/sid.php";
require("../config.php");
$tyu="left";
$title="Форум";
head();
list($row, $myid, $ps, $fs1, $fs2) = check_login($link);
echo $fs1;
$k_post=$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `forum_topic` where `login` = '".$usid."';"),0);
$select = @$db->sql_query ("Select * from users where id='".$usid."'");
$inf = $db->sql_fetchrow ($select);
echo "$div1 <b>Темы ".$inf['user']." ($k_post)</b> $div9<br />";
if (empty($row['max'])) $row['max']=10;
$max = $row['max'];
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
$q=$db->sql_query("SELECT * FROM `forum_topic` where `login` = '".$usid."' ORDER BY `time` DESC LIMIT $start, ".$max."");
if ($db->sql_numrows($q)==0) {
echo "Нет темn";
}
while ($them = $db->sql_fetchrow($q))
{
$forum=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_sections` WHERE `id` = '$them[section]' LIMIT 1"));
$razdel=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_subfor` WHERE `id` = '$them[subfor]' LIMIT 1"));
$ank=$db->sql_fetchrow($db->sql_query("SELECT * FROM `users` WHERE `id` = $them[login] LIMIT 1"));
echo "$div2<a href='./tema/".$them['id']."'>$them[name]</a> <a href='./tema/".$them['id']."/end'>(".$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `forum_message` WHERE `section` = '$forum[id]' AND `subfor` = '$razdel[id]' AND `topic` = '$them[id]'"),0).")</a>$div9n";
echo "<a href='subfs/".$them['section']."'>$forum[name]</a> > <a href='temes/".$them['subfor']."'>$razdel[name]</a><br />n";
//$post1=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_message` WHERE `topic` = '$them[id]' AND `subfor` = '$razdel[id]' AND `section` = '$forum[id]' AND `login` = '$them[login]' LIMIT 1"));
//$ank=$db->sql_fetchrow($db->sql_query("SELECT * FROM `users` WHERE `id` = $them[login] LIMIT 1"));
//echo "Автор: <a href='".H."$ank[id]' title='Анкета "$ank[user]"'>$ank[user]</a> (".date("d.m в H:i", $post1['time']).")<br />n";
$post=$db->sql_fetchrow($db->sql_query("SELECT * FROM `forum_message` WHERE `topic` = '$them[id]' AND `subfor` = '$razdel[id]' AND `section` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
$ank2=$db->sql_fetchrow($db->sql_query("SELECT * FROM `users` WHERE `id` = $post[login] LIMIT 1"));
echo "Посл.: <a href='".H."$ank2[id]' title='Анкета "$ank2[user]"'>$ank2[user]</a> (".date("d.m в H:i", $post['time']).")<br />n";
echo'';
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<br />$div1<img src="../img/naz.gif" alt="[N]"/> <a href="./index.php?$ses">Форум</a>$div9";
if($autorize){ echo "$div1<img src="../img/naz.gif" alt="[N]"/> <a href="../index.php?$ses">На Главную</a>$div9";}
foot ();
?>