Файл: albom/albom.php
Строк: 65
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if($aut){
$pav = $db -> query("SELECT `id`,`name`,`user` FROM `albom_pav` where `id`='$id'")->fetch_assoc();
$diz -> head($pav['name']);
$diz -> title($pav['name']);
if($ya['level']>1 or $pav['user']==$ya['id']){
echo '<div class="levo"><a href="func.php?id='.$id.'&mode=delal" class="levo_tuch">'.$diz -> img('albom/delete.png').' Удалить альбом</a></div>';
echo '<div class="levo"><a href="func.php?id='.$id.'&mode=redal" class="levo_tuch">'.$diz -> img('albom/settings.png').' Редактировать альбом</a></div>';
}
echo '<div class="levo"><a href="/id'.$pav['user'].'" class="levo_tuch">'.$func->avatar($pav['user'],18,18,1).' '.$func->famname($pav['user'],0).'</a></div>';
echo '<div class="levo"><a href="'.ROOT.'id'.$pav['user'].'alboms" class="levo_tuch">'.$diz -> img('albom.png').' Другие альбомы</a></div>';
////-------------------/////
$count = $db -> dbcount('COUNT(`id`)','files',"`where` = '".$id."' and `what`='foto'");
if($count>0){
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
////------------------/////
$for = $db -> query("SELECT `id`,`name`,`url`,`info` FROM `files` where `where`='$id' and `what`='foto' order by `time` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
$nst2 = $db -> dbcount('COUNT(*)','comes',"`idwh` = '".$assoc['id']."' and `where`='albom'");
if ($nst2==0)$nst2=NULL;
else $nst2='<span class="chet">+'.$nst2.'</span>';
$kom = $db -> dbcount('COUNT(`id`)','comes',"`idwh` = '".$assoc['id']."' and `where`='albom'");
$foto = ''.ROOT.'downloads/foto/'.$assoc['url'];
echo '<div class="menu"><a href="foto'.$assoc['id'].'" class="menutuch"/>
<table width=100%>
<tr valign="top">
<td width=2%><img src="/system/resize.php?img='.$foto.'&width=48&height=48&i=0"/></td>
<td>'.$assoc['name'].'<br/> <span class="date"/>'.$diz -> img('comes.png').' Комментарии: <span class="count"/>'.$kom.''.$nst2.'</span></span><br/>
<small>'.$assoc['info'].'</small></td></tr></table></a></div>';
}
$act = 'albom.php?id='.$id;
echo ''.$func -> pagenav($act,$page,$total).'';
} else echo '<div class="fon">В данном фотоальбоме нет фотографий</div>';
echo '<div class="levo"><a href="/id'.$pav['user'].'alboms" class="levo_tuch">'.$diz -> img('back.png').' Назад</a></div>';
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
}else header('Location: '.ROOT.'aut.php');
?>