Файл: forumm/my_komm.php
Строк: 60
<?
if(!isset($user))header("Location: /");
echo "<div class='header_path'><a href='/'>$_SERVER[HTTP_HOST]</a>/<a href='/forumm'>Форум</a>/<a href='?last_komm'>Последние</a></div>n";
echo "<div class='main'><div style='padding:1px;background-color:#ffffff'>n";
echo "<img src='http://i.spaces.ru//search.gif' alt=''/> <a href='/forumm/?search'><span style='color:#336699'><b>Поиск</b></span></a></div><div style='padding:2px;background-color:#fff9d7;border-top:1px solid #e2c822;border-bottom:1px solid #e2c822'><a href='/forumm/'>Разделы</a> | <a href='?last'>Последние</a> | <a href='/forumm/?new'>Новые</a> <a href='?rating'>Популярные</a> | <a href='/forumm/?my_themes'>Мои темы</a> | <b>Коммент</b></div>n";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them_komm` WHERE `id_user` = '$user[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$last_list = mysql_query("SELECT * FROM `forum_them_komm` WHERE `id_user` = '$user[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($last_list)==0) {
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Список пустn";
echo " </td>n";
echo " </tr>n";
}
while ($post = mysql_fetch_array($last_list))
{
if($num==1){
echo "<div style='padding:1px;background-color:#edeff4;border-top:1px dotted #CCC'>";
$num=0;
}else{
echo "<div style='padding:1px;background-color:#fff;border-top:1px dotted #CCC'>";
$num=1;}
$postt=mysql_fetch_array(mysql_query("SELECT * FROM `forum` WHERE `id` = '$post[id_them]' AND `type` = 'tema' LIMIT 1"));
$ftv=mysql_fetch_array(mysql_query("SELECT * FROM `forum_them_visited` WHERE `id_them` = '$postt[id]' AND `id_user` = '$user[id]' LIMIT 1"));
if($user['level']!=0)$count_komm_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]' AND `time` > '$ftv[time]'"),0);
else $count_komm_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]' AND `skrit` = '0' AND `time` > '$ftv[time]'"),0);
if($user['level']!=0)$count_komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]'"),0);
elseif(isset($user))$count_komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]' AND `skrit` = '0'"),0);
else $count_komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]' AND `skrit` = '0'"),0);
echo "<a href='?id=$postt[id]'>$postt[name]</a> <span style='color: #209143;font-size: small'>(".vremja($postt['time']).")</span>
($count_komm)n";
if($count_komm_new>0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them_visited` WHERE `id_user` = '$user[id]' AND `id_them` = '$post[id]' LIMIT 1"),0)!=0)echo " <font color='red'><b>(+$count_komm_new)</b></font>n";
if($postt['close']==1)echo " <img src='http://i.spaces.ru//topic_locked.gif' alt='loced' /><br/>n";
else echo "<br/>n";
$last_user_komm = mysql_fetch_array(mysql_query("SELECT * FROM `forum_komm` WHERE `id_them` = '$postt[id]' ORDER BY time DESC LIMIT 1"));
$last_user=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $last_user_komm[id_user] LIMIT 1"));
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $postt[id_user] LIMIT 1"));
echo "<span style='color:#79358c'><b>$avtor[nick]</b></span>n";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$postt[id]' LIMIT 1"),0)!=0)echo " $last_user[nick] <span style='color: #209143; font-size: small'>(".vremja($last_user_komm['time']).")</span>n";
echo "</div>n";
}
if ($k_page>1)str("/forumm/?my_komms&",$k_page,$page); // Вывод страниц
echo "</div>n";
?>