Файл: world-faces.ru/world-faces.ru/dnevnik/top.php
Строк: 79
<?
/*Скрипт vmobe.net
venix & PaRaDoX*/
include_once '../i.php';
pdo();
$set['title']='Рейтинги дневников';
verh();
aut();
function dnava($id){
$width=45; $height=50;
if(is_file(H."files/avatar/$id.gif"))
echo "<img src='/files/avatar/$id.gif' align='left' width='$width' height='$height' alt=''/>";
elseif(is_file(H."files/avatar/$id.jpg"))
echo "<img src='/files/avatar/$id.jpg' align='left' width='$width' height='$height' alt=''/>";
elseif(is_file(H."files/avatar/$id.png"))
echo "<img src='/files/avatar/$id.png' align='left' width='$width' height='$height' alt=''/>";
else
echo "<img src='/img/user.png' align='left' width='$width' height='$height' alt=''/>";
}
$mys=DB::$dbs->querySingle("select count(*) from `vmobe_net_dnevnik` where `uid`=?",array($us[id]));
echo '<div class="prof"><a href="/dnevnik/dn'.$us['id'].'">Мой дневник</a> ('.$mys.')</div><div class="prof">'; echo'<hr/>';
$k_post=DB::$dbs->querySingle("select count(`id`) from `vmobe_net_dnevnik` ");
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if($k_post==0) echo "Нет записей<br />";
$res = DB::$dbs->query("select * from `vmobe_net_dnevnik` order by `pros` desc limit $start,$set[p_str]");
while ($dnevnik = $res->fetch()){
echo"<div class='prof'>";
dnava($dnevnik['uid']);
echo "<a href="/dnevnik/view.php?id=".$dnevnik['id']."">";
echo esc(trim(br(bbcode(links($dnevnik['name'])))))."</a> (".vr($dnevnik['date']).") ".(($dnevnik['vip']==1)?'<font color="red">[<b>VIP!</b>]</font>':NULL)."<br/>Просмотров: $dnevnik[pros]<br/> Рейтинг: <a href='view.php?id=$dnevnik[id]&nice'><img src='/library/book/001_18.png' alt='+1' weight='16' height='16' /></a> ".DB::$dbs->querysingle('select count(*) from `dnevnik_votes` where `type`=? and `id_dnev`=?',array(nice,$dnevnik[id]))." / <a href='view.php?id=$dnevnik[id]&bad'><img src='/library/book/001_19.png' alt='-1' weight='16' height='16' /></a> ".DB::$dbs->querysingle('select count(*) from `dnevnik_votes` where `type`=? and `id_dnev`=?',array(bad,$dnevnik[id]))."";
echo"</div>";
}
if ($k_page>0)str('?',$k_page,$page);
include_once '../sys/inc/tfoot.php';
?>