View file game/chat/menu.txt

File size: 49.38Kb
яю<?php

error_reporting(7);

include('start.php');

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=windows-1251");

header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

header("Cache-Control: no-cache, must-revalidate");



//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(",", "L", "*", "J", "'", "G", ")", "I", "-", "M", ".", "N", "/", "O", "", "Q", "", "0", "", "1", "&", "F", "", "4", "", "5", "$", "D", "", "3", "%", "E", "", "8", "", "6", "", ":", "", ";", "", "<", "", "=", "", ">", "", "?", " ", "@", "!", "A", """, "B", "#", "C", "", "2", "%", "E", "", "7", "(", "H", "+", "K", "", "9");

	$_POST['nickname'] = str_replace($lat, $rus, $_POST['nickname']);

	}



$nickname = mysql_escape_string($_POST['nickname']);

$password = mysql_escape_string($_POST['password']);

$_SESSION['password'] = $password;

$q = mysql_query("SELECT * FROM `chat_users` WHERE `nickname` = '".$nickname."' AND `password` = '".md5($password)."' LIMIT 1;");

	if(mysql_num_rows($q) == 0)

	{

	echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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>H81:0 02B>@870F88!<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($_SESSION['id']);

$password = mysql_escape_string($_SESSION['password']);

$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".md5($password)."';");

	if(mysql_num_rows($q) == 0)

	{

	echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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>H81:0 02B>@870F88!<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

$_SESSION['id'] = $id;

//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 .= "0H;8 A IP: ".getenv('REMOTE_ADDR').", User-Agent (Browser): ".getenv('HTTP_USER_AGENT').".  5:><5=4C5< A@>G=> A<5=8BL ?0@>;L:<br />\n";

$message .= "<a href=\'profile.php?".SID."\'>[7<5=8BL]</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, '".$id."', '".$system_bot."', '".$message."', '".$id."', '".date("H:i:s")."', ".time().");");

	}



echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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=\"=8<0=85!\"><p align=\"left\">\n";

echo $open_tag;

echo "<a href=\"menu.php?".SID."&amp;ver=wml&amp;ref=".rand(1, 100)."\">[@>4>;68BL]</a><br/>";

echo "0H8 B5:CI85 40==K5 =5 A>2?040NB A 40==K<8, :>340 70E>48;8 ?>4 MB8< =8:><.<br/>\n";

echo ">7<>6=>, ?>4 20H8< =8:>< 70E>48; ?>AB>@>==89 G5;>25:.<br/>\n";

echo "A;8 2K =5 70E>48;8 2 G0B A IP <u>$ip</u> 8/8;8 User-Agent (Browser) <u>$ua</u>, B> A>25BC5< A<5=8BL ?0@>;L.<br/>\n";

echo "B:;NG8BL >?>25I5=85 <>6=> 2 =0AB@>9:0E.<br/>\n";

echo "<a href=\"menu.php?".SID."&amp;ver=wml&amp;ref=".rand(1, 100)."\">[@>4>;68BL]</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=\"windows-1251\"?>\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=\"left\">\n";

echo $open_tag;

if($level == 4) echo "<a href=\"admin.php?".SID."&amp;ver=wml\">".4<8=:0."</a><br/>\n---<br/>\n";

if($level == 3) echo "<a href=\"smoder.php?".SID."&amp;ver=wml\">".MENU_SMODER."</a><br/>---<br/>\n\n";

if($level == 2) echo "<a href=\"moder.php?".SID."&amp;ver=wml\">".MENU_MODER."</a><br/>---<br/>\n";

if($level == 1) echo "<a href=\"vip.php?".SID."&amp;ver=wml\">".MENU_VIP."</a><br/>---<br/>\n";

if(time() > $time + 3600) echo "@825B, $nickname!<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?".SID."&amp;nid=$nid&amp;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=\"meets.php?".SID."&amp;ver=wml\">".AB@5G8." ($meets)</a><br/>\n";

echo "<a href=\"letters.php?".SID."&amp;ver=wml\">".MENU_MAILBOX." ($newto/$to)</a><br/>\n";

echo "<a href=\"online.php?".SID."&amp;ver=wml\">".MENU_ONLINE." ($online)</a><br/>\n---<br/>\n";

echo "<a href=\"gallery.php?".SID."\">0;5@5O</a><br/>\n---<br/>\n";

echo "<a href=\"search.php?".SID."&amp;ver=wml\">".MENU_SEARCH."</a><br/>\n---<br/>\n";

echo "<a href=\"games/dice.php?".SID."&amp;ver=wml\">".GAMES_DICE."</a><br/>\n---<br/>\n";

