Файл: modules/users/journal.php
Строк: 41
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$tmp->header('journal');
$tmp->title('title', Language::config('journal'));
User::panel();
$posts=$db->fass_c("SELECT COUNT(*) as count FROM `journal` where `komy` = '".User::ID()."'");
if($posts==0){
$tmp->div('main', Language::config('no_journal'));
$tmp->footer();
exit();
}
$total = (($posts-1)/$num)+1;
$total = intval($total);
$page = intval($page);
if(empty($page) or $page<0) $page=1;
if($page>$total) $page=$total;
$start=$page*$num-$num;
$journal = $db->query("SELECT * FROM `journal` where `komy` = '".User::ID()."' ORDER BY id DESC LIMIT ".$start.", ".$num." ");
while($j=$journal->fetch_assoc()) {
echo '<div>
<span class="user_notify"><span>'.times($j['time']).'</span>'.nick_new($j['kto']).'</span>
<a href="'.$j['url'].'"><div class="notify'.(($j['readln'] == 0) ? ' notify_new' : NULL).'">'. Language::config($j['message']).'</div></a></div>';
$db->query("UPDATE `journal` set `readln` = '1' where `id` = '".$j['id']."'");
}
page('?');
$tmp->footer();
?>