File size: 5.42Kb
<?php
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>Authorization Failed!<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, Welcome to your profile!<br/>";
echo "<a href=\"letters.php?".SID."&ver=wml\">Letters ($newto/$to)</a><br/>\n";
echo "<a href=\"meets.php?".SID."&ver=wml\">Meetings ($meets)</a><br/>\n";
echo "<a href=\"buttons.php?".SID."&ver=wml&nocache=$nocache\">Buttons</a><br/>\n";
echo "<a href=\"mood.php?".SID."&ver=wml&nocache=$nocache\">Mood</a><br/>\n";
echo "<a href=\"ignor.php?".SID."&ver=wml&nocache=$nocache\">Ignore list</a><br/>\n";
echo "<a href=\"profile.php?".SID."&ver=wml&nocache=$nocache\">Profile</a><br/>\n";
echo "<a href=\"faq.php?".SID."&ver=wml&nocache=$nocache\">FAQ</a><br/>\n";
echo "<a href=\"settings.php?".SID."&ver=wml&nocache=$nocache\">Preferences</a><br/>\n";
echo "<br />\n";
echo "<a href=\"menu.php?".SID."&ver=wml&nocache=$nocache\">HALL</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 "Authorization Failed!<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, Welcome to your profile!<br/>";
echo "<a href=\"letters.php?".SID."&ver=html\">Letters ($newto/$to)</a><br/>\n";
echo "<a href=\"meets.php?".SID."&ver=html\">Meetings ($meets)</a><br/>\n";
echo "<a href=\"mood.php?".SID."&ver=html&nocache=$nocache\">Mood</a><br/>\n";
echo "<a href=\"ignor.php?".SID."&ver=html&nocache=$nocache\">Ignore list</a><br/>\n";
echo "<a href=\"profile.php?".SID."&ver=html&nocache=$nocache\">Profile</a><br/>\n";
echo "<a href=\"faq.php?".SID."&ver=html&nocache=$nocache\">FAQ</a><br/>\n";
echo "<a href=\"settings.php?".SID."&ver=html&nocache=$nocache\">Preferences</a><br/>\n";
echo "<a href=\"fontcolor.php?".SID."&ver=html&nocache=$nocache\">Font Color</a><br/>\n";
echo "<a href=\"themes.php?".SID."&ver=html\">Themes</a><br/>\n";
echo "<br />\n";
echo "<a href=\"menu.php?".SID."&ver=html&nocache=$nocache\">HALL</a><br/>\n";
include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
break;
}
?>