Файл: who.php
Строк: 27
<?php
include_once"files/zahit.php";
include_once"files/antixak.php";
include_once"files/check2.php";
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
echo'<div class="p">Ошибка! Пользователь с таким логином и паролем не зарегистрирован, или пароль/логин неверен! <a href="index.php">На главную</a><br>';exit;
}else{
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
$_title = 'Персонаж';
include 'files/header.php';
$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;
?>