echo "<a href=\"embassies.php?".SID."&amp;ver=wml\">".ROOMS_EMBASSIES." (".$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?".SID."&amp;rid=$rid&amp;ver=wml\">".$rname." (".$inroom.")</a><br/>\n";

	}

	else

	{

	echo "<a href=\"room.php?".SID."&amp;rid=$rid&amp;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?".SID."&amp;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?".SID."&amp;rid=$rid&amp;ver=wml\">".$rname." (".$inroom.")</a><br/>\n";

}

	if(mysql_num_rows($q) != 0)

	{

	echo "---<br/>\n";

	}

}

//END ROOMS



echo "<a href=\"faq.php?".SID."&amp;ver=wml\">".MENU_FAQ."</a><br/>\n";

echo "<a href=\"ignor.php?".SID."&amp;ver=wml\">".MENU_IGNOR."</a><br/>\n";

echo "<a href=\"profile.php?".SID."&amp;ver=wml\">".MENU_PROFILE."</a><br/>\n";

echo "<a href=\"settings.php?".SID."&amp;ver=wml\">".=0AB@>9:8."</a><br/>\n";

echo "<a href=\"menu.php?".SID."&amp;ver=html\">".VERSION_HTML."</a> | ".VERSION_WML."<br/>\n";

echo "<a href=\"buttons.php?".SID."&amp;ver=wml\">Buttons</a><br/>\n";

echo "<a href=\"http://ili.wab.ru\">;02=0O</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> <5=N: ".$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=windows-1251");

header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

header("Cache-Control: no-cache, must-revalidate");



//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(",", "L", "*", "J", "'", "G", ")", "I", "-", "M", ".", "N", "/", "O", "", "Q", "", "0", "", "1", "&", "F", "", "4", "", "5", "$", "D", "", "3", "%", "E", "", "8", "", "6", "", ":", "", ";", "", "<", "", "=", "", ">", "", "?", " ", "@", "!", "A", """, "B", "#", "C", "", "2", "%", "E", "", "7", "(", "H", "+", "K", "", "9");

	$_POST['nickname'] = str_replace($lat, $rus, $_POST['nickname']);

	}



$nickname = mysql_escape_string($_POST['nickname']);

$password = mysql_escape_string($_POST['password']);

$_SESSION['password'] = $password;



