Файл: world-faces.ru/world-faces.ru/dnevnik/func.php
Строк: 73
<?
/*Скрипт vmobe.net
venix & PaRaDoX*/
include_once '../i.php';
pdo();
$set['title']='VMOBE.NET';
verh();
aut();
function fotka($time){
$width=45; $height=47;
if(is_file(H."dnevnik/files/$time.gif"))
echo "<a href='file.php?time=$time&download'><img src='files/$time.gif' width='$width' height='$height' alt=''/></a>";
elseif(is_file(H."dnevnik/files/$time.jpg"))
echo "<a href='file.php?time=$time&download'><img src='files/$time.jpg' width='$width' height='$height' alt=''/></a>";
elseif(is_file(H."dnevnik/files/$time.png"))
echo "<a href='file.php?time=$time&download'><img src='files/avatar/$time.png' width='$width' height='$height' alt=''/></a>";
else
echo NULL;
}
$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"><a href="/dnevnik">Все дневники</a> ('.DB::$dbs->querySingle("select count(*) from `vmobe_net_dnevnik`").')</div>'; echo'<hr/>';
$inf=htmlspecialchars(mysql_real_escape_string(trim($_GET['inf'])));
switch($inf){
case 'allf':
$id = intval($_GET['id']);
$k_post=DB::$dbs->querySingle("select count(*) from `dnevnik_files` where `id_dnev` = $id");
$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'<div class="prof">Нет файлов</div>';
$res = DB::$dbs->query("select * from `dnevnik_files` where `id_dnev`= ? order by `id` desc limit $start,$set[p_str]",array($id));
while ($fo = $res->fetch()){
echo "<div class='prof'>";
$w=31; $h=33;
echo '<div class="title">'.(($fo['opis']==NULL)?'<b>Без описания...</b>':''.$fo['opis'].'').' '.(($fo['id_us']==$us['id'] || $us['level_access']>=50)?'<a href="view.php?id='.$fo['id_dnev'].'&time='.$fo['time'].'&delete">[удалить]':'').'</div>'.fotka($fo['time']).'</a>';
echo 'Рейтинг: <a href="file.php?time='.$fo['time'].'&nicef"><img src="/library/book/001_18.png" alt="+1" weight="16" height="16" /></a> '.DB::$dbs->querysingle('select count(*) from `dnevnik_f_votes` where `type`=? and `id_file`=?',array(nice,$fo[id])).' / <a href="file.php?time='.$fo['time'].'&badf"><img src="/library/book/001_19.png" alt="-1" weight="16" height="16" /></a> '.DB::$dbs->querysingle('select count(*) from `dnevnik_f_votes` where `type`=? and `id_file`=?',array(bad,$fo[id])).'<br/>';
echo 'Скачек: '.$fo['downloads'].'';
echo'</div>';}
echo '<div class="prof"><a href="view.php?id='.$id.'">Обратно</a></div>';
if ($k_page>0)str('?',$k_page,$page);
break;
case kommdel:
if($us['level_access']>=20){
$id=intval($_GET['id']);
$get=DB::$dbs->queryFetch('select * from `dnevnik_komms` where `id`=? limit 1',array($id));
if(empty($get['komm'])){header('location:view.php?id='.$get['id_dnev'].''); niz(); exit(); }
DB::$dbs->Query("Delete from `dnevnik_komms` where `id` = ? limit 1",array($id));
header('location:view.php?id='.$get['id_dnev'].'');
}
break;
}
niz();
?>