View file 4at2/ch/searchmod.php

File size: 3.69Kb
<?php
header("Cache-Control: no-cache"); 
header("Content-type:text/vnd.wap.wml");
require("inc.php");
$ref=rand(10000,1000000);

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

		$result = @mysql_query ("Select pass,level,fsize from users where id='".$id."'");
         
         if (mysql_affected_rows() == 0) {
          echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "User was not found\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
                
$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"10\"/>\n";
echo "<p align=\"center\">\n";
echo "Your login failed\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
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\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"results\" title=\"Поиск модеров\">\n";
echo "<p >\n";
echo $fsize1;
$r = mysql_query("SELECT id,user,onl,room FROM users WHERE level >= '4' and id != '100'");
if (mysql_affected_rows() == 0) {
echo "Модеров сейчас нет<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$usid = $a["id"];
$nick = $a["user"];
$onl = $a["onl"];
$room = $a["room"];
$a = mysql_fetch_array($r);
if ($room=="letters"){
if(($onl+300>time())&&($room!="")){
echo "<a href=\"inside.php?id=$id&amp;ps=$ps&amp;rm=$room&amp;nk=$usid\">".$nick."</a> | \n";
echo "сейчас находится в <a href=\"chatmail.php?id=$id&amp;ps=$ps&amp;rm=$room&amp;ref=$ref\">записках</a><br/>\n";
}
}else{
$roomselect = @mysql_query ("Select name from rooms where rm=$room");
$rooms = @mysql_fetch_array($roomselect);
$roomname=$rooms["name"];
if(($onl+300>time())&&($room!="")){
echo "<a href=\"inside.php?id=$id&amp;ps=$ps&amp;rm=$room&amp;nk=$usid\">".$nick."</a> | \n";
if($room==9)echo "Сейчас в комнате <a href=\"anlim.php?id=$id&amp;ps=$ps&amp;rm=$room&amp;ref=$ref\">$roomname</a><br/>\n";
else echo "Сейчас в комнате <a href=\"chat.php?id=$id&amp;ps=$ps&amp;rm=$room&amp;ref=$ref\">$roomname</a><br/>\n";
}
}
}
}
echo "---<br/>\n";
echo "<a href=\"enter.php?id=$id&amp;ps=$ps&amp;ref=$ref\">Прихожая</a>\n"; 
echo $fsize2;
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit;
?>