File size: 5.61Kb
<?php
define("MYSQLHOST", "localhost");
define("DBNAME", "chat");
define("DBUSER", "root");
define("DBPASS", "пароль");
$wmlfoot="<a href=\"http://moymirok.ru\">MoyMirok.ru</a> 2007-2008<br/>";
$sitemenu="<a href=\"http://moymirok.ru\"><font color=\"white\">Moymirok.ru</font></a> 2007-2008<br/>";
$sitefoot="Moymirok.ru 2007-2008<br/>";
$siteurl="http://Moymirok.ru";
$sitename="Moymirok.ru";
//PROTECTION
if(strpos($_SERVER['HTTP_USER_AGENT'], "'") !== false) die();
if(substr($_SERVER['HTTP_USER_AGENT'], 0 , 7) == "SamSunf") die();
if(preg_match("'Nokia(\d{3})/'", $_SERVER['HTTP_USER_AGENT'])) die();
$dbcnx = mysql_connect('localhost', DBUSER, DBPASS) or die('Can not connect to MySQL');
mysql_query('SET NAMES `utf8`');
mysql_query("set character_set_client='utf8'");
mysql_query("set character_set_results='utf8'");
mysql_query("set collation_connection='utf8_general_ci'");
mysql_select_db(DBNAME) or die('Error select the database');
if (!$dbcnx)
{
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-revalidate");
$mysql_error = mysql_error();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><style type=\"text/css\">body{font-size:small;color:#000000;font-family:sans-serif;background-color:#FFFFFF;margin:0;}a{color:#0000ff;text-decoration:none;}.user{color:#0000ff;}.admin{color:#696969;}.moder{color:#B05747;}.robot{color:#FF6347;}a.b3{color:#ffffff;}a.b2{color:#000000;}a:hover{text-decoration:underline;}form{padding:0px;margin:0px;}div{padding-left:3px;padding-right:3px;}.d1{background-color:#f4fcd3;}.d2{background-color:#EFEE52;}.d3{background-color:#89A558;color:#ffffff;}.d4{background-color:#ffffff;}.d5{background-color:#ff0000;color:#ffffff;}img{vertical-align:middle;}</style></head><body>
<div class=\"d3\">Ошибка..</div>
Извините,база данных в данный момент недоступна,<br/>возможно проводятся технические работы.<br/>Попробуйте зайти позже..<br/>
<div class=\"d3\">$sitefoot</div>
</body></html>
";
exit();
}
if (!mysql_select_db(DBNAME, $dbcnx))
{
$mysql_error = mysql_error();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><style type=\"text/css\">body{font-size:small;color:#000000;font-family:sans-serif;background-color:#FFFFFF;margin:0;}a{color:#0000ff;text-decoration:none;}.user{color:#0000ff;}.admin{color:#696969;}.moder{color:#B05747;}.robot{color:#FF6347;}a.b3{color:#ffffff;}a.b2{color:#000000;}a:hover{text-decoration:underline;}form{padding:0px;margin:0px;}div{padding-left:3px;padding-right:3px;}.d1{background-color:#f4fcd3;}.d2{background-color:#EFEE52;}.d3{background-color:#89A558;color:#ffffff;}.d4{background-color:#ffffff;}.d5{background-color:#ff0000;color:#ffffff;}img{vertical-align:middle;}</style></head><body>
<div class=\"d3\">Ошибка..</div>
Извините,база данных в данный момент недоступна,<br/>возможно проводятся технические работы.<br/>Попробуйте зайти позже..<br/>
<div class=\"d3\">$sitefoot</div>
</body></html>
";
exit();
}
//SWITCH VERSION
if(isset($_GET['ver']))
{
$ver = $_GET['ver'];
}
else
{
$ver = "";
}
if($ver != "wml" && $ver != "html")
{
$ver = "wml";
}
//COLORS FOR HTML VERSION
if($_GET['ver'] == "html")
{
if(!isset($_COOKIE['theme']))
{
//
$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)
{
//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";
}
}
else
{
$fsize = "small";
}
$css="<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><style type=\"text/css\">body{font-size:".$fsize.";color:#000000;font-family:sans-serif;background-color:#FFFFFF;margin:0;}a{color:#0000ff;text-decoration:none;}.user{color:#0000ff;}.admin{color:#696969;}.moder{color:#B05747;}.robot{color:#FF6347;}a.b3{color:#ffffff;}a.b2{color:#000000;}a:hover{text-decoration:underline;}form{padding:0px;margin:0px;}div{padding-left:3px;padding-right:3px;}.d1{background-color:#f4fcd3;}.d2{background-color:#EFEE52;}.d3{background-color:#89A558;color:#ffffff;}.d4{background-color:#ffffff;}.d5{background-color:#ff0000;color:#ffffff;}img{vertical-align:middle;}</style></head><body>";
}
else
{
include("themes_switch.php");
}
$favicon = "favicon.ico";
}
if(!function_exists('iconv'))
{
include("./includes/functions/iconv.function");
}
//UNLIM ROOMS
$wicked_quiz = 3;
$unlim = 4;
// GZip Include
include("./includes/functions/gzip.function");
?>