Файл: albom/my_albom.php
Строк: 51
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
if ($id) {
$type = $db -> query("SELECT `id`,`login` FROM `users` WHERE `id` = '$id'");
if ($type -> num_rows > 0) $the = $type -> fetch_assoc(); else $the = false;
} else $the = false;
if($type -> num_rows > 0){
$diz -> head("Фотоальбомы $the[login]");
$count = $db -> dbcount('COUNT(`id`)','albom_pav',"`user` = '".$id."'");
$diz -> title("<a href='./'>Фотоальбомы</a>/<b>Фотоальбомы $the[login] </b>($count)");
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 * FROM `albom_pav` WHERE `user` = '".$id."' ORDER BY `time` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
$nst2 = $db -> dbcount('COUNT(*)','albom_fotos','`time` > '.(time()-86400).' and `cat`='.$assoc['id'].'');
if ($nst2==0)$nst2=NULL;
else $nst2='<span class="chet">+'.$nst2.'</span>';
$st = $db -> dbcount('COUNT(*)','albom_fotos','`cat`='.$assoc['id'].'');
echo '<div class="fon">'.$diz -> img('albom/albom.png').'<a href="albom'.$assoc['id'].'"> '.$assoc['name'].'</a> <span class="count"/>'.$st.''.$nst2.'</span></br>
'.$assoc['text'].' ('.$func->user($assoc['user']).')</div>';
}
$act = 'my_albom.php?id='.$id.'';
$msg .= ''.$func -> pagenav($act,$page,$total).'';
} else echo 'У '.$the['login'].' ещё нет фотоальбомов!';
}else{header('location: ./');}
}else {header('location: ../aut.php');}
echo '<div class="levo"><a href="./index.php" 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);
?>