View file pages/online.php

File size: 4.74Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

echo'<img src="../images/img/banners.gif" alt=""> <b>Кто в онлайне</b><br><br>'; 
 	
$lines=file(BASEDIR."local/online.dat");
$lines = array_reverse($lines);

foreach($lines as $value){

$data = explode("#",$value);

$fullar[]='|'.$data[0].'|'.$data[1].'|'.$data[2].'|'.$data[3].'|';

if($data[2]!=""){
$regar[]='|'.$data[0].'|'.$data[1].'|'.$data[2].'|'.$data[3].'|';
}
}

$total=count($fullar);
$totalreg=count($regar);

echo'Всего на сайте: <b>'.(int)$total.'</b><br> Зарегистрированных:  <b>'.(int)$totalreg.'</b><br><hr>';

//-------------------------------------------------------------//
if($list=="full"){
 
$start = (int)$_GET['start'];
if($start < 0 || $start > $total){$start = 0;}
if ($total < $start + $config_onlinelist){ $end = $total; }
else {$end = $start + $config_onlinelist; }
for ($i = $start; $i < $end; $i++){

$data = explode("|",$fullar[$i]);
$usertime=date_fixed($data[1],'H:i');

if($data[3]==""){

echo '<img src="../images/img/chel.gif" alt=""> <b>'.$config_guestsuser.'</b> (Время: '.$usertime.')<br>'; 
echo '<small><font color="#CC00CC">('.$data[4].', '.$data[2].')</font></small><hr>';

}else{

echo '<img src="../images/img/chel.gif" alt=""> <b><a href="../pages/anketa.php?uz='.$data[3].'&amp;'.SID.'">'.nickname($data[3]).'</a></b> (Время: '.$usertime.')<br>'; 
echo '<small><font color="#CC00CC">('.$data[4].', '.$data[2].')</font></small><hr>';

}
}

}else{

//-------------------------------------------------------------//
$total = $totalreg;    

if($total<1){echo'<img src="../images/img/reload.gif" alt=""> <b>Зарегистрированных нет!</b><br><br>';}

if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + $config_onlinelist){ $end = $total; }
else {$end = $start + $config_onlinelist; }
for ($i = $start; $i < $end; $i++){

$data = explode("|",$regar[$i]);
$usertime=date_fixed($data[1],'H:i');

echo '<img src="../images/img/chel.gif" alt=""> <b><a href="../pages/anketa.php?uz='.$data[3].'&amp;'.SID.'">'.nickname($data[3]).'</a></b> (Время: '.$usertime.')<br>'; 
echo '<small><font color="#CC00CC">('.$data[4].', '.$data[2].')</font></small><hr>';

}
}

if ($start != 0) {echo '<a href="online.php?start='.($start - $config_onlinelist).'&amp;list='.$list.'&amp;'.SID.'">&lt;-Назад</a> ';}else{echo'&lt;-Назад';}
echo' | '; 
if ($total > $start + $config_onlinelist) {echo ' <a href="online.php?start='.($start + $config_onlinelist).'&amp;list='.$list.'&amp;'.SID.'">Далее-&gt;</a>';}else{echo'Далее-&gt;';}


if($total>0){
$ba=ceil($total/$config_onlinelist);
$ba2=$ba*$config_onlinelist-$config_onlinelist;

echo '<br><hr>Страницы:';
$asd=$start-($config_onlinelist*3);
$asd2=$start+($config_onlinelist*4);

if($asd<$total && $asd>0){echo ' <a href="online.php?start=0&amp;list='.$list.'&amp;'.SID.'">1</a> ... ';}

for($i=$asd; $i<$asd2;){
	
if($i<$total && $i>=0){
	
$ii=floor(1+$i/$config_onlinelist);

if ($start==$i) {
echo ' <b>('.$ii.')</b>';
} else {
echo ' <a href="online.php?start='.$i.'&amp;list='.$list.'&amp;'.SID.'">'.$ii.'</a>';
}}

$i=$i+$config_onlinelist;}
if($asd2<$total){echo ' ... <a href="online.php?start='.$ba2.'&amp;list='.$list.'&amp;'.SID.'">'.$ba.'</a>';}
}


if($list!="full"){
echo'<br><br><img src="../images/img/chat.gif" alt=""> <a href="online.php?list=full&amp;'.SID.'">Показать гостей</a><br>';
} else {
echo'<br><br><img src="../images/img/chat.gif" alt=""> <a href="online.php?'.SID.'">Cкрыть гостей</a><br>';} 

echo'<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a><br>';
include_once "../themes/$config_themes/foot.php";
?>