Просмотр файла mafia/who.php

Размер файла: 2.39Kb
<?php

$title="Мафия - Кто здесь?";
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
echo"<div class='sep'><div class=\"i\">$title
</div>";

$ref=rand(10000,1000000);

$result = mysql_query ("Select * from mafusers where id_user = '$user[id_user]'"); 

if (!isset($rm)) $rm =1;

$rmaf = "maf".$rm; 

$ringame = "ingame".$rm;            

$row = mysql_fetch_array ($result);

$us=mysql_real_escape_string($row["user"]);  

$id=(int)$row['id'];



if (($row["posts"]>=1000)&&($row["level"]<1)){

$row["level"] = 1; $row["status"] = "Продвинутый пользователь";

mysql_query ("UPDATE mafusers SET status = '".$row["status"]."', level = '".$row["level"]."' WHERE id = '".$id."'");

}  

if (($row["posts"]>=3000)&&($row["level"]<2)){

$row["level"] = 2; $row["status"] = "Чаттер";

mysql_query ("UPDATE mafusers SET status = '".$row["status"]."', level = '".$row["level"]."' WHERE id = '".$id."'");

}  

if (($row["posts"]>=7000)&&($row["level"]<3)){

$row["level"] = 3; $row["status"] = "Тусовщик";

mysql_query ("UPDATE mafusers SET status = '".$row["status"]."', level = '".$row["level"]."' WHERE id = '".$id."'");

} 

/*

$tm = time()-300;

$res = mysql_query ("Select * from $rmaf WHERE id > '$tm' group by usid order by id desc");

$kol = mysql_affected_rows(); 

$lines = mysql_fetch_array ($res); 

//if($num!=0)echo "<br/>\n";

echo "<b>В игре:</b><br/>\n";



for ($k = 1; $k < $kol; $k++){    



       $user = $lines['who'];

       $user_id = $lines['usid'];

       $r = mysql_query("select * from $ringame WHERE gamer_id = '$user_id'"); 

       $a = mysql_fetch_array($r);

       $id_in_game = $a['id_in_game'];

       if (mysql_affected_rows()!=0) $ingame = "$user($id_in_game)"; else $outgame = "$user";

}      

unset($lines);

echo "$ingame<br/>\n";}

echo "<br/><b>Вне игры:</b><br/>\n";

echo "$outgame";

*/

$tm=time()-300;

echo "В игре: ";

$online=mysql_query("SELECT * FROM $rmaf WHERE id > '$tm' group by usid order by id desc");

while ($g_online=(mysql_fetch_array($online)))

{

$usid=(int)$g_online['usid'];

echo " <a href=inside.php?id=$id&amp;nk=$usid&amp;rm=$rm&amp;ref=$ref>$g_online[who]</a>, ";

}







echo "<br/>*******<br/>\n";

echo "<a href=\"maf.php?id=$id&amp;rm=$rm&amp;ref=$ref\">К Мафу</a><br/>\n";

echo "</p>\n";

require"../system/foot.php";

?>