$q = mysql_query("SELECT * FROM `chat_users` WHERE `nickname` = '".$nickname."' AND `password` = '".md5($password)."';");

	if(mysql_num_rows($q) == 0)

	{

	echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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=windows-1251\"/>\n";

	echo "<link rel=\"shortcut icon\" href=\"$icon\" /><title>".$title."</title>\n";

	echo "<style type=\"text/css\">";

	echo "body { font-weight: normal; font-size: normal; font-family: ".$font."; color: ".$color."; background-color: ".$background." }";

	echo "a:link,a:active,a:visited { text-decoration: underline; color : ".$links." }";

	echo "</style></head><body>";

	echo "H81:0 02B>@870F88!<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($_SESSION['id']);

$password = mysql_escape_string($_SESSION['password']);

$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".md5($password)."';");

	if(mysql_num_rows($q) == 0)

	{

	echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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=windows-1251\"/>\n";

	echo "<link rel=\"shortcut icon\" href=\"$icon\" /><title>".$title."</title>\n";

	echo "<style type=\"text/css\">";

	echo "body { font-weight: normal; font-size: normal; font-family: ".$font."; color: ".$color."; background-color: ".$background." }";

	echo "a:link,a:active,a:visited { text-decoration: underline; color : ".$links." }";

	echo "</style></head><body>";

	echo "H81:0 02B>@870F88!<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

$_SESSION['id'] = $id;

if($fsize == 0)

{

$fsize = "small";

}

if($fsize == 1)

{

$fsize = "normal";

}

if($fsize == 2)

{

$fsize = "large";

}



//NORMAL'NYI VHOD

echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\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=windows-1251\"/>\n";

echo "<link rel=\"shortcut icon\" href=\"$icon\" /><title>".TITLE."</title>\n";

print "<div style=\"background-color:#EE0000;border:2px outset #FF0000;color:white;\" align=\"left\"><b>ILI.WAB.RU</b></div>";

print "<div style=\"background-color:$form_color;border:2px outset #EEB422;color:white;\" align=\"center\">@8OB=>3> >1I5=8O!</div><br/>";

echo "<style type=\"text/css\">

body { font-weight: normal; font-size: $fsize; font-family: ".$font."; color: ".$color."; background-color: ".$background." }

a:link,a:active,a:visited { text-decoration: underline; color : ".$links." }

</style></head><body><div style=\"text-align: left\">";



//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'))))

{

$bot = file("bots/bots.dat");

$system_bot = trim($bot[3]);



$message = "$nickname, ! 0H53> =8:0 A59G0A 70H5; ?>;L7>20B5;L A 40==K<8, =5 A>2?040NI8<8 A 0H8<8.<br />\n";

$message .= "0H;8 A IP: ".getenv('REMOTE_ADDR').", User-Agent (Browser): ".getenv('HTTP_USER_AGENT').".  5:><5=4C5< A@>G=> A<5=8BL ?0@>;L:<br />\n";

$message .= "<a href=\'profile.php?".SID."&amp;ver=html\'>[7<5=8BL]</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, '".$id."', '".$system_bot."', '".$message."', '".$id."', '".date("H:i:s")."', ".time().");");

	}



echo "<a href=\"menu.php?".SID."&amp;ver=html\">[@>4>;68BL]</a><br/>";

echo "0H8 B5:CI85 40==K5 =5 A>2?040NB A 40==K<8, :>340 70E>48;8 ?>4 MB8< =8:><.<br/>\n";

echo ">7<>6=>, ?>4 20H8< =8:>< 70E>48; ?>AB>@>==89 G5;>25:.<br/>\n";

echo "A;8 2K =5 70E>48;8 2 G0B A IP <u>$ip</u> 8/8;8 User-Agent (Browser) <u>$ua</u>, B> A>25BC5< A<5=8BL ?0@>;L.<br/>\n";

echo "B:;NG8BL >?>25I5=85 <>6=> 2 =0AB@>9:0E.<br/>\n";

echo "<a href=\"menu.php?".SID."&amp;ver=html&amp;ref=".rand(1, 100)."\">[@>4>;68BL]</a><br/>";

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 "<a href=\"admin.php?".SID."&amp;ver=html\">4<8=:0</a><br/>\n---<br/>\n";

if($level == 3) echo "<a href=\"smoder.php?".SID."&amp;ver=html\">!-<>45@:0</a><br/>---<br/>\n\n";

if($level == 2) echo "<a href=\"moder.php?".SID."&amp;ver=html\">>45@:0</a><br/>---<br/>\n\n";

if($level == 1) echo "<a href=\"vip.php?".SID."&amp;ver=html\">VIP-<5=N</a><br/>---<br/>\n";

if(time() > $time + 3600) echo "@825B, $nickname!<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?".SID."&amp;nid=$nid&amp;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=\"meets.php?".SID."&amp;ver=html\">".MENU_MEETS." ($meets)</a><br/>\n";

echo "<a href=\"letters.php?".SID."&amp;ver=html\">".MENU_MAILBOX." ($newto/$to)</a><br/>\n";

echo "<a href=\"online.php?".SID."&amp;ver=html\">".MENU_ONLINE." ($online)</a><br/>\n";

echo "<a href=\"search.php?".SID."&amp;ver=html\">".MENU_SEARCH."</a><br/>\n---<br/>\n";

echo "<a href=\"games/dice.php?".SID."&amp;ver=html\">".GAMES_DICE."</a><br/>\n---<br/>\n";

echo "<a href=\"embassies.php?".SID."&amp;ver=html\">".ROOMS_EMBASSIES." (".$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?".SID."&amp;rid=$rid&amp;ver=html\">".$rname." (".$inroom.")</a><br/>\n";

	}

	else

	{

	echo "<a href=\"room.php?".SID."&amp;rid=$rid&amp;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?".SID."&amp;ver=html\">".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?".SID."&amp;rid=$rid&amp;ver=html\">".$rname." (".$inroom.")</a><br/>\n";

}

	if(mysql_num_rows($q) != 0)

	{

	echo "---<br/>\n";

	}

}

//END ROOMS



echo "<a href=\"faq.php?".SID."&amp;ver=html\">".MENU_FAQ."</a><br/>\n";

echo "<a href=\"ignor.php?".SID."&amp;ver=html\">".MENU_IGNOR."</a><br/>\n";

echo "<a href=\"profile.php?".SID."&amp;ver=html\">".MENU_PROFILE."</a><br/>\n";

echo "<a href=\"settings.php?".SID."&amp;ver=html\">0AB@>9:8</a><br/>\n";

echo "<a href=\"themes.php?".SID."&amp;ver=html\">"5<K</a><br/>\n";

echo "<a href=\"menu.php?".SID."&amp;ver=wml\">".VERSION_WML."</a> | ".VERSION_HTML."<br/>\n";

echo "<a href=\"http://ili.wab.ru\">;02=0O</a><br/>\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 "<span style=\"font-size: small\"> <5=N: ".$inmenu."</span><br/>\n";

$c = 0;

while($nick = mysql_fetch_array($q))

{

echo "<span style=\"font-size: small\">".$nick['nickname']."</span>";

$c++;

if($c != $inmenu) echo ", ";

}



list($msec, $sec) = explode(chr(32), microtime());

echo "<br/>\n</div>";

print "<br/><div style=\"background-color:$form_color;border:2px outset #EEB422;color:#8B1A1A;font-size:small;\" align=\"left\">[".round(($sec+$msec)-$headtime,5)."] sec</div><br/>";

echo "</body></html>";

break;

}

?>