Файл: forum/my_nuts.php
Строк: 61
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
//Выводим закладки
$diz -> head('Мои закладки');
$count = $db -> dbcount('count(`id`)','nuts',"`user` = '".$ya['id']."' and `where`='forum'");
$diz -> title("<a href='./'>Форум</a>/<b>Мои закладки</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;
$nuts = $db -> query("SELECT * FROM `nuts` WHERE `user` = '".$ya['id']."' and `where`='forum' order by `time` DESC LIMIT ".$start.",".$num);
while ($a = $nuts -> fetch_assoc()) {
$assoc = $db -> query("SELECT `id`,`name`,`user` FROM `forum_tems` WHERE `id` = '".$a['idwh']."'")-> fetch_assoc();
$col = $db -> dbcount('COUNT(`id`)','golos',"`where`='forum' and `id_w` = '".$assoc['id']."'");
if($col>0){$st=$diz -> img('golos.png');}else{$st=null;}
if($assoc['status']==0){$status =''.$diz -> img('r.png').' '.$st.'';}
if($assoc['var']==1){$sta =''.$diz -> img('zak.png').'';}
elseif($assoc['status']==1){$status=''.$sta.''.$diz -> img('close.png').''.$st.'';}
$usmax = $db -> dbcount('max(`id`)','forum_posts','`tema`='.$assoc['id'].'');
$max = $db -> query("SELECT * FROM `forum_posts` where `id`='$usmax'")-> fetch_assoc();
$user = $db -> query("SELECT * FROM `users` where `id`='".$max['user']."' ")-> 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%"><div class="menu"><a href="tema'.$assoc['id'].'" class="menutuch">'.$status.' '.$assoc['name'].'<span class="count"/>'.$cid.'</span> <br/>
'.$func->nick($assoc['user'],0).'/'.$func->nick($user['id'],0).' '.$func -> vremja($max['time']).'</a></div></td>
<td><div class="menu"><a href="tema.php?id='.$assoc['id'].'&page='.$tot.'" class="menutuch">>></a></div></td>
</tr></table>';
}
$act = 'my_nuts.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);
?>