Файл: forum/my_posts.php
Строк: 40
<?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`)','forum_posts',"`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 `id`,`text`,`tema`,`time` FROM `forum_posts` WHERE `user` = '".$id."' 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">
<a href="tema'.$assoc['tema'].'">'.$tname.'</a> ('.$func -> times(date('d m Y H:i:s',$assoc['time'])).')'.$dop.'<br/><br/>
'.$func -> smiles($func -> tags($assoc['text'])).'</div>';
}
$act = 'my_posts.php?id='.$id.'';
echo ''.$func -> pagenav($act,$page,$total).'';
} else echo '<div class="fon">У '.$the['login'].' ещё нет постов на форуме!</div>';
}else header('location: ./');
}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);
?>