View file modules/kabinet/guests_online.php

File size: 5.16Kb
<?php
########################################
##	           WAP-ENGINE             ##
########################################
##                                    ##
##  Автор : CHUMA (Токарев Владимир)  ##
##  e-mail : [email protected]     ##
##  WAP : http://wap-engine.ru        ##
##                                    ##
########################################
##         ВЫ НЕ ИМЕЕТЕ ПРАВО         ##
##        ИЗМЕНЯТЬ КОД СКРИПТА        ##
##  ДЛЯ ДАЛЬНЕЙШЕГО РАСПРОСТРАНЕНИЯ!  ##
########################################
include '../../config.php';
include '../../templates/run.php';
include '../../templates/func.php';
$title_page = 'Гости онлайн';
$m_polozhenie = 'Смотрит гостей онлайн';
include '../../themes/'.$themes.'.php';
####################
if ($portal=='off')
 {
  echo'<p align="center">'.$offmes.'</p>';
 }
if ($portal=='on')
 {
$users_f = file('../../data/ip_online.txt');
$users_count = count($users_f) - 1;
$kols = $kolusers;
$stranic = ceil($users_count/$kols);
$time = time();

echo"<p class=\"modul_name\"align=\"center\">Гости онлайн ($users_count)</p>";

if(empty($_GET['page']))
 {
  $page_get = 1;
 }
  else
 {
  $page_get = $_GET['page'];
 }
  
if($page_get > $stranic)
 {
  $page_get = $stranic;
 }
if($page_get < 1)
 {
  $page_get = 1;
 }
   
$do = $kols * ($page_get - 1);
$end = $kols * $page_get;

$page_nazad = $page_get - 1;
$page_dalee = $page_get + 1;

if (preg_match("#^[0-9]*$#", $page_get)) 
 {
  if($users_count == 0)
   {
    echo'<p class="b">Сейчас на сайте нет гостей.</p>';
   }
  for($i = $do; $i < $end; $i++)
   {
	if (!empty($users_f[$i]) && $i != 0)
     {
      $users_ff = explode('|', $users_f[$i]);      
      $activ = $time - $users_ff[2];
      $activ = floor($activ / 60);
      
      $guest_name = 'Гость';
      if($users_ff[1] == 'Yandex')
       { $guest_name = 'Yandex бот'; }
      if($users_ff[1] == 'Google')
       { $guest_name = 'Google бот'; }
      if($users_ff[1] == 'Rambler')
       { $guest_name = 'Rambler бот'; }
      if($users_ff[1] == 'Aport')
       { $guest_name = 'Aport бот'; }
      if($users_ff[1] == 'Yahoo')
       { $guest_name = 'Yahoo бот'; }
      if($users_ff[1] == 'msn')
       { $guest_name = 'Bing(MSN) бот'; }
      if($users_ff[1] == 'ia_archiver')
       { $guest_name = 'Alexa бот'; }
      if($users_ff[1] == 'Mail')
       { $guest_name = 'Mail бот'; }
      if($users_ff[1] == 'Teoma')
       { $guest_name = 'Ask бот'; }
      if($users_ff[1] == 'Lycos')
       { $guest_name = 'Lycos бот'; }
      if($users_ff[1] == 'WebAlta')
       { $guest_name = 'WebAlta бот'; }
      if($users_ff[1] == 'Scooter')
       { $guest_name = 'AltaVista бот'; }
      if($users_ff[1] == 'MLBot')
       { $guest_name = 'MLBot бот'; }
      if($users_ff[1] == 'Baidu')
       { $guest_name = 'Baidu бот'; }

if($users_ff[1] == 'Bing')
       { $guest_name = 'Bing бот'; }

	  echo'<p class="b">';
      echo"<img src=\"/themes/chuma/opros.gif\"alt=\"\"/> $guest_name";
      if($activ > 0)
       {
	    echo' неактивен '.$activ.' мин.';
	   }
	  $m_polozh = trim($users_ff[3]);
	  if(!empty($m_polozh))
       {
	    echo' ('.$m_polozh.')';
	   }
echo'<br /></p>';
if($status == "1" || $status == "2" || $status == "3")
{
echo'<p class="dy">';
	  echo'<font color="'.$color_red.'">'.$users_ff[1].' ['.$users_ff[0].']</font>';
echo'<br /></p>';
}
}
}
   
  if($stranic > 1)
   {
    echo '<p align="center" class="d">';
    echo 'Страницы:<br />';
    if($page_get > 4)
     {
      echo '<a href="guests_online.php?page=1&amp;'.session_name().'='.session_id().'">1</a>...';
     }
 
    $start_1 = $page_get - 3;
    $end_1 = $page_get - 1;
    if($start_1 < 1)
     {
      $start_1 = 1;
     }
  
    for($i = $start_1; $i <= $end_1; $i++)
     {
      echo'<a href="guests_online.php?page='.$i.'&amp;'.session_name().'='.session_id().'">'.$i.'</a> ';
     }

    echo"$page_get";

    $start_2 = $page_get + 1;
    $end_2 = $page_get + 3;
    if($start_2 < 1)
     {
      $start_2 = 1;
     }
    if($end_2 > $stranic)
     {
      $end_2 = $stranic;
     }
  
    for($i = $start_2; $i <= $end_2; $i++)
     {
      echo' <a href="guests_online.php?page='.$i.'&amp;'.session_name().'='.session_id().'">'.$i.'</a>';
     }

    if($stranic > $page_get && $page_get < ($stranic-3))
     {
      echo '...<a href="guests_online.php?page='.$stranic.'&amp;'.session_name().'='.session_id().'">'.$stranic.'</a>';
     }
    echo '<br />';

    if($page_get > 1)
     {
      echo '<a href="guests_online.php?page='.$page_nazad.'&amp;'.session_name().'='.session_id().'">Назад</a>';
     }
    echo ' | ';
    if($stranic > $page_get)
     {
      echo '<a href="guests_online.php?page='.$page_dalee.'&amp;'.session_name().'='.session_id().'">Дальше</a>';
     } 
    echo '<br /></p>';
   }
 }
  else
 {
  echo'<p align="center">Неправельный формат страницы!!!<br />';
 }
echo '<p><a href="index.php?'.session_name().'='.session_id().'">В кабинет</a></p>';
####################
}
include '../../templates/foot.php';
?>