View file mafia/ignorlist.php

File size: 3.76Kb
<?
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\">Can not connect to MySQL</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\">error select the database...</p>
</card>
</wml>");
        
        $result = @mysql_query ("Select * from mafusers 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=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "Your login failed\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);   
exit;
}           
$us=$row["user"];
$ign=$row["ignor"];
if(isset($go)){
$ign = str_replace($unuser."|","",$ign);
mysql_query ("UPDATE mafusers SET ignor = '".$ign."' WHERE id = '".$id."'");
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=\"ok\" title=\"Ok\" ontimer=\"ignorlist.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\"><timer value=\"10\"/>\n";
echo "<p align=\"center\">\n";
echo "$unuser удален из вашего игнор-листа\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);   
exit;
}  
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=\"ignolist\" title=\"Игнор-лист\">\n";
echo "<p>\n";

if (strpos ($ign,"|") !== false){
echo "Нажмите на ник для удаления юзера из Вашего игнор-листа:<br/>\n";
$s1 = substr($ign,0,strpos($ign,"|"));
while (strpos ($ign,"|") !== false){
echo "<anchor title=\"go\">$s1<go href=\"ignorlist.php?id=$id&amp;ps=$ps&amp;go=del&amp;rm=$rm&amp;ref=$ref\" method=\"post\">\n";
echo "<postfield name=\"unuser\" value=\"$s1\"/>\n";
echo "</go></anchor><br/>\n";
$ign = substr ($ign, strpos($ign,"|")+1, strlen($ign)-strlen($s1)+1);
$s1 = substr($ign,0,strpos($ign,"|")); 
}
}
else echo"Ваш игнор-лист пуст!<br/>\n";
echo "*******<br/>\n";
if(isset($rm))echo "<a href=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\">В игру</a>\n";
else echo "<a href=\"enter.php?id=$id&amp;ps=$ps&amp;ref=$ref\">На улицу</a>\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
?>