Файл: test.masteram.us/dnev/index.php
Строк: 214
<?
include '../Core.php';
$set[title]='Дневники ';
include_once '../sys/inc/thead.php';
title();
err();
echo "<div class='menu_razd'>";
echo "<img src='/style/icons/top10.png' alt='' class='icon'/> <a href='/top/top_blog.php'>Топ Блогеров</a> | n";
echo "<a href='/top/top_komm_blog.php'>Комментаторов</a>n";
echo "</div>";
echo "<div class='tmn'>";
echo "Сорт:n";
if (!isset($_GET[time])) echo "<a href='?time'>Время</a>n";
if (isset($_GET[time])) echo "<font color='red'>Время</font>n";
echo "n|n";
if (!isset($_GET[komm])) echo "<a href='?komm'>Комментарии</a>n";
if (isset($_GET[komm])) echo "<font color='red'>Комментарии</font>n";
echo "n|n";
if (!isset($_GET[look])) echo "<a href='?look'>Просмотры</a>n";
if (isset($_GET[look])) echo "<font color='red'>Просмотры</font>n";
if (isset($user)) {
echo "<br/><img src='/style/icons/plus.gif' alt='' class='icon'/>n";
echo "<a href='add.php'>Новая запись</a>";
}
echo "</div>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `read` = '0'"),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";
$lim=" LIMIT $start, $set[p_str]";
$order='`time` DESC';
if (isset($_GET[time])) $order='`time` DESC';
if (isset($_GET[komm])) $order='`komm` DESC';
if (isset($_GET[look])) $order='`look` DESC';
$q=mysql_query("SELECT * FROM `dnev` WHERE `read` = '0' ORDER BY $order $lim");
if (mysql_num_rows($q)==0) {
echo "Нет дневниковn";
}
while ($dnev = mysql_fetch_assoc($q))
{
echo " <tr>n";
echo " <td class='linechat'>n";
echo "<img src='/style/icons/dnev.gif' alt='' class='icon'/>n";
echo "<a href='dnev.php?id=$dnev[id]'>$dnev[name]</a> <font color='#afb0a3'>(".vremja($dnev[time]).") </font><img src='/style/icons/kom.gif' alt='' class='icon'/> <font color='red'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0)."</font><br />n";;
echo "<font color='#313431'>";
echo output_text(cut_text(($dnev[msg])))."...n";
echo " <a href='dnev.php?id=$dnev[id]'>»</a></font><br/>";
$ank=get_user($dnev['id_user']);
echo " ".online($ank['id'])." <a href='/info.php?id=$ank[id]' title='Анкета "$ank[nick]"'><span style="color:$ank[ncolor]">$ank[nick]</span></a>n";
if ($ank['obit']==0)
{
$ank1=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if ($ank['group_access']>1)echo "<img src='/img/online/$ank[pol].png'>n";
///if ($ank['group_access']>1)echo "<img src='/style/adm.png'>n";
}
if ($ank['status_vip']==1)echo " <img src='/status_vip/img/vip.gif'<br />";
if($ank['akt_rating']>=0 && $ank['akt_rating']<=1.000)echo " ";
if($ank['akt_rating']>=1.001 && $ank['akt_rating']<=2.500)echo " <img src='/style/rating/bronze.gif'></img> ";
if($ank['akt_rating']>=2.501 && $ank['akt_rating']<=5.000)echo " <img src='/style/rating/silver.gif'></img> ";
if($ank['akt_rating']>=5.001 && $ank['akt_rating']<=7.500)echo " <img src='/style/rating/gold.gif'></img> ";
if($ank['akt_rating']>=7.501 && $ank['akt_rating']<=10.000)echo " <img src='/style/rating/lafes_user.gif'></img> ";
if($ank['akt_rating']>=10.001 && $ank['akt_rating']<=200.000)echo " <img src='/rating/konkurs.png'></img> ";
if ($ank['brak']!=NULL)echo "<img src='/style/icons/rings.gif' alt='' class='icon'/> n";
if ($ank['braks']!=NULL)echo "<img src='/style/icons/rings.gif' alt='' class='icon'/> n";
if ($ank['stran']==0)echo "n";
if ($ank['stran']==1)echo "<img src='/style/strana/ru.png'>n";
if ($ank['stran']==2)echo "<img src='/style/strana/ua.png'>n";
if ($ank['stran']==3)echo "<img src='/style/strana/by.png'>n";
if ($ank['stran']==4)echo "<img src='/style/strana/az.png'>n";
if ($ank['stran']==5)echo "<img src='/style/strana/kz.png'>n";
if ($ank['stran']==6)echo "<img src='/style/strana/uz.png'>n";
if ($ank['stran']==7)echo "<img src='/style/strana/england.png'>n";
if ($ank['stran']==8)echo "<img src='/style/strana/de.png'>n";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time'"), 0)!=0)
echo "<font color='red'>[BAN]</font>n";
echo "<br/>n";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0)!=0) {
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]' ORDER BY `time` DESC LIMIT 1"));
}
}
if ($k_page>1)str("?id=$dnev[id]&",$k_page,$page); // Вывод страниц
echo "</table>n";
echo "<div class='aut'>";
$all_dnev=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `read` = '0'"),0);
$new_d=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `time` > '".(time()-86400)."' AND `read` = '0'"), 0);
$all_dnev_k=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom`"),0);
$new_d_k=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `time` > '".(time()-86400)."' "), 0);
echo "Всего дневников $all_dnev <font color='red'>+$new_d Сегодня</font><br/>Всего комментариев $all_dnev_k <font color='red'>+$new_d_k Сегодня</font>";
echo "</div>";
include_once '../sys/inc/tfoot.php';
?>