File size: 3.93Kb
<?
list($msec,$sec)=explode(chr(32),microtime());$HeadTime=$sec+$msec;
header("Cache-Control: no-cache");
header("Content-type: text/vnd.wap.wml");
$ref=rand(10000,1000000);
require("inc.php");
$link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\"><small>Can not connect to MySQL</small></p>
</card></wml>");
@mysql_select_db($MySQLDatabasename) or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\"><small>error select the database...</small></p>
</card></wml>");
if(isset($us))
{
$us=trim($us);
if($us=="")
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<card id=\"error\" title=\"error\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "User was not found";
echo "</small></p></card></wml>";
mysql_close ($link);
exit;
}
}
if(isset($id)){
$result = @mysql_query ("Select id,pass,level,posts,fsize from users where id='".$id."' LIMIT 1;");
} else {
$latuser=strtolower($us);
$ruser = rus_to_k($us);
if($ruser==$us){
$result = mysql_query ("Select id,pass,level,posts,fsize from users where latuser = '".$latuser."' LIMIT 1;");
} else {
$result = mysql_query ("select id,pass,level,posts,fsize from users where ruser = '".$ruser."' LIMIT 1;");
}
}
if (mysql_affected_rows() == 0)
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<card id=\"error\" title=\"error\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "User was not found";
echo "</small></p></card></wml>";
mysql_close ($link);
exit;
}
$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"error\" title=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "Your login failed";
echo "</small></p></card></wml>";
mysql_close($link);
exit;
}
if($row['fsize'] == "small") { $fsize1 = "<small>"; $fsize2 = "</small>"; }
elseif($row['fsize'] == "big") { $fsize1 = "<big>"; $fsize2 = "</big>"; }
else { $fsize1 = ""; $fsize2 = ""; }
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"who\" title=\"Кто в прихожей?\">";
echo "<p align=\"center\">";
echo $fsize1;
$tm = time()-300;
$pr_count = @mysql_query("SELECT id,user FROM users WHERE onl> '".$tm ."' AND room='holl' group by user order by onl desc;");
if (mysql_affected_rows() == 0) {
echo "Никого нет. Пропали безвести (:<br/>";
} else {
$kol = mysql_affected_rows();
print "Человек в прихожей: ".$kol."<br/>";
print $divide;
for ($k = 0; $k < $kol; $k++)
{
$pdc = @mysql_fetch_array($pr_count);
$user = $pdc["user"];
$nk = $pdc["id"];
echo "<a href=\"search.php?go=view&id=$id&ps=$ps&nick=$nk&ref=$ref\">".$user."</a>";
if (($k+1) != $kol) print ', ';
}
if($kol>0) echo "<br/>";
unset($pdc);
}
print $divide;
echo "<a href=\"enter.php?id=$id&ps=$ps&ref=$ref\">Прихожая</a><br/>";
echo $fsize2;
echo "</p></card></wml>";
?>