Файл: vkollektive2014/index.php
Строк: 264
<?
require ('connect.php');
if(!$u['id']){header ("Location: users_hi.php");}
$location = '(На главной)';
$title = $title.' | Твой дом!';
$cusers_online = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."'"), 0);
$col_g = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > '" . (time() - 100) . "' AND `pereh` > '0'"), 0);
require('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;
# дневники
$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);
$cusers2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `anketa_datareg` > '" . (time() - 60*60*24) . "'"), 0); if ($cusers2 > 0) $cusers_new = '<font color = "red">+' . $cusers2 . '</font>';
# администрация
$admins = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `admin`"), 0);
echo '<div class="zona"><img src = "ico/top2.gif"><font color="black"> <b>VIP пользователи:</b></font></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"><img src="ico/J.gif"><font color="red"><b> Попасть сюда?</b></font></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>VIP Пользователей не найдено!';
}
echo '</div>';
require('style/praz.php');
require('core/bb_code.php');
echo ' <a href = "about.php"><div class="div"><img src="ico/infor.png" alt=""/> Первый раз на vKollektive.net?</div></a>';
echo ' <a href = "news.php?"><div class="div"><img src="ico/feed.png" alt=""/> Новости <font color = "#777777">'.$cnews.'</font></div></a> </font>';
/*
if (@$u['id'] != $user['id']) {
echo"<small>";
require('user/news.php');
echo"</small>";
}
*/
$currD = date("d", time());
$currm = date("m", time());
$k_birthday=mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `anketa_bday` = '$currD' and `anketa_bmonth` = '$currm'"), 0);
echo '</div><a href="/list_bday.php"><div class="div"><img src="/style/icons/14.png"/> Именинники </a>['.$k_birthday.']</div>';
echo ' <a href = "lenta.php?"><div class="div"><img src="ico/lenta.png" alt=""/> События <font color = "#777777">['.$lenta.'] '.@$lenta_new.'</font></div></a> ';
echo ' <a href = "gazeta.php?"><div class="div"><img src="ico/gazeta.png" alt=""/> Газета<font color = "#777777">'.$cjurnal.'</font></div></a> ';
echo ' <a href = "/user/down.php"><div class="div"><img src="ico/obmennn.png" alt=""/> Загрузки <font color = "#777777">[<font color = "green">120 млн</font>]</font></div></a>';
$down = mysql_result(mysql_query("SELECT COUNT(*) FROM `down`"), 0); echo '<a href = "user/shared_zona/"> <font color="#777777"><div class="div"><img src="ico/obmennn.png" alt=""/> Зона обмена ['.$down.']</font> </a><br/>';
echo"Mузыка, видео ,картинки, игры...</div>";
echo ' <a href = "chat.php"><div class="div"><img src="ico/chat.png" alt=""/> Чат <font color = "#777777">[<font color = "green">'.$cchat.' </font> чел.]</font></div></a>';
echo ' <a href = "forum.php"><div class="div"><img src="ico/forum.png" alt=""/> Форум <font color = "#777777">['.$cforum.' | '.$cforum2.'] '.@$forum_new.' </font> </div></a>';
if ($u['forum_vkl'] == 0) {
echo' <div class="div"> '; $result = mysql_query("SELECT * FROM `forum_themes` ORDER BY `time` DESC LIMIT 3"); while ($theme = mysql_fetch_assoc($result)) { echo $i % 2 ? '<div id="in11">' : '<div id="in11">'; $count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_messages` WHERE `theme` = '".$theme['id']."'"), 0); $name = checkout($theme['name']); $end = mysql_query("SELECT `user`,`time` FROM `forum_themes` WHERE `id` = '".$theme['id']."' ORDER BY `time` DESC"); $end_msg = mysql_fetch_array($end); if($theme['fix'] == 1) { echo '<img src="ico/stick.gif" alt=""/> ';}else{ echo '<img src="ico/tik.png" alt="image" /> ';} echo '<a href = "forum.php?act=theme&id='.$theme['id'].'&cat=1"><font color="#777777">'.$name.' ('.$count.')</font> <small><font color="green">'.vremya($end_msg['time']).'</font></small> </a>'; if($theme['18'] == 1) { echo '/ <font color="red">18+</font>'; } if($theme['close'] == 1) {echo '<img src="ico/lock.gif" alt="image" />'; } echo '</div>';} echo '</div></div>';
}
###
echo '<a href = "search.php"><div class="div"><img src="ico/heart.png" alt="lovs"/> Знакомства</a> <font color = "#777777">[<font color = "#FF3399">Ж:'.$cusers_zh.'</font> | <font color = "#0099FF">М:'.$cusers_m.'</font>]</font></div>';
echo ' <a href = "arbour.php"><div class="div"><img src="ico/guet.png" alt=""/> Беседка <font color = "#777777">['.$carbour.' | </font><font color = "green">'.@$carbour2.' чел.]</font></div></a> ';
$soo = mysql_result(mysql_query("SELECT COUNT(*) FROM `soo`"), 0);
echo ' <a href = "/soo/"><div class="div"><img src="ico/comm.png" alt=""/> Сообщества <font color = "#777777">['.$soo.']</font></div></a> ';
echo ' <a href = "/user/braks/"> <div class="div"><img src="ico/heart.png"> Бракосочетание </a> ';
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `braks`"),0);
echo "<font color='#777777'> [$count]</font>";
echo"</div>";
echo ' <a href = "diary.php"><div class="div"><img src="ico/blog.png" alt=""/> Дневники <font color = "#777777">['.$cdiary.'] '.@$diary_new.'</font></div></a> ';
if ($u['dnev_vkl'] == 0) {
echo'<div class="div"> '; $result = mysql_query("SELECT * FROM `diary_messages` ORDER BY `time` DESC LIMIT 3"); while ($message = mysql_fetch_assoc($result)) { echo $i % 2 ? '<div id="in11">' : '<div id="in11">'; $count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `diary_messages` WHERE `message` = '".$message['id']."'"), 0); $name = checkout($message['name']); $end = mysql_query("SELECT `user`,`time` FROM `diary_messages` WHERE `id` = '".$message['id']."' ORDER BY `time` DESC"); $end_msg = mysql_fetch_array($end); if($theme['fix'] == 1) { echo '<img src="ico/view,gif" alt=""/> ';}else{ echo '<img src="ico/view.png" alt="image" /> ';} echo '<a href = "diary.php?act=message&id='.$message['id'].'"><font color="#777777">'.$name.' |</font> <small><font color="green">'.vremya($message['time']).'</font></small> </a>'; if($message['18'] == 1) { echo ' <font color="red">18+</font>'; } echo '</div>'; } echo '</div></div>';
}
#echo ' <a href = "/play/libary/"><div class="div"><img src="ico/icons/game.png" alt=""/> Библиотека <font color = "#777777">[319|<font color = "red">+319</font>] </font> <font color = "red">NEW</font></div></a>';
echo ' <a href = "/play/"><div class="div"><img src="ico/games.png" alt=""/> Развлечения <font color = "#777777">[3] </font> </div></a>';
echo ' <a href = "/play_gamescool/"><div class="div"><img src="/play_gamescool/image_game/img.gif" alt=""/> Онлайн игры <font color = "#777777">[13]</font> </div></a>';
echo ' <a href = "/play/top_users.php"> <div class="div"><img src="ico/stat.png"> Топ рейтинги <font color = "#777777">[6|<font color="red"> +1</font>]</font> </div></div></a>';
echo ' <a href = "/play/service/"> <div class="div"><img src="ico/favorites.png"> Сервисы <font color = "#777777">[5]</font></font> </div></div></a>';
$users = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0); echo ' <a href = "users.php"><div class="div"><img src="ico/usersss.png"> Пользователи <font color = "#777777">[<font color = "#FF3399">'.$users.'</font>] </font></font> ' . $cusers_new . '</div></a> ';
echo ' <a href = "/about/"> <div class="div"><img src="ico/infor.png"> Информация <font color = "#777777">[15] </font></div></a></a>';
echo"</a>";
echo '<a href = "users.php?act=go&online=1"><div class="div"><img src="/ico/on.png"> <font color="#777777"> Онлайн:</font><span class="count">[ '.$cusers_online.' чел.]</span></a> ';
#[+'.$col_g.' гостей]
echo "</div>";
echo "</div>";
include_once H.'/search/index_web.php';
##########ADMIN PANEL SITE
if($u['admin'] == 1 || $u['admin'] == 2){
echo ' <a href="/adminka.php"><div class="div"><img src="ico/admin_men.gif" alt="!"/>Админка</a> ['.$admin_jurnal.'] '.$admin_jurnal_new.'';
echo '</div>';
}
#########
require ('tfoot.php');
?>