Файл: soc-set/index.php
Строк: 130
<?php
require_once('core/start.php');
head();
echo DIV_HEAD . '<img src="'.logo().'" class="" alt="'.SITE.'"/>' . CLOSE_DIV;
if (empty($_SESSION['user_id'])) {
echo '<div class="title30"><div class="menu_i">
<table style="width:100%" cellspacing="0" cellpadding="0"><tr>
<td style="vertical-align:top;width:50%;white-space: nowrap;">
<span style = " text-align: right;"><a href="'.HOME.'/auth" class="top_menu_link">Вход</a></td>
<td style="vertical-align:top;width:50%;white-space: nowrap;">
<a href="'.HOME.'/reg" class="top_menu_link">Регистрация</a></span></td>
</tr></table></div></div>';
} else {
/* Сообщения */
$all = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".DIALOG_MSG." WHERE `user_friend` = ? AND `status` = ? ", array($user['user_id'], 1));
/* Лента */
$lenta = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".LENTA." WHERE `user_id` = ? AND `status` = ? ", array($user['user_id'], 1));
panel();
}
switch ($select) {
default:
/* Тикет */
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>В тикете новые сообщения</b></a> ['.$ticket.']' . CLOSE_DIV;
}
}
/* Новости */
$new = DB::$dbs->queryFetch("SELECT * FROM ".NEWS." ORDER BY `id` DESC LIMIT 1");
if (!empty($new)) {
echo DIV_NEWS;
echo '<b>' . $new['title'] . '</b> [' . vrem($new['time']) . ']<br />';
echo text($new['afisha']) . '<br /><br />';
echo DIV_NEW . '<a class="open" href="news/'.$new['id'].'/">Читать полностью</a> <a class="open" href="news/">Все новости</a></div></div>' . CLOSE_DIV ;
echo CLOSE_DIV;
}
/* Акционный блок */
#echo'<div class = "akc"><br /><b>До 15 августа</b> Вы можете бесплатно <a href="'.HOME.'/shop/nickedit/"><b>сменить ник</b></a>, используя при этом <b>кириллицу</b>.<br />Услуга доступна в <a href="'.HOME.'/shop/"><b>магазине</b></a> сайта</div>';
/* 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 DIV_NEWS;
echo user_choice($ank['user_id'], 'link') . ' | <a href="'.HOME.'/shop/vip/">Попасть сюда</a><br />';
echo (empty($ank['photo']) ? '<img src="'.HOME.'/style/img/empty_photo.gif" height="60"/>' : '<a href="'.HOME.'/files/photo/'.$ank['photo'].'" height="60"><img src="'.HOME.'/files/photo/mini_'.$ank['photo'].'" height="60"/></a>');
echo CLOSE_DIV;
}
}
$online = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `last_time` > ? ", array((time() - 2000)));
echo '<div class = "menu5"><a href="'.HOME.'/online/" class="open">Сейчас на сайте ('.$online.' чел.)</a></div> ';
echo'<a href="'.HOME.'/chat/" class = "li2"><span><img src="/img/chat.png" class="ico" alt="'.SITE.'"/> Чат</span> <span class="count">'.count_chat().'</span></a>';
echo' <a href="'.HOME.'/forum/" class = "li2"><img src="/img/forum.png" class="ico" alt="'.SITE.'"/> Форум <span class="count">'.count_forum().'</span></a>';
echo' <a href="'.HOME.'/blog/" class = "li2" ><img src="/img/cv.png" class="ico" alt="'.SITE.'"/> Блоги <span class="count">'.count_blog().'</span></a>';
echo' <a href="'.HOME.'/album/" class = "li2" ><img src="/img/f.png" class="ico" alt="'.SITE.'"/> Фотоальбомы <span class="count">'.count_album().'</span></a>';
echo ' <a href="'.HOME.'/groups/" class = "li2"><img src="/img/s.png" class="ico" alt="'.SITE.'"/> Сообщества <span class="count">'.count_group().'</span></a>';
echo ' <a href="'.HOME.'/guestbook/" class = "li2"><img src="/img/b.png" class="ico" alt="'.SITE.'"/> Беседка <span class="count">'.count_guestbook().'</span></a>';
echo ' <a href="'.HOME.'/lib/" class = "li2"><img src="/img/l.png" class="ico" alt="'.SITE.'"/> Библиотека <span class="count">35332</span></a>';
echo ' <a href="'.HOME.'/loads/" class = "li2"><img src="/img/z.png" class="ico" alt="'.SITE.'"/> Обменник файлов <span class="count">'.count_loads().'</span></a>';
echo ' <a href="'.HOME.'/harem/" class = "li2"><img src="/img/ga.png" class="ico" alt="'.SITE.'"/> Гарем</a>';
echo ' <a href="'.HOME.'/duel/" class = "li2"><img src="/img/nv.png" class="ico" alt="'.SITE.'"/> Дуэли</a>';
echo ' <a href="'.HOME.'/shop/" class = "li2"><img src="/img/mn.png" class="ico" alt="'.SITE.'"/> Магазин<span class="count">4</span></a>';
#echo DIV_LI . '<img src="/img/gm.png" class="ico" alt="'.SITE.'"/> <a href="#">Онлайн-игры</a> [в разработке]<span class="count">2</span></a>';
echo ' <a href="'.HOME.'/users/" class = "li2"><img src="/img/b.png" class="ico" alt="'.SITE.'"/> Пользователи сайта <span class="count">'.count_users().'</span></a>';
$all = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `recording_date` > '".(time() - 86400)."'");
echo DIV_BLOCK;
echo '<a href="'.HOME.'/newusers">Новички за сутки</a> ['.$all.']<br />';
$new = DB::$dbs->queryFetch("SELECT * FROM ".USERS." ORDER BY `recording_date` DESC LIMIT 1");
echo (!empty($new['gender']) ? '<b>Самый новенький:</b> ' : '<b>Самая новенькая:</b> ') . user_choice($new['user_id'], 'link') . '<br />';
echo CLOSE_DIV;
break;
case 'auth':
echo DIV_TITLE . CLOSE_DIV;
echo DIV_AUT;
if (empty($_SESSION['user_id'])) {
echo '<form action="auth.php" method="POST">Ник:<br /><input type="text" name="nick" /><br /><br />Пароль:<br /><input type="password" name="password" /><br /><input type="checkbox" name="remember" value="1" /> Запомнить меня<br /><input type="submit" name="auth" value="Авторизация"/></form>';
} else {
echo 'Вы уже авторизованы';
}
echo CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <b>Авторизация</b>' . CLOSE_DIV;
break;
}
require_once('core/stop.php');
?>