Вход Регистрация
Файл: region_clean/enter.php
Строк: 404
<?php
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################

require_once "start.php";
require_once 
"sid.php";

require_once 
"inc.php";
$link = connect_db();
list(
$row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once 
"version.php";

$us = $row['user'];
$sex = $row['sex'];
$level = $row['level'];

for (
$s = 13; $s <= 22; $s++) {
$room = "room" . $s;
$tmr = time() - 100;
$pr = mysql_query ("Select who,usid from $room WHERE id > '".$tmr."' and usid != '1' and usid != '2' and usid != '3' and usid != '4' and usid != '5' and usid != '6' and usid != '7' and usid != '8' and usid != '9' and usid != '11' group by usid order by id desc;");
$asnums = mysql_affected_rows();
$sizn[$s] = $asnums;
@
$kolp = $kolp + $asnums;
}

for (
$n = 0; $n <= 12; $n++) {
$room = "room" . $n;
$tm = time() - 100;
$r = mysql_query ("Select who from $room WHERE id > '".$tm."' and usid != '1' and usid != '2' and usid != '3' and usid != '4' and usid != '5' and usid != '6' and usid != '7' and usid != '8' and usid != '9' and usid != '11' group by who order by id desc;");
$asnum = mysql_affected_rows();
$siz[$n] = $asnum;
@
$kol = $kol + $asnum;
}

$pr_count = mysql_query("SELECT id,user FROM users WHERE onl> '".$tm ."' AND room='holl' group by user order by onl desc;");
$asnumspr = mysql_affected_rows();
@
$kolpr = $kolpr + $asnumspr;

$tm = time() - 100;
$r = mysql_query ("Select who from room23 WHERE id > '".$tm."' and usid != '1' and usid != '2' and usid != '3' and usid != '4' and usid != '5' and usid != '6' and usid != '7' and usid != '8' and usid != '9' and usid != '11' group by who order by id desc;");
$asnum3 = mysql_affected_rows();

@
$kols = $kol + $kolp + $kolpr + $asnum3;

$r = mysql_query ("select count(readd) as num from zapiski WHERE (idtowhom = '".$id."') and (readd = '0') and (ininc = '1');");
$a = mysql_fetch_array($r);
$inb = $a['num'];

$setting = mysql_query ("Select * from setting where klu4='1'");
$set = mysql_fetch_array ($setting);

ob_start();

header("Cache-Control: no-store, no-cache, must-revalidate");
if (
$ver == "wml") header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else if (
$ver == "xhtml") header("Content-Type:text/html; charset=UTF-8");
else 
header ("Content-type:text/vnd.wap.wml; charset=utf-8");

if ((
$ver == "wml") or ($ver == "xhtml")) {
if (
$ver == "wml") {
echo 
$xml;
echo 
$dtd;
echo 
'<wml>
      <card id="enter" title="Привет ' 
. $us . '">
      <p align="left">'
;
} else if (
$ver == "xhtml") {
echo 
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
<html xmlns="http://www.w3.org/1999/xhtml">
      <
head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
      <
script language="JavaScript" src="/snow.js" type="text/javascript"></script>
      <
title>Привет ".$us."</title>
      <
meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
      <
div align="left">";
}

echo 
$fsize1;

$us_ip = $row['user_ip'];
$us_soft = $row['user_soft'];
$visit = $row['visit'];
if ((
$row['user_soft'] !== $_SERVER['HTTP_USER_AGENT'] or $row['user_ip'] !== $_SERVER['REMOTE_ADDR'])) {
mysql_query ("
Update users set user_soft='".$_SERVER['HTTP_USER_AGENT']."', user_ip = '".$_SERVER['REMOTE_ADDR']."' WHERE id = '".$id."';");
if (
$row['safe'] == 1) {
echo '<b>Внимание:</b> Вход произведен с другого IP или Браузера. Данные сейчас обновлены! <br/>Последний вход был ' . 
$visit . ' с браузера: <b>' . htmlspecialchars($us_soft) . '</b> и IP: <b>' . $us_ip . '</b><br/>
      Твой браузер: <b>' . htmlspecialchars(
$_SERVER['HTTP_USER_AGENT']) . '</b><br/>
      Твой IP: <b>' . 
$_SERVER['REMOTE_ADDR'] . '</b><br/>';
}
}

echo '<div class = "
c4">';
require_once "
calendar.php";
echo '</div>';

$chas = date("H",time());
if (
$chas > 24) { $chas = round($chas - 24); }
if (
$chas < 0) { $chas = round($chas + 24); }
if (
$chas <= 4 or $chas >= 23) { echo '<center>Доброй ночи, <font color="red">' . $us . ' </font><img src="icon/love-all.gif"/></center>'; }
elseif (
$chas >= 5 and $chas <= 10) { echo '<center>Доброе утро, <font color="red">' . $us . ' </font><img src="icon/love-all.gif"/></center>'; }
elseif (
$chas >= 11 and $chas <= 17) { echo '<center>Добрый день, <font color="red">' . $us . ' </font><img src="icon/love-all.gif"/></center>'; }
elseif (
$chas >= 18 and $chas <= 22) { echo '<center>Добрый вечер, <font color="red">' . $us . ' </font><img src="icon/love-all.gif"/></center>'; }

if (
$row['level'] > 6) {
echo '<center><a href="
apanel.php?'.$ses.'&amp;ref='.$ref.'"><b>Админка</b></a></center><br/>';
}
elseif (
$row['level'] > 3) {
echo '<center><a href="
mpanel.php?'.$ses.'&amp;ref='.$ref.'"><b>Модерка</b></a></center><br/>';
}

$r = mysql_query ("select count(readd) as num from zapiski WHERE (idtowhom = '".$id."') and (readd = '0') and (ininc = '1');");
$a = mysql_fetch_array($r);
$inb = $a['num'];

if (
$inb != 0)
echo '<img src="
icon/new.gif" alt="NEW"/> Новых писем:<a href="inbox.php?'.$ses.'&amp;ref='.$ref.'"> (' . $inb . ')</a><br/><br/>';

echo '<div class="
d1">Информация:</div>
      <img src="
icon/kto.gif" alt="."/> <a href="who.php?'.$ses.'&amp;ref='.$ref.'">Онлайн:</a> (' . $kols . ')<br/>';
      
$idnews = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM news"));
if (
$idnews[0] > 0) $news = mysql_fetch_array(mysql_query("SELECT `date` FROM `news` WHERE `id`='$idnews[0]'"));
if (isset(
$news[0])) {
echo '<img src="
icon/novosti.gif" alt="."/> <a href="news.php?'.$ses.'&amp;ref='.$ref.'">Новости</a> <font color="#FF0000">(' . $news[0] . ')</font><br/>';
$last_news = mysql_fetch_assoc(mysql_query("SELECT `content` FROM `news` WHERE `id`='$idnews[0]' ORDER BY `date` LIMIT 1"));
if (
mb_strlen($last_news['content'],'UTF8') > 80) {
$last_news['content'] = mb_substr($last_news['content'], 0, 80, 'UTF8');
echo 
'<img src="icon/gazeta2.png" alt="."/> Посл. новость: '.$last_news['content'].'...<br/>';
} else {
echo 
'<img src="icon/gazeta2.png" alt="."/> Посл. новость: '.$last_news['content'].'<br/>';
}
}
echo 
'<div class="d1">Моё меню:</div>';

$file = file("loterea/setting.dat");
$dt = explode("|",$file[0]);
$timer = $dt[0];
if (
$timer == 1) { 
echo 
'<img src="icon/servisy.gif" alt="."/> <a href="loterea/index.php?'.$ses.'&amp;ref='.$ref.'">!ИДЁТ ЛОТЕРЕЯ!</a><br/>'; 
}
echo 
'<img src="icon/gost2.png" alt="."/> <a href="cabinet.php?'.$ses.'&amp;ref='.$ref.'">Личный кабинет</a><br/>
      <img src="icon/info.gif" alt="."/> <a href="cabinet.php?'
.$ses.'&amp;go=inform&amp;ref='.$ref.'">Жизнь сайта</a><br/>';

$q = mysql_query("SELECT `id`,`title` FROM `obiav` ORDER BY `id` DESC");
if (
mysql_num_rows($q) != 0)
{
echo 
"<div class='d3'>Объявления:</div><div class = 'd1'>";
while(
$arr = mysql_fetch_assoc($q)) {
$komu = mysql_fetch_array(mysql_query("SELECT `id`,`dlja` FROM `obiav` WHERE `id`='".intval($arr['id'])."'"));
if (
$komu['dlja'] == 0) {
echo 
'<a href="view_obiav.php?'.$ses.'&amp;ref='.$ref.'&amp;mid=' . $arr['id'] . '">' . $arr['title'] . '</a><br/>';
} elseif (
$komu['dlja'] == 1 and $row['level'] >= 5) {
echo 
'<a href="view_obiav.php?'.$ses.'&amp;ref='.$ref.'&amp;mid=' . $arr['id'] . '"><font color="#FF0000">' . $arr['title'] . '</font></a><br/>';
}
}
echo 
'</div><br/>';
} else { 
echo 
"<div class='d3'>Объявления:</div><div class = 'd1'>Объяв нету!</div><br/>";
}

if ((empty(
$row['city'])) or (empty($row['name'])) or (empty($row['infa']))) 
{
echo 
'<font color="#FF0000">Не заполнены анкетные данные!<br/> Рекомендуем заполнить<a href="anket.php?mod=profile&amp;'.$ses.'&amp;ref='.$ref.'"> <u>свою анкету</u></a> прямо сейчас!</font><br/>';
}

echo 
'<img src="icon/poisk.gif" alt="."/> <a href="searcht.php?'.$ses.'&amp;ref='.$ref.'">Поиск жителей</a><br/>';

$ct = mysql_query("SELECT count(`id`) FROM `forum` WHERE `type`='t';");
$count_tem = mysql_fetch_row($ct);
$ctt = $count_tem[0];
$cp = mysql_query("SELECT count(`id`) FROM `forum` WHERE `type`='m';");
$count_post = mysql_fetch_row($cp);
$cpp = $count_post[0];

$gost = mysql_result(mysql_query("SELECT count(`id`) FROM `books`"), 0);

$otkl = mysql_fetch_array(mysql_query("SELECT * FROM `setting`"));

if (
$otkl['forum'] == 0) {
echo 
'<img src="icon/lib.png" alt="."/> <a href="forum/index.php?'.$ses.'&amp;ref='.$ref.'">Форум</a> <font color="#0000FF">(' . $ctt . '/' . $cpp . ')</font><br/>';
} else {
echo 
'<img src="icon/lib.png" alt="."/> Форум отключен<br/>';
}
if (
$otkl['chat'] == 0) {
echo 
'<img src="icon/chat.gif" alt="."/> <a href="rooms.php?'.$ses.'&amp;ref='.$ref.'">Чат</a> <font color="#0000FF">(' . $kol . ')</font> чел.<br/>';
} else {
echo 
'<img src="icon/chat.gif" alt="."/> Чат отключен<br/>';
}
if (
$otkl['guest'] == 0) {
echo 
'<img src="icon/pishut.gif" alt="."/> <a href="guest.php?'.$ses.'&amp;ref='.$ref.'">Гостевая</a> <font color="#0000FF">(' . $gost . ')</font><br/>';
} else {
echo 
'<img src="icon/pishut.gif" alt="."/> Гостевая отключена<br/>';
}

$blog = mysql_num_rows(mysql_query ("SELECT `id` FROM `blog`"));
echo 
'<img src="icon/p2.png" alt="."/> <a href="blog.php?'.$ses.'&amp;ref='.$ref.'">Дневники</a> <font color="#0000FF">(' . $blog . ')</font><br/>';

$bibl_r = mysql_num_rows(mysql_query ("SELECT `id` FROM `infaraz`"));
$bibl_s = mysql_num_rows(mysql_query ("SELECT `id` FROM `infamgs`"));
echo 
'<img src="icon/blogs.gif" alt="."/> <a href="bibla.php?'.$ses.'&amp;ref='.$ref.'">Библиотека</a> <font color="#0000FF">('.$bibl_r.'/'.$bibl_s.')</font><br/>';

$cmc = mysql_num_rows(mysql_query("SELECT `id` FROM `stixi` WHERE 1"));
echo 
'<img src="icon/gost.png" alt="."/> <a href="stixi.php?'.$ses.'&amp;ref='.$ref.'">Творчество</a> <font color="#0000FF">(' . $cmc . ')</font><br/>';

$golos = mysql_num_rows(mysql_query ("SELECT `id` FROM `votes`"));
echo 
'<img src="icon/opros.png" alt="."/> <a href="votes.php?'.$ses.'&amp;ref='.$ref.'">Голосования</a> <font color="#0000FF">(' . $golos . ')</font><br/>';

$kol_cl = mysql_num_rows(mysql_query("SELECT `id` FROM `clans`;"));
echo 
'<img src="icon/group.png" alt="."/> <a href="coo.php?'.$ses.'&amp;ref='.$ref.'">Сообщества</a> <font color="#0000FF">(' . $kol_cl . ')</font><br/>';

$usersm = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where sex='М'"));
$usersj = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where sex='Ж'"));

echo 
'<img src="icon/znakomstva.gif" alt="."/> <a href="znak/index.php?'.$ses.'&amp;ref='.$ref.'">Знакомства</a> 
      <font color="#0000FF">('
.$usersm[0].'/'.$usersj[0].')</font><br/>';

$result = mysql_query("SELECT count(`id`) FROM `album` WHERE `type`='r';");
$cntData = mysql_fetch_row($result);
$count_users = $cntData[0];

$dates = date("d.m.y");
$resultx = mysql_query("SELECT count(`id`) FROM `album` WHERE `new_date`='".$dates."' AND `type`='r';");
$cntDatax = mysql_fetch_row($resultx);
$count_usersx = $cntDatax[0];

if (
$count_usersx == 0) 
{
echo 
'<img src="icon/foto.gif" alt="."/> <a href="album/index.php?'.$ses.'&amp;ref='.$ref.'">Фотоальбомы</a> <font color="#0000FF">(' . $count_users . ')</font><br/>';
}
if (
$count_usersx != 0) {
echo 
'<img src="icon/foto.gif" alt="."/> <a href="album/index.php?'.$ses.'&amp;ref='.$ref.'">Фотоальбомы</a>
      <font color="#0000FF">(' 
. $count_users . ')</font><font color="#FF0000">+' . $count_usersx . '</font><br/>';
}

echo 
'<img src="icon/smileperson.png" alt="."/> <a href="games.php?'.$ses.'&amp;ref='.$ref.'">Развлечения</a> <font color="#0000FF">(10)</font><br/>';

$sql = mysql_query ("SELECT count(`id`) as num FROM `fo_files`");
$sql2 = mysql_fetch_array($sql);
$num5 = $sql2["num"];

$itimedf = time();
$gor_o = $itimedf - 100;
$noc = mysql_query("SELECT count(`id`) FROM `users` WHERE `lastdateg`>='" . intval($gor_o) . "';");
$cit = mysql_fetch_row($noc);
$count_g = $cit[0];

$colsport = mysql_query("SELECT count(`id`) as num FROM `sport_mach`");
$colsp = mysql_fetch_array($colsport);
$colnum = $colsp["num"];

$stol = mysql_result(mysql_query("SELECT COUNT(*) FROM `stol_zakaz`"), 0);
$new_fail = mysql_result(mysql_query("SELECT COUNT(*) FROM `fo_files` WHERE `time` > '".(time() - 86400)."';"), 0);

echo 
'<img src="icon/obmen.gif" alt="."/> <a href="fo/index.php?'.$ses.'&amp;ref='.$ref.'">Файлообменник</a> <font color="#0000FF">(' . $num5 . ')</font>';
if (
$new_fail > 0) echo '<font color="#FF0000">+'.$new_fail.'</font>';
echo 
'<br/>';
echo 
'<img src="icon/games.gif" alt="."/> <a href="city/index.php?'.$ses.'&amp;ref='.$ref.'">Онлайн-сити</a> <font color="#0000FF">(' . $count_g . ')</font><br/>
      <img src="icon/stol.gif" alt="."/> <a href="stol/index.php?'
.$ses.'&amp;ref='.$ref.'">Стол заказов</a> <font color="#0000FF">(' . $stol . ')</font><br/>
      <img src="icon/muzmo.gif" alt="."/> <a href="sport.php?'
.$ses.'&amp;ref='.$ref.'">Тотализатор</a> <font color="#0000FF">(' . $colnum . ')</font><br/>';

$roommaf = mysql_fetch_array(mysql_query ("Select name from rooms where rm='23' LIMIT 1;"));
if (
$otkl['chat'] == 0) {
echo 
'<img src="icon/maf.gif" alt="."/> <a href="chat.php?'.$ses.'&amp;rm=23&amp;ref='.$ref.'">'.$roommaf[0].'</a> <font color="#0000FF">('.$asnum3.')</font><br/>';
}

$curdate = date("d-m-Y");
$newtoday = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `date`='".$curdate."'"));

$num = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) AS NUM FROM `users`"));
if (
$newtoday[0] == 0) {
echo 
'<img src="icon/soo.gif" alt="."/> <a href="statistik.php?'.$ses.'&amp;mod=alluser&amp;ref='.$ref.'">Жителей:</a> <font color="#0000FF">('.$num[0].')</font><br/>';
} elseif (
$newtoday[0] > 0) {
echo 
'<img src="icon/soo.gif" alt="."/> <a href="statistik.php?'.$ses.'&amp;mod=newtoday&amp;ref='.$ref.'">Жителей:</a> 
      <font color="#0000FF">('
.$num[0].')</font><font color="#FF0000">+'.$newtoday[0].'</font><br/>';
}

echo 
'<br/>';

$time = getmicrotime();
$tm = time() - 100;
mysql_query ("Update users set  onl='".$time."', room='holl' where id ='$id'");
$f = fopen("log/kol.dat", "a+");
flock($f,LOCK_EX);
ftruncate($f,0);
fwrite($f, $kols);
fflush($f);
flock($f,LOCK_UN);
fclose($f);

$tm = time() - 100;
$pr_count = mysql_query("SELECT id,user,inv,level FROM `users` WHERE onl> '".$tm ."' AND room='holl' group by user order by onl desc;");
$kolpr = mysql_affected_rows();
if (
$ver == "xhtml") echo '<div class="d1">';
echo 
'<small>Здесь:('.$kolpr.')</small> ';
for (
$k = 0; $k < $kolpr; $k++)
{
$pdc = mysql_fetch_array($pr_count);
$user = $pdc['user'];
$inv = $pdc['inv'];
$nk = $pdc['id'];
$usid = $pdc['id'];

if (
$inv != 1) echo '<small><a href="info.php?'.$ses.'&amp;nk='.$usid.'&amp;ref='.$ref.'">' . col_n($user) . '</a></small>';
else if (
$row['level'] > 6 ) echo '<small><a href="info.php?'.$ses.'&amp;nk='.$usid.'&amp;ref='.$ref.'">' . col_n($user) . '(i)</a></small>';
if ((
$k + 1) != $kolpr) echo ',';
}
if (
$kolpr > 0);
unset(
$pdc);
if (
$ver == "xhtml") echo '</div>';

if (
$ver == "wml") {
if (
$set["link1"] != "") echo "<small><a href="http://".$set["link1"]."?ver=".$ver."">".$set["link1_name"]."</a></small><br/>n";
if ($set["link2"] != "") echo "<small><a href="http://".$set["link2"]."?ver=".$ver."">".$set["link2_name"]."</a></small><br/>n";
if ($set["link3"] != "") echo "<small><a href="http://".$set["link3"]."?ver=".$ver."">".$set["link3_name"]."</a></small><br/>n";
}
else if (
$ver == "xhtml") {
if (
$set["link1"] != "") { echo "<div class='d3'><a href="http://".$set["link1"]."?ver=".$ver."">".$set["link1_name"]."</a></div>n"; }
if ($set["link2"] != "") { echo "<div class='d3'><a href="http://".$set["link2"]."?ver=".$ver."">".$set["link2_name"]."</a></div>n"; }
if ($set["link3"] != "") { echo "<div class='d3'><a href="http://".$set["link3"]."?ver=".$ver."">".$set["link3_name"]."</a></div>n"; }
}

echo 
'<center><a href="./exit.php?'.$ses.'">[Выход]</a></center>';

echo 
$fsize2;

$alltraf = $row["alltraf"];
$pagesize = round((ob_get_length())/1024,1);
$alltraf = $alltraf + $pagesize;
mysql_query ("Update users set alltraf='".$alltraf."', lasttraf='".$pagesize."' where id='".$id."'");

if (
$ver == "wml") echo '<br/>';
echo 
'<div class = "d1"><small>&#169; ' . $url . '</small></div>';
if (
$ver == "xhtml") { echo '<div class = "d2"><a href = "enter.php?'.$ses.'&amp;ver=wml&amp;ref='.$ref.'">[WML</a>|xHTML]</div>';
} elseif (
$ver == "wml") { echo '[WML|<a href = "enter.php?'.$ses.'&amp;ver=xhtml&amp;ref='.$ref.'">XHTML</a>]<br/>'; }
if (
$ver == "wml") echo "</p></card></wml>";
else echo 
"</div></body></html>";
ob_end_flush();
}
?>
Онлайн: 3
Реклама