Файл: online.php
Строк: 75
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Кто онлайн?';
include($path.'files/core.php');
if(isset($_GET['poisk']))
{
$nick=$_POST['nick'];
$nick=htmlspecialchars($nick);
$nick = addslashes($nick);
$tkr = mysql_query("SELECT * FROM `users` WHERE `usr` = '".$nick."'");
$tks=mysql_num_rows($tkr);
if($tks!=0)
{
$uy=mysql_fetch_array($tkr);
header('location: info.php?id='.$uy['id'].'');exit;
}
else
{
header('location: ?');exit;
}
}
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Кто Онлайн?
</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM users"));
$puslap = floor($viso/10);
$lv=time()-7200;
$users=mysql_query("SELECT * FROM `users` WHERE `lv`>'".$lv."' ORDER BY `lv` DESC LIMIT $num,10");
while($us=mysql_fetch_array($users))
{
echo '<div class=bbd>';
if($us['admin']>0 and $us['admin']<6)
{
echo '<img src=img/main/md.png> ';
}
if($us['admin']>5)
{
echo '<img src=img/main/admin.png> ';
}
echo '<img src=img/main/c'.$us['klass'].'.png> <img src=img/main/r'.$us['rasa'].'.png>
<a href=info.php?id='.$us['id'].'>'.$us['usr'].'</a> <img src=img/main/p10.png>'.$us['lvl'].' <font color=#aaaaaa>';
$sek=time()-$us['lv'];
$h=floor($sek/(60*60));
$m=floor(($sek % (60*60))/60);
$s=($sek % 60);
if($h!=0)
{echo $h.'ч ';}
if($m!=0)
{echo $m.'м ';}
if($s!=0)
{echo $s.'с ';}
echo '</font><br>';
echo '<img src=img/main/e28.png> <font color=#cccccc>Место: '.$us['mesto'].'</font>';
echo '</div>';
}
$kol_us=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `lv`>'".$lv."'"));
$pag=ceil($kol_us/10);
$m_p=$_GET['page']-2;
$mx_p=$_GET['page']+6;
echo '<table width=100%><tr>';
for($k=0; $k<=$pag; $k++)
{
if($k>=$m_p and $k<=$mx_p and $k>0)
{
$i=$k-1;
if($_GET['page']==''){$_GET['page']=0;}
if($_GET['page']!=$i)
{
echo '<td><a href=?page='.$i.'><div style="background: #000044; padding: 3px; margin-top: 3px;" class="bts bbs brs bls" align=center>'.$k.'</div></a></td>';
}
else
{
echo '<td><a href=?page='.$i.'><div style="background: #044440; padding: 3px; margin-top: 3px;" class="bts bbs brs bls" align=center>'.$k.'</div></a></td>';
}
}
}
echo'</tr></table>';
echo '<img src=img/main/i26.png> Поиск игрока:<br>
<form action=?poisk method=POST>
<input type=text name=nick><br>
<input type=submit value=Найти>
</form>
';
/*
if ($_GET['page'] > 0)
{
echo "<a href="?page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?page=$next">Далее</a>";}
else
{echo "Далее";}
*/
echo '</div></div>';
include('files/down.php');
?>