File size: 6.65Kb
<?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';
$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($pod);
$pod_f = @file('../../data/users/'.$login_in.'_podarki.php');
$pod_count = count($pod_f);
for($i=2; $i < $pod_count - 2; $i++)
{
$pod[] = $pod_f[$i];
}
$users_on_f = file('../../data/user_online.txt');
$user_on_arr = implode('|', $users_on_f);
$pod_count = count($pod);
$kolmes = $kolusers;
$stranic = ceil($pod_count/$kolmes);
echo'<p class="modul_name"align="center">Ваши подарки ('.$pod_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($pod_count))
{
echo '<p class="b">У вас еще нет подарков.<br /></p>';
}
else
{
for($i = $do; $i < $end; $i++)
{
if (!empty($pod[$i]))
{
$i1 = $i+1;
$podar = explode('|', $pod[$i]);
$podarok1 = trim($podar[0]);
$podarok2 = trim($podar[1]);
$podarok3 = trim($podar[2]);
$podarok4 = trim($podar[3]);
user_data('../../data/users/'.$podarok1.'.php');
echo"<p class=\"b\">";
if(strstr($user_on_arr, '|'.$podarok1.'|'))
{
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=""/>';
}
}
}
else
{
if($pol == '1')
{
echo'<img src="/images/st/m_off.gif"alt=""/>';
}
elseif($pol == '0')
{
echo'<img src="/images/st/w_off.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 = ''.$podarok1.'';
}
echo" <a href=\"user_info.php?nick=$podarok1&".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=$podarok1&".session_name()."=".session_id()."\"><img src=\"/themes/chuma/1.gif\"align=\"top\"alt=\"\" title=\"Написать сообщение\"/></a>";}
if($icon_text == "0")
{
echo" <a href=\"send_privat.php?nick=$podarok1&".session_name()."=".session_id()."\">[ЛС]</a>";
}
echo"<br />($podarok4)<br /> $podarok3<br /> $podarok2<br />";
echo"</p>";
}
}
if($stranic > 1)
{
echo "<p align=\"center\" class=\"d\">";
echo "Страницы:";
echo "<br />";
if($page_get > 4)
{
echo "<a href=\"podarki.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=\"podarki.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=\"podarki.php?page=$i&".session_name()."=".session_id()."\">$i</a>";
}
if($stranic > $page_get && $page_get < ($stranic-3))
{
echo "...<a href=\"podarki.php?page=$stranic&".session_name()."=".session_id()."\">$stranic</a>";
}
echo "<br />";
if($page_get > 1)
{
echo "<a href=\"podarki.php?page=$page_nazad&".session_name()."=".session_id()."\">Назад</a>";
}
echo " | ";
if($stranic > $page_get)
{
echo "<a href=\"podarki.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=\"../shop/index.php?".session_name()."=".session_id()."\">В магазин</a><br /> <a href=\"index.php?".session_name()."=".session_id()."\">В кабинет</a><br /></p>";
####################
}
include ("../../templates/foot.php");
?>