Файл: forum/new_posts.php
Строк: 42
<?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("Новые посты");
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="menu">
<a href="tema'.$assoc['tema'].'" class="menutuch">'.$tname.' ('.$func -> times(date('d m Y H:i:s',$assoc['time'])).')</a></div>
<div class="fon">
<table><tr valign="top"><td>'.$func->avatar($assoc['user']).'</td>
<td style="padding-left:5px;">'.$func->famname($assoc['user']).'';
echo ' '.$func -> times(date('d m Y в H:i',$assoc['time'])).'</br>
<br/>'.$func -> tags($func -> smiles($assoc['text'])).'';
echo'</td></tr></table></div>';
}
$act = 'new_posts.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="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>