Файл: albom/cat.php
Строк: 44
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
$cat = $db -> query("SELECT `id`,`name` FROM `albom_cat`")->fetch_assoc();
$diz -> head('Фотоальбомы');
$diz -> title("<a href='./'>Фотоальбомы</a>/<b>".$cat['name']."</b>");
////-------------------/////
$count = $db -> dbcount('COUNT(`id`)','albom_pav',"`cat` = '".$id."'");
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 `cat`='$id' order by `time` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
$nst2 = $db -> dbcount('COUNT(`id`)','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="menu"><a href="albom'.$assoc['id'].'" class="menutuch">
<table width=100%><tr valign="top"><td width="2%">';
if($assoc['obl']!=0){
$fo = $db -> query("SELECT `url` FROM `albom_fotos` where `id`='$assoc[obl]'")-> fetch_assoc();
echo'<img src="/system/resize.php?img='.ROOT.'albom/'.$fo['url'].'&width=64&height=64&i=0" alt=""/>';
} else echo $diz -> img('user.gif');
echo'</td><td> '.$assoc['name'].' <span class="count"/>'.$st.''.$nst2.'</span></br>
'.$assoc['text'].'<br/>
'.$func->user($assoc['user']).'</td></tr></table></a></div>';
}
$act = 'cat.php?id='.$id;
echo ''.$func -> pagenav($act,$page,$total).'';
} else echo '<div class="fon">Фотоальбомов в данной категории пока нет</div>';
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>