Файл: forumm/last_komm.php
Строк: 65
<?
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> | <a href='/forumm/?rules'><span style='color:#336633'><b>Правила Форума</b></span></a></span></div><div style='padding:2px;background-color:#fff9d7;border-top:1px solid #e2c822;border-bottom:1px solid #e2c822'><a href='/forumm/'>Разделы</a> | <b>Последние</b> | <a href='/forumm/?new'>Новые</a> | <a href='/forumm/?rating'>Популярные</a> | <a href='/forumm/?my_themes'>Мои темы</a> | <a href='/forumm/?new_komms'>Коммент</a></div>n";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `time_obnov` > '".(time()-86400)."' AND `type` = 'tema'"),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` WHERE `time_obnov` > '".(time()-86400)."' AND `type` = 'tema' ORDER BY time 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;}
$ftv=mysql_fetch_array(mysql_query("SELECT * FROM `forum_them_visited` WHERE `id_them` = '$post[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` = '$post[id]' AND `time` > '$ftv[time]'"),0);
else $count_komm_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$post[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` = '$post[id]'"),0);
elseif(isset($user))$count_komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$post[id]' AND `skrit` = '0'"),0);
else $count_komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_komm` WHERE `id_them` = '$post[id]' AND `skrit` = '0'"),0);
echo "<a href='?id=$post[id]'>$post[name]</a> <span style='color: #209143;font-size: small'>(".vremja($post['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($post['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` = '$post[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` = $post[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` = '$post[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/?last&",$k_page,$page); // Вывод страниц
echo "</div>n";
?>