Файл: index.php
Строк: 151
<?
include 'connect.php';
$title = $title.' | Главная';
include 'thead.php';
require('core/ava_min.php');
# новости
$cusers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
$cnews = mysql_fetch_array(mysql_query("SELECT * FROM `news` ORDER BY `time` DESC"));
if ($cnews) $cnews = '('.vremya($cnews['time']).')';
# газета
$cjurnal = mysql_fetch_array(mysql_query("SELECT * FROM `gazeta` ORDER BY `time` DESC"));
if ($cjurnal) $cjurnal = '('.vremya($cjurnal['time']).')';
# Лента
$lenta = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta`"), 0);
$lenta2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `lenta` WHERE `time` > '".(time()-(30*30*12))."'"), 0);
if($lenta2 > 0) $lenta_new = '<font color = "red">+'.$lenta2.'</font>';
# Админка
$admin_jurnal = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `admin_jurnal`"), 0);
$admin_jurnal2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `admin_jurnal` WHERE `time` > '".(time()-(30*30*12))."'"), 0);
if($admin_jurnal2 > 0) $admin_jurnal_new = '<font color = "red">+'.$admin_jurnal2.'</font>';
# беседка
$carbour = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `arbour`"), 0);
$carbour2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."' AND `location` = 'arbour'"), 0);
# чат
$cchat = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."' AND `location` = 'chat'"), 0);
# форум
$cforum = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_themes`"), 0);
$cforum2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_messages`"), 0);
$cforum3 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_messages` WHERE `time` > '".(time()-(60*60*24))."'"), 0);
if($cforum3 > 0) $forum_new = '<font color = "red">+'.$cforum3.'</font>';
# знакомства
$cusers_zh = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex` = 'zh'"), 0);
$cusers_m = $cusers-$cusers_zh;
# топ фотографий
$cphotos_top = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_photo` WHERE `top` = '1'"), 0);
# дуели
$cduels = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `time_end` > '".time()."'"), 0);
# гаремы
$cgarem = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_list` WHERE `users` > '0'"), 0);
# дневники
$cdiary = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `diary_messages`"), 0);
$cdiary2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `diary_messages` WHERE `time` > '".(time()-(60*60*24))."'"), 0);
if($cdiary2 > 0) $diary_new = '<font color = "red">+'.$cdiary2.'</font>';
# микроблоги
$cblog = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `microblog_messages`"), 0);
$cblog2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `microblog_messages` WHERE `time` > '".(time()-(60*60*24))."'"), 0);
if($cblog2 > 0) $blog_new = '<font color = "red">+'.$cblog2.'</font>';
# пользователи
$cusers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
$cusers_online = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."'"), 0);
# администрация
$admins = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `admin`"), 0);
if($_GET['rek'])echo '<div class="nav">По поводу рекламы пишите на ник Admin</div>';
echo '<div class="touch">';
if($u['id']){
$req = mysql_query("SELECT * FROM `popular` WHERE `user` = '".$u['id']."' LIMIT 1");
if(mysql_num_rows($req)==0){
}
}
$cusers_5 = mysql_result(mysql_query("SELECT COUNT(*) FROM `popular`"), 0);
if($cusers_5 > 0){
$result = mysql_query("SELECT * FROM `popular` ORDER BY `time` DESC LIMIT 0, 5");
echo '<table><tr align="center">';
while($user = mysql_fetch_assoc($result)){
echo '
<td>';
ava_k($user['user'],35);
echo '</td>';
}
echo '</tr></table>';
}else{
echo 'Сейчас никто не пиарится';
}
echo '</div>';
if($u['admin'] == 1 || $u['admin'] == 2 || $u['admin'] == 3 || $u['admin'] == 4 || $u['admin'] == 5){
echo '<a class="touch" href="/adminka.php">';
echo '<img src="ico/admin_men.gif" alt="!"/> Админка ('.$admin_jurnal.') '.$admin_jurnal_new.'';
echo '</a>';
}
echo '<a class="touch" href = "news.php?"><img src="ico/feed.png" alt="img"/> Новости '.$cnews.'</a>';
echo '<a class="touch" href = "chat.php"><img src="ico/chat.png" alt="img"/> Чат (<font color = "green">'.$cchat.'</font> чел.)</a>';
echo '<a class="touch" href = "forum.php"><img src="ico/forum.png" alt="img"/> Форум ('.$cforum.'/'.$cforum2.') '.$forum_new.' </a>';
echo '<a class="touch" href="lenta.php?"><img src="ico/lenta.png" alt="img"/> Лента '.$lenta_new.'</a>';
echo '<a class="touch" href = "gazeta.php?"><img src="ico/gazeta.png" alt="img"/> Газета '.$cjurnal.'</a>';
echo '<a class="touch" href = "microblog.php?act=all"><img src="ico/status.png" alt="img"/> Микроблоги ('.$cblog.') '.$blog_new.'</a>';
echo '<a class="touch" href="search.php"><img src="ico/heart.png" alt="img"/> Знакомства</a>';
echo '<a class="touch" href = "arbour.php"><img src="ico/guest.png" alt="img"/> Беседка ('.$carbour.'/<font color = "green">'.$carbour2.'</font> чел.)</a>';
echo '<a class="touch" href = "photos_top.php"><img src="ico/foto.png"> ТОП-Фото (<font color = "green">'.$cphotos_top.'</font>)</a>';
echo '<a class="touch" href = "duels.php"><img src="ico/duels.gif"> Фото-Дуэли (<font color = "green">'.$cduels.'</font>)</a>';
echo '<a class="touch" href = "garems.php"><img src="ico/garems.png" alt="img"> Гаремы (<font color = "green">'.$cgarem.'</font>)</a>';
echo '<a class="touch" href = "diary.php"><img src="ico/notes.png" alt="img"/> Дневники (<font color = "green">'.$cdiary.'</font>) '.$diary_new.'</a>';
echo '<a class="touch" href = "users.php"><img src="ico/10.gif" alt="img"> Пользователи (<font color = "#FF3399">'.$cusers_zh.'</font>/<font color = "#0099FF">'.$cusers_m.'</font>)</a>';
echo '<a class="touch" href = "administration.php"><img src="ico/admin_men.gif" alt="img"/> Администрация (<font color = "green">'.$admins.'</font>)</a>';
echo '<a class="touch" href = "search.php?act=go&online=1"><img src = "ico/online.png" alt="img"> Онлайн (<font color = "green">'.$cusers_online.'</font> чел.)</a>';
echo '</div>';
include 'tfoot.php';
?>