Файл: forum/new_tems.php
Строк: 45
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
$diz -> head('Новые темы');
$diz -> title("Новые темы");
$count = $db -> dbcount('COUNT(`id`)','forum_tems');
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 `forum_tems` order by `uptime` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
if($assoc['status']==0){$status =''.$diz -> img('r.png').'';}
if($assoc['var']==1){$sta =''.$diz -> img('zak.png').'';}
elseif($assoc['status']==1){$status=''.$sta.''.$diz -> img('close.png').'';}
$max = $db -> query("SELECT `user`,`time` FROM `forum_posts` where `tema`='".$assoc['id']."' order by `id` desc")-> fetch_assoc();
$cid = $db -> dbcount('COUNT(`id`)','forum_posts'," `tema` = '".$assoc['id']."'");
$tot = intval(($cid - 1) / $num) + 1;
echo '<table width="100%" cellpadding=0 cellspacing=0><tr valign="top">
<td width="95%">
<a href="tema'.$assoc['id'].'" class="mail">
'.$sta.' '.$status.' '.$assoc['name'].' <span class="count">'.$cid.'</span> <br/>
'.$func->famname($assoc['user'],0).'/'.$func->famname($max['user'],0).' '.$func -> vremja($max['time']).'</div>
</a></td>
<td><div class="menu"><a href="tema.php?id='.$assoc['id'].'&page='.$tot.'" class="menutuch">>></a></div></td>
</tr></table>';
}
$act = 'new_tems.php?';
echo ''.$func -> pagenav($act,$page,$total).'';
}else echo '<div class="fon">Тем на форуме пока нет</div>';
}else header('location: '.ROOT.'aut.php');
echo '<div class="levo"><a href="'.ROOT.'forum/" class="levo_tuch">'.$diz -> img('back.png').' Назад</a></div>';
echo '<div class="levo"><a href="'.ROOT.'" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>