Файл: style/themes/default_web/index.php
Строк: 69
<?php
/**
* @package Prime Social
* @link http://primesocial.ru
* @copyright Copyright (C) 2016 Prime Social
* @author BoB | http://primesocial.ru/about
*/
/* Tiket */
if (privilegy('ticket')) {
$ticket = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".TOUCH_MSG." WHERE `status` = ?", array(1));
if ($ticket > 0) {
echo DIV_BLOCK . '<a href="'.HOME.'/panel/ticket/"><b>Tiketda yangi habar</b></a> ['.$ticket.']' . CLOSE_DIV;
}
}
/* Yangiliklar */
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".NEWS."");
if (empty($all)) {
} else {
$n = new Navigator($all,$config['write']['news'],'');
$sql = DB::$dbs->query("SELECT * FROM ".NEWS." ORDER BY `id` DESC LIMIT 2");
while($new = $sql -> fetch()) {
$comm = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".NEWS_COMM." WHERE `new_id` = ?", array($new['id']));
echo '<div class="sts">
<a href="'.HOME.'/news/'.$new['id'].'/"><b>' . $new['title'] . '</b></a><br/>';
echo '<font style="font-size:13px;">'. text($new['afisha']) . '</font><br/>
<font style="font-size:11px;">Sharhlar: '.$comm.' Sana: ' . vrem($new['time']) . '</font>';
echo '</div>';
}
}
echo '<table cellspacing="0" cellpadding="0" width="100%" ><tr>
<td width="50%" class="white" style="vertical-align:top;">';
$online = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `last_time` > ? ", array((time() - 2000)));
echo '
- <a href="'.HOME.'/online/" >Hozir saytda '.$online.' kishi</a><br/>
- <a href="'.HOME.'/faq" >Saytda hali yangimisiz?</a><br/>
- <a href="'.HOME.'/ustav/" >Sayt qoidasi</a><br/>
- <a href="'.HOME.'/users/">Foydalanuvchilar '.count_users().'</a>';
echo '</td>';
echo '<td class="white" width="50%" >';
/* VIP */
$vip = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `vip` > ? ", array(time()));
if (!empty($vip)) {
$ank = DB::$dbs->queryFetch("SELECT `photo`, `user_id` FROM ".USERS." WHERE `vip` > ? AND `last_time` > ? ORDER BY RAND() DESC LIMIT 1", array(time(), (time()-2000)));
if (!empty($ank)) {
echo '<table cellspacing="0" cellpadding="0" width="100%" ><tr>
<td class="white" width="10%">';
echo '' . avatar($ank['user_id'],60,60) . '';echo '</td>';
echo '<td class="white" width="90%" >';
echo user_choice($ank['user_id'], 'link') . '<br /> <a href="'.HOME.'/shop/vip/">Qo`shilish</a>';
echo '</td></tr></table>';
}
}
echo '</td></tr></table>';
/* Forum */
echo '<div class="touch">';
echo '<a href="'.HOME.'/forum/">'.icon('forum.png').' Forum <span class="count">'.count_forum().'</span></a></div>';
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_THEME."");
if (empty($all)) {
echo DIV_BLOCK . 'Mavzular hali ochilmagan' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_post'],'select=new_themes');
$sqlf = DB::$dbs->query("SELECT * FROM ".FORUMS_THEME." ORDER BY `activ` DESC LIMIT 5");
while($theme = $sqlf -> fetch()) {
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
echo '<div class="touch"><a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/">'.icon('pages.png').' '.$theme['name'].' <span class="count">'.$posts.'</span></a></div>';
}
}
$array = array('Prime Social');
nav($array);
?>