Файл: forum/new_posts.php
Строк: 34
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
$diz -> head("Новые посты");
$count = $db -> dbcount('COUNT(`id`)','forum_posts');
$diz -> title("<a href='./'>Форум</a>/<b>Новые посты</b>");
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_posts` ORDER BY `id` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
$tname = $db -> dbcount('name','forum_tems',"`id` = '".$assoc['tema']."'");
echo '<div class="fon">'.$func->user($assoc['user']).': <a href="tema'.$assoc['tema'].'">'.$tname.'</a> ('.$func -> times(date('d m Y H:i:s',$assoc['time'])).')'.$dop.'
'.$func -> smiles($func -> tags($assoc['text'])).'</div>';
}
$act = 'new_posts.php?';
echo ''.$func -> pagenav($act,$page,$total).'';
}else echo '<div class="fon">Постов на форуме пока нет!</div>';
}else header('location: /aut.php');
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>