File size: 6.2Kb
<?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 = 'Ваши друзья online';
$m_polozhenie = 'Смотрит список друзей онлайн';
include '../../themes/'.$themes.'.php';
$passw_in = $passw;
$login_in = $login;
$status_in = $status;
####################
if ($portal=='off')
{
echo'<p align="center">'.$offmes.'</p>';
}
if ($portal=='on')
{
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in)
{
unset($friends);
$friends_f = @file('../../data/users/'.$login_in.'_friends.php');
$friends_count = count($friends_f);
for($i=2; $i < $friends_count - 2; $i++)
{
$friends[] = $friends_f[$i];
}
$users_on_f = file('../../data/user_online.txt');
$users_on_count = count($users_on_f);
for($i=0; $i <= $users_on_count; $i++)
{
$users_on_exp = explode('|', $users_on_f[$i]);
$user_on_arr[] = $users_on_exp[0];
}
$user_on_str = implode('|', $user_on_arr);
$fr_count = count($friends);
for($i=0; $i <= $fr_count; $i++)
{
if(@strstr($user_on_str, trim($friends[$i])))
{
$friends_online[] = $friends[$i];
}
}
$fr_count = count($friends_online);
$kolmes = $kolusers;
$stranic = ceil($fr_count/$kolmes);
echo'<p class="modul_name"align="center">Ваши друзья online ('.$fr_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 = $kolmes * ($page_get - 1);
$end = $kolmes * $page_get;
$page_nazad = $page_get - 1;
$page_dalee = $page_get + 1;
if (preg_match("#^[0-9]*$#", $page_get))
{
if(empty($fr_count))
{
echo "<p class=\"b\">Сейчас нет на сайте ваших друзей online.<br /></p>";
}
else
{
for($i = $do; $i < $end; $i++)
{
if (!empty($friends_online[$i]))
{
$i1 = $i+1;
user_data('../../data/users/'.trim($friends_online[$i]).'.php');
echo"<p class=\"b\">";
if($pol == '1')
{
if($status == '5')
{
echo'<img src="/images/st/m_nov.gif"alt=""/>';
}
elseif($status == '4')
{
echo'<img src="/images/st/m.gif"alt=""/>';
}
elseif($status == '3')
{
echo'<img src="/images/st/mod_m.gif"alt=""/>';
}
elseif($status == '2')
{
echo'<img src="/images/st/gmod_m.gif"alt=""/>';
}
elseif($status == '1')
{
echo'<img src="/images/st/admin_m.gif"alt=""/>';
}
}
elseif($pol == '0')
{
if($status == '5')
{
echo'<img src="/images/st/w_nov.gif"alt=""/>';
}
elseif($status == '4')
{
echo'<img src="/images/st/w.gif"alt=""/>';
}
elseif($status == '3')
{
echo'<img src="/images/st/mod_w.gif"alt=""/>';
}
elseif($status == '2')
{
echo'<img src="/images/st/gmod_w.gif"alt=""/>';
}
elseif($status == '1')
{
echo'<img src="/images/st/admin_w.gif"alt=""/>';
}
}
$nick_name_arr = explode('::', $nickname);
$nickname = $nick_name_arr[0];
$nickcolor = $nick_name_arr[1];
if(!empty($nickname))
{
if(!empty($nickcolor))
{
$login_nick_color = '<font color="'.$nickcolor.'">'.$nickname.'</font>';
}
else
{
$login_nick_color = ''.$nickname.'';
}
}
else
{
$login_nick_color = ''.$friends_online[$i].'';
}
echo" <a href=\"user_info.php?nick=$friends_online[$i]&".session_name()."=".session_id()."\">$login_nick_color</a> ";
if($rating >= $kolbronza && $rating <= $kolserebro)
{
echo'<img src="/images/st/bronza.gif"alt=""/>';
}
if($rating >= $kolserebro && $rating <= $kolzoloto)
{
echo'<img src="/images/st/serebro.gif"alt=""/>';
}
if($rating >= $kolzoloto)
{
echo'<img src="/images/st/zoloto.gif"alt=""/>';
}
if($icon_text == "1" || $icon_text == "")
{
echo" <a href=\"send_privat.php?nick=$friends_online[$i]&".session_name()."=".session_id()."\"><img src=\"/themes/chuma/1.gif\"align=\"top\"alt=\"\" title=\"Написать сообщение\"/></a><br />";}
if($icon_text == "")
{
echo" <a href=\"send_privat.php?nick=$friends_online[$i]&".session_name()."=".session_id()."\">[ЛС]</a><br />";
}
echo"</p>";
}
}
if($stranic > 1)
{
echo "<p align=\"center\" class=\"d\">";
echo "Страницы:";
echo "<br />";
if($page_get > 4)
{
echo "<a href=\"friends_online.php?page=1&".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=\"friends_online.php?page=$i&".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=\"friends_online.php?page=$i&".session_name()."=".session_id()."\">$i</a>";
}
if($stranic > $page_get && $page_get < ($stranic-3))
{
echo "...<a href=\"friends_online.php?page=$stranic&".session_name()."=".session_id()."\">$stranic</a>";
}
echo "<br />";
if($page_get > 1)
{
echo "<a href=\"friends_online.php?page=$page_nazad&".session_name()."=".session_id()."\">Назад</a>";
}
echo " | ";
if($stranic > $page_get)
{
echo "<a href=\"friends_online.php?page=$page_dalee&".session_name()."=".session_id()."\">Дальше</a>";
}
echo "<br />";
echo "</p>";
}
}
}
else
{
echo"<p align=\"center\">Неправельный формат страницы!!!<br />";
}
}
else
{
echo"<p class=\"b\">Вы не авторизованы!!! Войдите в личный кабинет.<br /></p>";
}
echo"<p><a href=\"friends.php?".session_name()."=".session_id()."\">Все друзья</a><br />
<a href=\"index.php?".session_name()."=".session_id()."\">В кабинет</a><br /></p>";
####################
}
include '../../templates/foot.php';
?>