Файл: system/index.php
Строк: 143
<?
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);
echo '<div class="zona"><img src = "ico/popular.png"> Наши звезды </br>';
if($u['id']){
$req = mysql_query("SELECT * FROM `popular` WHERE `user` = '".$u['id']."' LIMIT 1");
if(mysql_num_rows($req)==0){
echo '<a href = "popular.php">попасть сюда</a>';
}
}
$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 '<br> Пользователей не найдено!';
}
echo '</div>';
if($u['admin'] == 1 || $u['admin'] == 2 || $u['admin'] == 3 || $u['admin'] == 4 || $u['admin'] == 5){
echo '<div class="cred">';
echo '<img src="ico/admin_men.gif" alt="!"/> <a href="/adminka.php">Админка</a> ('.$admin_jurnal.') '.$admin_jurnal_new.'';
echo '</div>';
}
echo '<div class="div">';
echo '<img src="ico/feed.png" alt="lovs!"/> <a href = "news.php?"> Новости</a> <font color = "#777777">'.$cnews.'</font><br/>';
echo '<img src="ico/chat.png" alt="lovs"/> <a href = "chat.php"> Чат</a> (<font color = "green">'.$cchat.'</font> чел.)<br/>';
echo '<img src="ico/forum.png" alt="lovs"/> <a href = "forum.php"> Форум</a> <font color = "#777777">('.$cforum.' | '.$cforum2.')</font> '.$forum_new.' <br/>';
echo '<img src="ico/lenta.png" alt="lovs"/> <a href = "lenta.php?"> Лента Новостей</a> <font color = "#777777">('.$lenta.') '.$lenta_new.'</font><br/>';
echo '<img src="ico/gazeta.png" alt="lovs"/> <a href = "gazeta.php?"> Журнал lovs-city</a> <font color = "#777777">'.$cjurnal.'</font><br/>';
echo '<img src="ico/status.png" alt="lovs"/> <a href = "microblog.php?act=all"> Люди пишут</a> <font color = "#777777">('.$cblog.')</font> '.$blog_new.'<br/>';
echo '</div><div class="cred"><img src="ico/heart.png" alt="lovs"/> <a href = "search.php"> Знакомства</a> | <a href = "search.php?search=1">Поиск</a><br/>';
echo '</div><div class="div">';
echo '<img src="ico/download.png" alt="!"/> Зона Обмена <br/><small>В разработке</small>';
echo '</div><div class="div">';
echo '<img src="ico/guest.png" alt="lovs"/> <a href = "arbour.php"> Беседка</a> <font color = "#777777">('.$carbour.'</font> | <font color = "green">'.$carbour2.'</font> чел.)<br/>';
echo '<img src="ico/foto.png"> <a href = "photos_top.php"> ТОП-Фото</a> <font color = "#777777">('.$cphotos_top.')</font><br/>';
echo '<img src="ico/duels.gif"> <a href = "duels.php"> Фото-Дуэли</a> <font color = "#777777">('.$cduels.')</font><br/>';
echo '<img src="ico/garems.png"> <a href = "garems.php"> Гаремы</a> <font color = "#777777">('.$cgarem.')</font><br/>';
echo '<img src="ico/notes.png" alt="lovs"/> <a href = "diary.php"> Дневники</a> <font color = "#777777">('.$cdiary.')</font> '.$diary_new.'<br/>';
echo '<img src="ico/users.png"> <a href = "users.php"> Пользователи</a> (<font color = "#FF3399">'.$cusers_zh.'</font> | <font color = "#0099FF">'.$cusers_m.'</font>)<br/>';
echo '<img src="ico/admin_men.gif" alt="lovs"/> <a href = "administration.php"> Администрация</a> ('.$admins.')<br/>';
echo '<img src = "ico/10.gif"> <a href = "search.php?act=go&online=1"> Онлайн</a> ('.$cusers_online.')</br>';
echo '</div>';
include 'tfoot.php';
?>