Просмотр файла game/chat/my.php

Размер файла: 5.82Kb
<?php
//POWERED by ILI
// ICQ : 197042
//site: ili.wab.ru
// ilichat v4.0
error_reporting(0);
require_once"./includes/functions/gzip.php";
include('start.php');
include("config.php");
include("./includes/".$ver."/banned");

list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;
$nocache = rand(1000, 9999);

switch($ver)
{
case 'wml':
///////////////////////////////////////////////////////
//WML VERSION
///////////////////////////////////////////////////////

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");

//AUTH
$id = intval($_SESSION['id']);
$password = mysql_escape_string($_SESSION['password']);
$q = mysql_query("SELECT nickname FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".md5($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>";
	require_once "includes/functions/gzip_foot.php";
	echo "</p></card></wml>";
	ob_end_flush();
	exit();
	}

//END AUTH
$nik = mysql_result($q, 0);

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

//MEETS
$query = mysql_query("SELECT COUNT(*) FROM `chat_meets`;");
$meets = mysql_result($query, 0);
//END MEETS

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 "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"index\" title=\"Cabinet\"><p align=\"left\">\n";
echo "<!-- Developed by ILI -->\n";
print"$nik, добро пожаловать в Ваш персональный кабинет!<br/>";
echo "<a href=\"letters.php?".SID."&amp;ver=wml\">Письма ($newto/$to)</a><br/>\n";
echo "<a href=\"meets.php?".SID."&amp;ver=wml\">Встречи ($meets)</a><br/>\n";
echo "<a href=\"buttons.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Софт Кнопки</a><br/>\n";
echo "<a href=\"mood.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Настроение</a><br/>\n";
echo "<a href=\"ignor.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Игнор-лист</a><br/>\n";
echo "<a href=\"profile.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Профиль</a><br/>\n";
echo "<a href=\"faq.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">FAQ и Статистика</a><br/>\n";
echo "<a href=\"settings.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Настройки</a><br/>\n";
echo "<br />\n";
echo "<a href=\"menu.php?".SID."&amp;ver=wml&amp;nocache=$nocache\">Меню чата</a><br/>\n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<small>[".round(($sec + $msec) - $headtime, 5)."]</small><br/>\n";
require_once "includes/functions/gzip_foot.php";
echo "</p></card></wml>";
ob_end_flush();
break;

case 'html':
///////////////////////////////////////////////////////
//HTML VERSION
///////////////////////////////////////////////////////

$my_title = "My";
if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = 1;
include_once "themes/".intval($_COOKIE['theme'])."/index.php";
//AUTH
$id = intval($_SESSION['id']);
$password = mysql_escape_string($_SESSION['password']);
$q = mysql_query("SELECT nickname FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".md5($password)."';");
	if(mysql_num_rows($q) == 0)
	{
	echo "Ошибка авторизации!<br/>\n";
	include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
	exit();
	}
//END AUTH
$nik = mysql_result($q, 0);

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

//MEETS
$query = mysql_query("SELECT COUNT(*) FROM `chat_meets`;");
$meets = mysql_result($query, 0);
//END MEETS

print"$nik, добро пожаловать в Ваш персональный кабинет!<br/>";
echo "<a href=\"letters.php?".SID."&amp;ver=html\">Письма ($newto/$to)</a><br/>\n";
echo "<a href=\"meets.php?".SID."&amp;ver=html\">Встречи ($meets)</a><br/>\n";
echo "<a href=\"mood.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Настроение</a><br/>\n";
echo "<a href=\"ignor.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Игнор-лист</a><br/>\n";
echo "<a href=\"profile.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Профиль</a><br/>\n";
echo "<a href=\"faq.php?".SID."&amp;ver=html&amp;nocache=$nocache\">FAQ и Статистика</a><br/>\n";
echo "<a href=\"settings.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Настройки</a><br/>\n";
echo "<a href=\"fontcolor.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Цвет текста</a><br/>\n";
echo "<a href=\"themes.php?".SID."&amp;ver=html\">Темы</a><br/>\n";
echo "<br />\n";
echo "<a href=\"menu.php?".SID."&amp;ver=html&amp;nocache=$nocache\">Меню чата</a><br/>\n";
include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
break;
}
?>