File size: 2.27Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("files/antixak.php");
header("Content-type:text/vnd.wap.wml");
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
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>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"Персонаж\">";
echo "<p align=\"left\">";
$whoshowuser="10"; //на стр.
echo"<small>Сейчас в игре:</small><br/><br/>";
$file = @file("data/who.dat");
$file = array_reverse($file);
$total = count($file);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + $whoshowuser){ $end = $total; }
else {$end = $start + $whoshowuser; }
for ($i = $start; $i < $end; $i++){
$data = explode("|",$file[$i]);
$i2=round($i+1);
$cur=time();
$cu=$cur-$data[3];
$cu=round($cu/60);
if($cu<6){$cu="Oнлайн";}
if($cu>=6 && $cu<60){$cu="$cu минут назад";}
if($cu>=60){$cu=round($cu/60); $cu="$cu часов назад";}
$cu=stripslashes($cu);
$cu=str_replace("\\","",$cu);
$cu=str_replace("/","",$cu);
$cu=str_replace("|","",$cu);
$cu=str_replace("$","",$cu);
$cu=str_replace("<","",$cu);
$cu=str_replace(">","",$cu);
//////////////////////////////////
$data[0]=stripslashes($data[0]);
$data[0]=htmlspecialchars($data[0]);
$data[0]=str_replace("|","",$data[0]);
echo "<small>$i2. $data[0] ($cu)</small><br/><br/>";
}
if ($start != 0) {echo '<small><a href="who.php?start='.($start - $whoshowuser).'">Назад |</a> </small>';}
if ($total > $start + $whoshowuser) {echo '<small> <a href="who.php?start='.($start + $whoshowuser).'">| Далее</a></small>';}
////////////////////////////////////
require_once"files/down.php";
////////////////////////////////////
exit;
?>