Файл: index.php
Строк: 53
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$tmp->header('home');
$tmp->div('title', Language::config('home'));
User::panel();
$n=$db->fass("select * from `news` ORDER BY time DESC LIMIT 1");
$nc=$db->fass("select count(id) as count from `news`");
$ft=$db->fass("select count(id) as count from `forum_topic`");
if($nc['count'] != 0){
$tmp->div('block', '<a href="/news">'.Language::config('news'). ' </a>'.$tmp->div('menu', '<a href="/news"><b>'.bb(smile($n['name'])).'</a></b> '.times($n['time']).'</br>'.bb(smile($n['message']))));
}
$c=$db->fass("SELECT COUNT(id) as count FROM `mini_chat`");
$ft=$db->fass("SELECT COUNT(id) as count FROM `forum_topic`");
$fs=$db->fass("SELECT COUNT(id) as count FROM `forum_section`");
$u=$db->fass("SELECT COUNT(id) as count FROM `users`");
$tmp->div('menu', '<a href="/forum">'.Language::config('forum').' ('.$fs['count'].'/'.$ft['count'].')</a>');
if($ft['count'] !=0){
$ft2=$db->query("select * from `forum_topic` ORDER BY time DESC LIMIT 5");
while($f=$ft2->fetch_assoc()){
$fc=$db->fass("SELECT COUNT(id) as count FROM `forum_message` where `topic` = '".$f['id']."' ");
$tmp->div('block', '<a href="/forum/topic'.$f['id'].'">'.$f['name'].'</a> ('.$fc['count'].') ');
}
}
$tmp->div('menu', '<a href="/mini_chat">'.Language::config('mini_chat').' ('.$c['count'].')</a>');
$tmp->div('menu', '<a href="/people">'.Language::config('users').' ('.$u['count'].')</a>');
$tmp->footer();
?>