Файл: Dvig/index.php
Строк: 128
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru ##
####################
# Стартуем ядро
define( 'xcms_pro', 1 ) ;
include_once ( 'core/core.php' ) ;
$home = 1 ;
$title = 'Главная';
include_once ( 'core/head.php' ) ;
# Бонус
switch($act){
case 'panel':
if($users){
if($users['panel'] == '1'){$panel='0';}else{$panel='1';}
mysql_query("UPDATE `users` SET `panel`='$panel' WHERE `id`='$users[id]'");
header('location: index.php');}
break;
case 'pod':
if($users){
if($users['pokaz_pod'] == '1'){$pokaz_pod='0';}else{$pokaz_pod='1';}
mysql_query("UPDATE `users` SET `pokaz_pod`='$pokaz_pod' WHERE `id`='$users[id]'");
header("location: ".$_SERVER["HTTP_REFERER"]);}
break;
case 'photo':
if($users){
if($users['pokaz_pho'] == '1'){$pokaz_pho='0';}else{$pokaz_pho='1';}
mysql_query("UPDATE `users` SET `pokaz_pho`='$pokaz_pho' WHERE `id`='$users[id]'");
header("location: ".$_SERVER["HTTP_REFERER"]);}
break;
case 'wall':
if($users){
if($users['pokaz_wal'] == '1'){$pokaz_wal='0';}else{$pokaz_wal='1';}
mysql_query("UPDATE `users` SET `pokaz_wal`='$pokaz_wal' WHERE `id`='$users[id]'");
header("location: ".$_SERVER["HTTP_REFERER"]);}
break;
case 'deist':
if($users){
if($users['pokaz_dei'] == '1'){$pokaz_dei='0';}else{$pokaz_dei='1';}
mysql_query("UPDATE `users` SET `pokaz_dei`='$pokaz_dei' WHERE `id`='$users[id]'");
header("location: ".$_SERVER["HTTP_REFERER"]);}
break;
default:
if($users){
$bonus = mt_rand(1,50);
$razmer = mt_rand(1,150);
if($bonus == '7'){echo'<div id="ok">Вам попался бонус '.$razmer.' баллов</div>';
mysql_query("update `users` set `balans`=balans+$razmer where `id`='".$users['id']."'");}}
if($users){include 'bro.php';
$time = time();
if($users['city'] !== $city){
$komu = $users['id'];
$ktoo = '2';
$deistvie = 'Вы зашли с другого устройства';
$time = time();
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$komu',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'"); }
mysql_query( "UPDATE `users` SET `city` = '$city' WHERE `id`='$users[id]' " ) ;}
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `news`"), 0); //Подсчет общего числа записей
if ($total){
$res = mysql_fetch_array(mysql_query("SELECT * FROM `news` order by `id` desc limit 1"));
echo '<div id="content"><div id="battle"><table id="bitva">
<tr><td><b>[' . $res ['name'].' / ' . clock( $res ['time']).']</b><br>'. bb(smiles($res ['text'])).'<br></td>
</tr></table></div></div>';}
######
######
if($users){
echo '<div id="razd">'.$_SERVER['HTTP_HOST'].'</div>
<a id="nav" href="/chat">Чат ('.mysql_num_rows( mysql_query( "SELECT id FROM `chat_room`" ) ).'/'.mysql_num_rows( mysql_query( "SELECT id FROM `chat_posts`" ) ).')</a>
<a id="nav" href="/forum">Форум ('.mysql_num_rows( mysql_query( "SELECT id FROM `forum_themes`" ) ).'/'.mysql_num_rows( mysql_query( "SELECT id FROM `forum_posts`" ) ).')</a>
<a id="nav" href="/news">Новости ('.mysql_num_rows( mysql_query( "SELECT id FROM `news`" ) ).')</a>
<a id="nav" href="/fo">Зона обмена ('.mysql_num_rows(mysql_query("SELECT id from `obmen_cat`")).'/'.mysql_num_rows(mysql_query("SELECT id from `obmen_files")).')</a>
<a id="nav" href="/dnevnik.php?act=all">Дневники ('.mysql_num_rows(mysql_query("SELECT * from `dnevnik_users`")).')</a>' ;
######
######
if($users['panel']=='0'){$panes='Развернуть';}else{$panes='Свернуть';}
echo'<div id="razd">Профиль <b>[<a href="?act=panel">'.$panes.'</a>]</b></div>';
if($users['panel']=='1'){
echo'<a id="nav" href="/mail">Личные сообщения';
$messages = mysql_query("SELECT * FROM `mail` WHERE `komu`='$users[id]' and `status`='1'");
if(mysql_num_rows($messages)!=0){
echo ' (+'.(mysql_num_rows($messages)).')';}
echo'</a>
<a id="nav" href="/friend.php">Мои друзья';
$friends = mysql_query("SELECT * FROM `friend` WHERE `kogo`='$users[id]' and `status`='0'");
if(mysql_num_rows($friends)!=0){
echo ' (+'.(mysql_num_rows($friends)).')';}
echo'</a>
<a id="nav" href="/notice">Мои оповещения';
$friends = mysql_query("SELECT * FROM `core_deistvie` WHERE `komu`='$users[id]' and `status`='1'");
if(mysql_num_rows($friends)!=0){
echo ' (+'.(mysql_num_rows($friends)).')';}
echo'</a>
<a id="nav" href="/'.$users['id'].'">Мой профиль</a>
<a id="nav" href="/dnevnik.php">Мой дневник</a>
<a id="nav" href="/gorod">Онлайн город</a>
<a id="nav" href="/search">Поиск</a>
<a id="nav" href="/game">Игры на баллы</a>
<a id="nav" href="/info">Информация</a>';}
echo'<div id="razd">Зона обмена</div>';
$query = mysql_query("select * from `obmen_cat` ORDER BY `id`");
$total = mysql_result(mysql_query("select count(*) from `obmen_cat`"),0);
if($total == 0)
{
echo '<div id="body">Категорий еще нет.</div>';
}
else
{
while ($row = mysql_fetch_assoc($query))
{
echo'<a id="nav" href="/fo/cat.php?id='.$row['id'].'">'.$row['name'].'
('.mysql_num_rows(mysql_query("SELECT id FROM `obmen_files` WHERE `cat_obmen`='$row[id]'")).')</a>';
}
}
}else{echo'<div id="razd"><center><a href="enter/">Войдите</a>, чтобы использовать все возможности сайта, или пройдите <a href="signup/">регистрацию</a></center></div>';
$kolse = mysql_num_rows(mysql_query("SELECT * from `users`"));
$rand1 = rand(1,$kolse);
$rand2 = rand(1,$kolse);
$g1 = mysql_fetch_assoc(mysql_query( "SELECT * FROM `users` where `id`='$rand1' " ) ) ;
$g2 = mysql_fetch_assoc(mysql_query( "SELECT * FROM `users` where `id`='$rand2' " ) ) ;
if($kolse != '0'){
echo '<div id="razd"><center><b>Случайные пользователи</b></center></div>
<div id="content">
<div id="battle">
<table id="bitva">
<tr>' ;
echo '<td>';
if($g1['id']){echo'<a href="/'.$g1['id'].'""><b>'.$g1['login'].'</b></a><br/>';}
if($g1['avatar']=='1'){echo'<img id="img" src="'.$host.'/avatar/'.$g1['id'].'.jpg" width="200" height="200"/></a><br />';}
else{echo'<img id="img" src="'.$host.'/img/default.png" width="200" height="200"/></a><br />';}
if($g1['id']){echo'<form action="/'.$g1['id'].'" method="post">
<input type="submit" name="add" value="Страница '.$g1['login'].'"/></form>';
}
echo'</td>' ;
echo '<td>';
if($g2['id']){echo'<a href="/'.$g2['id'].'""><b>'.$g2['login'].'</b></a><br/>';}
if($g2['avatar']=='1'){echo'<img id="img" src="'.$host.'/avatar/'.$g2['id'].'.jpg" width="200" height="200"/></a><br />';}
else{echo'<img id="img" src="'.$host.'/img/default.png" width="200" height="200"/></a><br />';}
if($g2['id']){echo'<form action="/'.$g2['id'].'" method="post">
<input type="submit" name="add" value="Страница '.$g2['login'].'"/></form>';
}
echo'</td>' ;
echo '</tr></table></div></div>' ;
}else{echo'<div id="razd">Пользователей еще нет</div>';}
}
######
######
echo'<div id="razd"><a href="http://top.bodr.net/?cid=175133"><img src="http://top.bodr.net/c.php?id=175133" alt="bodr_top"/></a><br/>
<a href="http://mk-top.ru/in/104.php"><img src="http://mk-top.ru/count/big/104.gif" alt="mk-top.ru"/></a></div>';}
include_once ( 'core/foot.php' ) ;
?>