Файл: NskriptS.zip/menu.php
Строк: 409
<?php
error_reporting(0);
include("config.php");
include("./includes/constants/menu");
include("./includes/".$ver."/banned");
$old_msgs = 6; //HOURS
$fd = fopen("clear.dat", "r");
$clear_time = intval(fgets($fd));
fclose($fd);
if($clear_time < time())
{
$sql = mysql_query("SELECT `id` FROM `chat_rooms`;");
while($room = mysql_fetch_array($sql))
{
mysql_query("DELETE FROM `chat".$room['id']."` WHERE `seconds` < ".(time() - (3600 * $old_msgs)).";");
mysql_query("DELETE FROM `chat_intim` WHERE `seconds` < ".(time() - (3600 * $old_msgs)).";");
}
$fd = fopen("clear.dat", "w");
flock($fd, LOCK_EX);
$puts = fputs($fd, (time() + 3600 * $old_msgs));
flock($fd, LOCK_UN);
fclose($fd);
}
list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;
$ref = rand(10000, 99999);
switch($ver)
{
////////////////////////////////////////////////////////
//WML VERSION
////////////////////////////////////////////////////////
case 'wml':
header("Content-type: text/vnd.wap.wml; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
//AUTH
if(isset($_POST['action']))
{
if($_POST['translit'] == "yes")
{
$lat = array("''", "'", """", """, "CH", "ch", "SC", "sc", "YE", "ye", "YU", "yu", "YA", "ya", "YO", "yo", "A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "H", "h", "Z", "z", "W", "w", "X", "x", "Y", "y");
$rus = array("Ь", "ь", "Ъ", "ъ", "Ч", "ч", "Щ", "щ", "Э", "э", "Ю", "ю", "Я", "я", "Ё", "ё", "А", "а", "Б", "б", "Ц", "ц", "Д", "д", "Е", "е", "Ф", "ф", "Г", "г", "Х", "х", "И", "и", "Ж", "ж", "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "В", "в", "Х", "х", "З", "з", "Ш", "ш", "Ы", "ы", "Й", "й");
$_POST['nickname'] = str_replace($lat, $rus, $_POST['nickname']);
}
$nickname = mysql_escape_string($_POST['nickname']);
$password = mysql_escape_string($_POST['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `nickname` = '".$nickname."' AND `password` = '".$password."' LIMIT 1;");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"><wml>n";
echo "<card title="ERROR" ontimer="index.php?ver=wml"><timer value="15"/><p align="left">n";
echo "<small>Ошибка авторизации!<br/>n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec<br/>n";
echo "</small></p></card></wml>";
exit();
}
}
else
{
$id = intval($_GET['id']);
$password = mysql_escape_string($_GET['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".$password."';");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"><wml>n";
echo "<card title="ERROR" ontimer="index.php?ver=wml"><timer value="15"/><p align="left">n";
echo "<small>Ошибка авторизации!<br/>n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec<br/>n";
echo "</small></p></card></wml>";
exit();
}
}
//END AUTH
//USER DATA
$user = mysql_fetch_array($q);
$id = $user['id'];
$nickname = $user['nickname'];
$level = $user['level'];
$status = $user['status'];
$posts = $user['posts'];
$time = $user['time'];
$ip = $user['ip'];
$ua = $user['ua'];
$security = $user['security'];
$fsize = $user['fsize'];
//END USER DATA
//STATUS UPDATE
if($status == STATUS_NOVICE && $posts > 500 && $posts < 1000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_USER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_USER && $posts > 1000 && $posts < 3000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_ADVANCED."' WHERE `id` = '".$id."';");
}
if($status == STATUS_ADVANCED && $posts > 3000 && $posts < 5000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_CHATTER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_CHATTER && $posts > 5000 && $posts < 7000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_SUPER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_SUPER && $posts > 7000 && $posts < 10000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_MEGA."' WHERE `id` = '".$id."';");
}
//END STATUS UPDATE
if($fsize == 0)
{
$open_tag = "<small>";
$close_tag = "</small>";
}
if($fsize == 1)
{
$open_tag = "";
$close_tag = "";
}
if($fsize == 2)
{
$open_tag = "<big>";
$close_tag = "</big>";
}
if($security == 1 && ($ip != getenv('REMOTE_ADDR') OR $ua != htmlspecialchars(getenv('HTTP_USER_AGENT'))))
{
$bot = file("bots/bots.dat");
$system_bot = trim($bot[3]);
$message = "$nickname, ".SECURITY_MESSAGE."<br />n";
$message .= "Зашли с IP: ".getenv('REMOTE_ADDR').", User-Agent (Browser): ".getenv('HTTP_USER_AGENT').". Рекомендуем срочно сменить пароль:<br />n";
$message .= "<a href='profile.php?id=".$id."&password=".$password."'>[Изменить]</a>n";
$sql = mysql_query("SELECT `id` FROM `chat_rooms`;");
while($rooms = mysql_fetch_array($sql))
{
mysql_query("INSERT INTO `chat".$rooms['id']."` VALUES(0, '5', '".$system_bot."', '".$message."', '".$id."', '".date("H:i:s")."', ".time().");");
}
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"><wml>n";
echo "<card id="security" title="Внимание!"><p align="center">n";
echo $open_tag;
echo "<a href="menu.php?id=$id&password=$password&ver=wml">[Продолжить]</a><br/>";
echo "Ваши текущие данные не совпадают с данными, когда заходили под этим ником.<br/>n";
echo "Возможно, под вашим ником заходил посторонний человек.<br/>n";
echo "Если вы не заходили в чат с IP <u>$ip</u> и/или User-Agent (Browser) <u>$ua</u>, то советуем сменить пароль.<br/>n";
echo "Отключить оповещение можно в настройках.<br/>n";
echo "<a href="menu.php?id=$id&password=$password&ver=wml">[Продолжить]</a><br/>";
echo $close_tag;
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec<br/>n";
echo "</p></card></wml>";
$online = time() + 60;
mysql_query("UPDATE `chat_users` SET `time` = '".$online."', `place` = 0, `ip` = '".getenv('REMOTE_ADDR')."', `ua` = '".htmlspecialchars(getenv('HTTP_USER_AGENT'))."' WHERE `id` = '".$id."';");
exit();
}
//ONLINE
$online = time() + 60;
$update = mysql_query("UPDATE `chat_users` SET `time` = '".$online."', `place` = 0, `ip` = '".getenv('REMOTE_ADDR')."', `ua` = '".htmlspecialchars(getenv('HTTP_USER_AGENT'))."' WHERE `id` = '".$id."';");
//END ONLINE
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">n<wml>n";
echo "<card title="".TITLE.""><p align="center">n";
echo $open_tag;
if($level == 4) echo "<a href="admin.php?id=$id&password=$password&ver=wml">".MENU_ADMIN."</a><br/>n---<br/>n";
if($level == 3) echo "<a href="smoder.php?id=$id&password=$password&ver=wml">".MENU_SMODER."</a><br/>---<br/>nn";
if($level == 2) echo "<a href="moder.php?id=$id&password=$password&ver=wml">".MENU_MODER."</a><br/>---<br/>n";
if($level == 1) echo "<a href="vip.php?id=$id&password=$password&ver=wml">".MENU_VIP."</a><br/>---<br/>n";
print "<b>"; include("day_time.php"); print "</b>";
$time=time();
$currHour=date("H",$time);
$currDate=date("d.m.Y", $time);
$curr=date("i:s", $time);
$currTime=date("$currHour:i:s", $time);
$time="[";
$time.=$currTime;
$time.="/";
$time.=$currDate;
$time.="]";
print "$time<br/>";
//NEWS
$query = mysql_query("SELECT `id`, `name` FROM `chat_news` ORDER BY `id` DESC;");
while($news = @mysql_fetch_array($query))
{
$nid = $news['id'];
$name = $news['name'];
echo "<a href="news.php?id=$id&password=$password&nid=$nid&ver=wml">".$name."</a><br/>n";
}
//END NEWS
//MEETS
$query = mysql_query("SELECT COUNT(*) FROM `chat_meets`;");
$meets = mysql_result($query, 0);
//END MEETS
//LETTERS
$query = mysql_query("SELECT COUNT(*) FROM `chat_letters` WHERE `id` = '".$id."' AND `to` = '".$id."' AND `read` = 0;");
$newto = mysql_result($query, 0);
$query = mysql_query("SELECT COUNT(*) FROM `chat_letters` WHERE `id` = '".$id."' AND `to` = '".$id."';");
$to = mysql_result($query, 0);
//END LETTERS
//ONLINE IN CHAT
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > ".time().";");
$online = mysql_result($query, 0);
//END ONLINE
$in_embassies = 0;
$sql = mysql_query("SELECT `id` FROM `chat_rooms` WHERE `type` = 2;");
while($array = mysql_fetch_array($sql))
{
$rid = $array['id'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > ".time()." AND `place` = '".$rid."';");
$in_embassies = $in_embassies + mysql_result($query, 0);
}
echo "<a href="letters.php?id=$id&password=$password&ver=wml">".MENU_MAILBOX." [new $newto]</a><br/>n";
echo "<a href="letters.php?id=$id&password=$password&ver=wml&mod=send&toid=1">Поддержка</a><br/>n";
echo "Кто где ?<br/>n";
echo "<a href="online.php?id=$id&password=$password&ver=wml">Чат ($online)</a><br/>n";
echo "<a href="embassies.php?id=$id&password=$password&ver=wml">Клубы (".$in_embassies.")</a><br/>";
echo "<a href="search.php?id=$id&password=$password&ver=wml">".MENU_SEARCH."</a><br/>";
echo "- - - -<br/>";
echo "<a href="games/dice.php?id=$id&password=$password&ver=wml">".GAMES_DICE."</a><br/>";
echo "- - - -<br/>";
//PUBLIC ROOMS
$q = mysql_query("SELECT * FROM `chat_rooms` WHERE `type` = 0 ORDER BY `position` ASC;");
if(mysql_num_rows($q) == 0)
{
echo EMPTY_ROOMS_LIST."<br/>n";
}
while($room = mysql_fetch_array($q))
{
$rid = $room['id'];
$rname = $room['name'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `place` = ".$rid." AND `time` >= ".time().";");
$inroom = mysql_result($query, 0);
if($rid == $wicked_quiz or $rid == $unlim)
{
echo "<a href="unlim.php?id=$id&password=$password&rid=$rid&ver=wml">".$rname." (".$inroom.")</a><br/>n";
}
else
{
echo "<a href="room.php?id=$id&password=$password&rid=$rid&ver=wml">".$rname." (".$inroom.")</a><br/>n";
}
}
//END ROOMS
$sql = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `intim` >= ".time().";");
$intim = mysql_result($sql, 0);
echo "<a href="key.php?id=$id&password=$password&ver=wml">".ROOMS_INTIM." ($intim)</a><br/>n";
echo "---<br/>n";
//ROOMS FOR MODERATORS
if($level != 0)
{
$q = mysql_query("SELECT * FROM `chat_rooms` WHERE `type` = 1 ORDER BY `position` ASC;");
while($room = mysql_fetch_array($q))
{
$rid = $room['id'];
$rname = $room['name'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `place` = ".$rid." AND `time` >= ".time().";");
$inroom = mysql_result($query, 0);
echo "<a href="room.php?id=$id&password=$password&rid=$rid&ver=wml">".$rname." (".$inroom.")</a><br/>n";
}
if(mysql_num_rows($q) != 0)
{
echo "- - - -<br/>n";
}
}
//END ROOMS
echo "<a href="faq.php?id=$id&password=$password&ver=wml">".MENU_FAQ."</a><br/>n";
echo "<a href="ignor.php?id=$id&password=$password&ver=wml">".MENU_IGNOR."</a><br/>n";
echo "<a href="profile.php?id=$id&password=$password&ver=wml">".MENU_PROFILE."</a><br/>n";
echo "<a href="settings.php?id=$id&password=$password&ver=wml">".MENU_SETTINGS."</a><br/>n";
echo "<a href="menu.php?id=$id&password=$password&ver=html">html версия</a><br/>n";
echo "* * *<br/>";
echo "<a href="http://netka.su/forum">Forum.Netka.Su</a><br/>n";
echo "<a href="http://netka.su">Wap.Netka.Su</a><br/>n";
echo $close_tag;
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > '".time()."' AND `place` = 0;");
$inmenu = mysql_result($q, 0);
$q = mysql_query("SELECT `nickname` FROM `chat_users` WHERE `time` > '".time()."' AND `place` = 0;");
echo "<small>В меню: ".$inmenu."<br/>n";
$c = 0;
while($nick = mysql_fetch_array($q))
{
echo $nick['nickname'];
$c++;
if($c != $inmenu) echo ", ";
}
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec</small><br/>n";
echo "</p></card></wml>";
break;
////////////////////////////////////////////////////////
//HTML VERSION
////////////////////////////////////////////////////////
case 'html':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
//AUTH
if(isset($_POST['action']))
{
if($_POST['translit'] == "yes")
{
$lat = array("''", "'", """", """, "CH", "ch", "SC", "sc", "YE", "ye", "YU", "yu", "YA", "ya", "YO", "yo", "A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "H", "h", "Z", "z", "W", "w", "X", "x", "Y", "y");
$rus = array("Ь", "ь", "Ъ", "ъ", "Ч", "ч", "Щ", "щ", "Э", "э", "Ю", "ю", "Я", "я", "Ё", "ё", "А", "а", "Б", "б", "Ц", "ц", "Д", "д", "Е", "е", "Ф", "ф", "Г", "г", "Х", "х", "И", "и", "Ж", "ж", "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "В", "в", "Х", "х", "З", "з", "Ш", "ш", "Ы", "ы", "Й", "й");
$_POST['nickname'] = str_replace($lat, $rus, $_POST['nickname']);
}
$nickname = mysql_escape_string($_POST['nickname']);
$password = mysql_escape_string($_POST['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `nickname` = '".$nickname."' AND `password` = '".$password."';");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd">n";
echo "<html><head>n";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>n";
echo '<link href="css.css" rel="stylesheet" type="text/css"><title>'.$title.'</title>
</head>
<body>';
echo "Ошибка авторизации!<br/>n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec<br/>n";
echo "</body></html>";
exit();
}
}
else
{
$id = intval($_GET['id']);
$password = mysql_escape_string($_GET['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".$password."';");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd">n";
echo "<html><head>n";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>n";
echo '<link href="css.css" rel="stylesheet" type="text/css"><title>'.$title.'</title>
</head>
<body>';
echo "Ошибка авторизации!<br/>n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>[".round(($sec+$msec)-$headtime,5)."] sec<br/>n";
echo "</body></html>";
exit();
}
}
//END AUTH
//USER DATA
$user = mysql_fetch_array($q);
$id = $user['id'];
$nickname = $user['nickname'];
$level = $user['level'];
$status = $user['status'];
$time = $user['time'];
$fsize = $user['fsize'];
$ip = $user['ip'];
$ua = $user['ua'];
$security = $user['security'];
//END USER DATA
if($fsize == 0)
{
$fsize = "small";
}
if($fsize == 1)
{
$fsize = "normal";
}
if($fsize == 2)
{
$fsize = "large";
}
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">n";
echo "<html><head>n";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>n";
echo '<link href="css.css" rel="stylesheet" type="text/css"><title>'.TITLE.'</title>
</head>
<body>';
//STATUS UPDATE
if($status == STATUS_NOVICE && $posts > 500 && $posts < 1000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_USER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_USER && $posts > 1000 && $posts < 3000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_ADVANCED."' WHERE `id` = '".$id."';");
}
if($status == STATUS_ADVANCED && $posts > 3000 && $posts < 5000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_CHATTER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_CHATTER && $posts > 5000 && $posts < 7000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_SUPER."' WHERE `id` = '".$id."';");
}
if($status == STATUS_SUPER && $posts > 7000 && $posts < 10000)
{
$query = mysql_query("UPDATE `chat_users` SET `status` = '".STATUS_MEGA."' WHERE `id` = '".$id."';");
}
//END STATUS UPDATE
if($security == 1 && ($ip != getenv('REMOTE_ADDR') OR $ua != htmlspecialchars(getenv('HTTP_USER_AGENT'))))
{
$sql = mysql_query("SELECT `id` FROM `chat_rooms`;");
while($rooms = mysql_fetch_array($sql))
{
mysql_query("INSERT INTO `chat".$rooms['id']."` VALUES(0, '5', '".$system_bot."', '".$message."', '".$id."', '".date("H:i:s")."', ".time().");");
}
echo "<div class="lic"><a href="menu.php?id=$id&password=$password&ver=html">[Продолжить]</a></div>";
echo "<div class="lic2">Ваши текущие данные не совпадают с данными, когда заходили под этим ником.<br/>n";
echo "Возможно, под вашим ником заходил посторонний человек.<br/>n";
echo "Если вы не заходили в чат с IP <u>$ip</u> и/или User-Agent (Browser) <u>$ua</u>, то советуем сменить пароль.<br/>n";
echo "Отключить оповещение можно в настройках.</div>n";
echo "<div class="lic"><a href="menu.php?id=$id&password=$password&ver=html">[Продолжить]</a></div>";
list($msec, $sec) = explode(chr(32), microtime());
echo "<br/>n";
echo "<span style="font-size: small">[".round(($sec+$msec)-$headtime,5)."] sec</span><br/>n";
echo "</div></body></html>";
$online = time() + 60;
mysql_query("UPDATE `chat_users` SET `time` = '".$online."', `place` = 0, `ip` = '".getenv('REMOTE_ADDR')."', `ua` = '".htmlspecialchars(getenv('HTTP_USER_AGENT'))."' WHERE `id` = '".$id."';");
exit();
}
//ONLINE
$online = time() + 60;
$update = mysql_query("UPDATE `chat_users` SET `time` = '".$online."', `place` = 0, `ip` = '".getenv('REMOTE_ADDR')."', `ua` = '".htmlspecialchars(getenv('HTTP_USER_AGENT'))."' WHERE `id` = '".$id."';");
//END ONLINE
if($level == 4) echo "<div class="lic"><a href="admin.php?id=$id&password=$password&ver=html">Админка</a></div></div><div class="lic2">n";
if($level == 3) echo "<div class="lic"><a href="smoder.php?id=$id&password=$password&ver=html">С-модерка</a></div></div><div class="lic2">nn";
if($level == 2) echo "<div class="lic"><a href="moder.php?id=$id&password=$password&ver=html">Модерка</a></div></div><div class="lic2">nn";
if($level == 1) echo "<div class="lic"><a href="vip.php?id=$id&password=$password&ver=wml">VIP-меню</a></div>n";
$time=time();
$currHour=date("H",$time);
$currDate=date("d.m.Y", $time);
$curr=date("i:s", $time);
$currTime=date("$currHour:i:s", $time);
$time="[";
$time.=$currTime;
$time.="|";
$time.=$currDate;
$time.="]";
print "$time</div>";
print "<div class="lic2">";
//NEWS
$query = mysql_query("SELECT `id`, `name` FROM `chat_news` ORDER BY `id` DESC;");
while($news = @mysql_fetch_array($query))
{
$nid = $news['id'];
$name = $news['name'];
echo "<a href="news.php?id=$id&password=$password&nid=$nid&ver=html">".$name."</a><br/>n";
}
//END NEWS
//MEETS
$query = mysql_query("SELECT COUNT(*) FROM `chat_meets`;");
$meets = mysql_result($query, 0);
//END MEETS
//LETTERS
$query = mysql_query("SELECT COUNT(*) FROM `chat_letters` WHERE `id` = '".$id."' AND `to` = '".$id."' AND `read` = 0;");
$newto = mysql_result($query, 0);
$query = mysql_query("SELECT COUNT(*) FROM `chat_letters` WHERE `id` = '".$id."' AND `to` = '".$id."';");
$to = mysql_result($query, 0);
//END LETTERS
//ONLINE IN CHAT
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > ".time().";");
$online = mysql_result($query, 0);
//END ONLINE
$in_embassies = 0;
$sql = mysql_query("SELECT `id` FROM `chat_rooms` WHERE `type` = 2;");
while($array = mysql_fetch_array($sql))
{
$rid = $array['id'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > ".time()." AND `place` = '".$rid."';");
$in_embassies = $in_embassies + mysql_result($query, 0);
}
echo "<a href="letters.php?id=$id&password=$password&ver=html">".MENU_MAILBOX." ($newto/$to)</a><br/>n";
echo "<a href="online.php?id=$id&password=$password&ver=html">Кто-Где? ($online)</a><br/>n";
echo "<a href="search.php?id=$id&password=$password&ver=html">".MENU_SEARCH."</a><br/>";
echo "</div><div class="lic2">";
echo "<a href="games/dice.php?id=$id&password=$password&ver=html">Кости</a><br/>";
echo "</div><div class="lic4"><img src="chat.png"/>Общение:<br/>";
echo "<a href="embassies.php?id=$id&password=$password&ver=html">Клубы (".$in_embassies.")</a><br/>";
//PUBLIC ROOMS
$q = mysql_query("SELECT * FROM `chat_rooms` WHERE `type` = 0 ORDER BY `position` ASC;");
if(mysql_num_rows($q) == 0)
{
echo EMPTY_ROOMS_LIST."<br/>n";
}
while($room = mysql_fetch_array($q))
{
$rid = $room['id'];
$rname = $room['name'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `place` = ".$rid." AND `time` >= ".time().";");
$inroom = mysql_result($query, 0);
if($rid == $wicked_quiz or $rid == $unlim)
{
echo "<a href="unlim.php?id=$id&password=$password&rid=$rid&ver=html">".$rname." (".$inroom.")</a><br/>n";
}
else
{
echo "<a href="room.php?id=$id&password=$password&rid=$rid&ver=html">".$rname." (".$inroom.")</a><br/>n";
}
}
//END ROOMS
$sql = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `intim` >= ".time().";");
$intim = mysql_result($sql, 0);
echo "<a href="key.php?id=$id&password=$password&ver=html">".ROOMS_INTIM." ($intim)</a><br/>n";
echo "</div><div class="lic2">n";
//ROOMS FOR MODERATORS
if($level != 0)
{
$q = mysql_query("SELECT * FROM `chat_rooms` WHERE `type` = 1 ORDER BY `position` ASC;");
while($room = mysql_fetch_array($q))
{
$rid = $room['id'];
$rname = $room['name'];
$query = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `place` = ".$rid." AND `time` >= ".time().";");
$inroom = mysql_result($query, 0);
echo "<a href="room.php?id=$id&password=$password&rid=$rid&ver=html">".$rname." (".$inroom.")</a><br/>n";
}
if(mysql_num_rows($q) != 0)
{
echo "</div><div class="lic2">n";
}
}
//END ROOMS
echo "<a href="menu.php?id=$id&password=$password&ver=wml">WML</a><br/>n";
echo "<a href="faq.php?id=$id&password=$password&ver=html">".MENU_FAQ."</a><br/>n";
echo "<a href="faq.php?id=$id&password=$password&ver=html&mod=smiles">Смайлы</a><br/>n";
echo "<a href="profile.php?id=$id&password=$password&ver=html">".MENU_PROFILE."</a><br/>n";
echo "<a href="settings.php?id=$id&password=$password&ver=html">".MENU_SETTINGS."</a><br/>n";
echo "<a href="ignor.php?id=$id&password=$password&ver=html">".MENU_IGNOR."</a><br/>n";
echo "</div><div class="lic2">";
echo "<a href="http://netka.su/forum">На форум</a></div></div>n";
echo "<a href="http://netka.su">Главная сайта</a></div></div>n";
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `time` > '".time()."' AND `place` = 0;");
$inmenu = mysql_result($q, 0);
$q = mysql_query("SELECT `nickname` FROM `chat_users` WHERE `time` > '".time()."' AND `place` = 0;");
echo "</div></body></html>";
break;
}
?>