Файл: vk.com_vhllam/sys/core/func.user.php
Строк: 559
<?
//////Автор OPPS (Kasell)////
/////Скрипт бесплатный //////
////Плтную версию можно купить vk.com/vhllam///
////Вывод кто есть кто, юзер,админ,модер
function group($user=NULL)
{
global $set,$time;
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user' AND (`time` > '$time' OR `navsegda` = '1')"), 0)!=0){
$ban = ' <img src="/style/user/ban.png" alt="" class="icon"/> ';
echo "$ban";
}else {
$ank = get_user($user);
if ($ank['group_access']>7){
if ($ank['pol']==1) $adm='<img src="/style/user/1.png" alt="" class="icon"/>';
else
$adm='<img src="/style/user/2.png" alt="" class="icon"/>';
echo "$adm";}
else
if ($ank['group_access']>1 && $ank['group_access']<=7)
{if ($ank['pol']==1)
$mod='<img src="/style/user/3.png" alt="" class="icon"/>';
else
$mod='<img src="/style/user/4.png" alt="" class="icon"/>';
echo "$mod";}
else
if(isset ($ank['status'])==0)
{if ($ank['pol']==1) $user='<img src="/style/user/5.png" alt="" class="icon"/>';
else
$user='<img src="/style/user/6.png" alt="" class="icon"/>';
echo "$user";}
}
}
//Вывод флажка,города,страны
function city($user=NULL)
{
global $set;
static $users;
$ank=get_user($user);
if ($ank['ank_city']!=0){
$city=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `id`='$ank[ank_city]' LIMIT 1"));
$region=mysql_fetch_array(mysql_query("SELECT * FROM `region` WHERE `id`='$city[region]' LIMIT 1"));
$country=mysql_fetch_array(mysql_query("SELECT * FROM `country` WHERE `id`='$city[country]' LIMIT 1"));
return "<img src='/style/flags/$country[ico].gif' alt='*' class='icon'/> $country[name], $city[name] ($region[name])";
}
}
function ankcity($user=NULL)
{
global $set;
static $users;
$ank=get_user($user);
if ($ank['ank_city']!=0){
$city=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `id`='$ank[ank_city]' LIMIT 1"));
$country=mysql_fetch_array(mysql_query("SELECT * FROM `country` WHERE `id`='$city[country]' LIMIT 1"));
return "<img src='/style/flags/$country[ico].gif' alt='*' class='icon'/> $city[name] ($country[name])";
}
}
function oncity($user=NULL)
{
global $set;
static $users;
$ank=get_user($user);
if ($ank['ank_city']!=0){
$city=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `id`='$ank[ank_city]' LIMIT 1"));
$country=mysql_fetch_array(mysql_query("SELECT * FROM `country` WHERE `id`='$city[country]' LIMIT 1"));
return "<img src='/style/flags/$country[ico].gif' alt='*' class='icon'/> $city[name]";
}
}
function flags($user=NULL)
{
global $set;
static $users;
$ank=get_user($user);
if ($ank['ank_city']!=0){
$city=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `id`='$ank[ank_city]' LIMIT 1"));
$country=mysql_fetch_array(mysql_query("SELECT * FROM `country` WHERE `id`='$city[country]' LIMIT 1"));
return "<img src='/style/flags/$country[ico].gif' alt='*' class='icon'/>";
}
}
///Медальки
function medal($user=NULL)
{
$ank = get_user($user);
///// Рейтинг за активность
if ($ank['rating']>=9 && $ank['rating']<=19){echo " <img src='/style/medal/1.gif' alt=''/>";}
if ($ank['rating']>=20 && $ank['rating']<=39){echo " <img src='/style/medal/2.gif' alt=''/>";}
if ($ank['rating']>=40&& $ank['rating']<=27987756){echo " <img src='/style/medal/3.gif' alt=''/>";}
///Мини иконка клана
$us = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '$ank[id]' LIMIT 1"));
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '$us[id_clan]' LIMIT 1"));
if (mysql_result(mysql_query("SELECT COUNT(id) FROM `clan_user` where `id_user` = '$ank[id]' AND `activaty` = '0' LIMIT 1"),0)==1){
if(is_file(H.'files/klanico/'.$clan['id'].'.jpg')){
echo ' <img src="/files/klanico/'.$clan['id'].'.jpg" alt=""/>';
}
else
{
echo ' <img src="/files/klan/0.png" width="12" height="12" alt=""/>';
}
}
}
//С чего сидим
function online($user=NULL)
{
global $set,$time;
static $users;
if (!isset($users[$user]))
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$user' AND `date_last` > '".(time()-3000)."' LIMIT 1"),0)==1)
{
if ($set['show_away']==0)$on='online';
else
{
$ank=mysql_fetch_assoc(mysql_query("SELECT `date_last` FROM `user` WHERE `id` = '$user' LIMIT 1"));
if ((time()-$ank['date_last'])==0)
$on='online';
else
$on='away: '.(time()-$ank['date_last']).' сек';
}
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$user' LIMIT 1"));
if ($ank['browser']=='wap')
$users[$user]= " <img src='/style/icons/online.gif' alt='*' /> ";
else
$users[$user]= " <img src='/style/icons/online_web.gif' alt='*' /> ";
}
else
{
$users[$user]=null;
}
}
return $users[$user];
}
//Закрытый профиль
function close_str($id)
{
global $set;
global $user;
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='$id' LIMIT 1"));
if ($ank['close'] != 0 && !user_access('adm_panel_show'))
{
header('Location: /close.profill.php?id=' . $ank['id']);
exit;
}
}
///Листание страниц
function page($k_page=1){ // Выдает текущую страницу
$page=1;
if (isset($_GET['p'])){
if ($_GET['p']=='end')$page=intval($k_page);elseif(is_numeric($_GET['p'])) $page=intval($_GET['p']);}
if ($page<1)$page=1;
if ($page>$k_page)$page=$k_page;
return $page;}
function k_page($k_post=0,$k_p_str=10){ // Высчитывает количество страниц
if ($k_post!=0){$v_pages=ceil($k_post/$k_p_str);return $v_pages;}
else return 1;}
function str($link='?',$k_page=1,$page=1){ // Вывод номеров страниц (только на первый взгляд кажется сложно ;))
?>
<style>
.pagination a.prev span,.pagination a.next span {
color:#069;
}
.pagination a {
text-decoration:none;
}
.pagination .pagination_ar .page {
color:#06F;
}
.pagination {
background: #f5f5f5;
padding:2px 1px;
border-left:1px solid #B3B3B3;
border-right:1px solid #B3B3B3;
}
.page_links input.page_choose,.pagination a.prev,.pagination a.next,.pagination .page_links,.pagination .page_links a {
color:#666;
}
.pagination a.prev span,.pagination a.next span {
text-decoration:underline;
}
.pagination .pagination_ar .page {
background:#f5f5f5
}
.pagination a.prev:hover span,.pagination a.next:hover span,.pagination .pagination_ar .page:hover {
color:red;
}
.pagination_ar {
margin-bottom: 1px;
font-size:0
}
.pagination .page_links,.pagination .page_links a {
vertical-align:baseline
}
.pagination .page_links a,.pagination .page_links .current,.page_links input.page_choose {
margin:0 0px 0px 0;
-webkit-border-radius: 2px;
border-radius: 1px
}
.pagination .page_links a,.page_num_input,.pagination .page_links i,.pagination .page_links .current,.page_links input.page_choose, .pagination_ar a,.pagination_ar .page {
font-size:medium;
}
.pagination_ar .page {
font-size:small;
}
.page_num_input {
width:15px;
padding:2px 0;
margin:0;
background:#fff url(http://i.spaces.ru/pagination_page_num_input.png) left top repeat-x;
}
.pagination .pagination_ar .page {
padding:0;
}
.pagination .pagination_ar .page {
margin:0;
}
.pagination {
border-bottom:1px solid #b3b3b3;
}
.text_input {
background:#fff url(http://i.spaces.ru/pagination_page_num_input.png) left top repeat-x;
}
.pagination .pagination_ar .page {
border:none
}
.pagination_ar,.page_links {
_font-size:medium;
}
.pagination .page_links,.pagination .page_links a {
vertical-align:baseline
}
.page_links a,.page_links input.page_choose,button.custom_button {
display:inline-block;
background:#fefefe;
background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#e6e6e6));
background:-moz-linear-gradient(top,#fefefe,#e6e6e6);
background:-o-linear-gradient(top,#fefefe,#e6e6e6);
padding:1px;
border:1px solid #cdcdcd
}
.page_links input.page_choose {
padding:1px 1px
}
.page_links a:hover,.page_links input.page_choose:hover {
background:#fefefe;
background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#d0d0d0));
background:-moz-linear-gradient(top,#fefefe,#d0d0d0);
background:-o-linear-gradient(top,#fefefe,#d0d0d0);
}
.page_links a:active,.page_links input.page_choose:active {
background:#d0d0d0;
background:-webkit-gradient(linear,left top,left bottom,from(#d0d0d0),to(#fefefe));
background:-moz-linear-gradient(top,#d0d0d0,#fefefe);
background:-o-linear-gradient(top,#d0d0d0,#fefefe);
}
.page_links .separate {
padding:1px 1px
}
.small_screen .page_links .search_page_block {
padding:1px 1px 1px 0
}
.page_links .current,input[type= "submit"].main_submit,input[type="submit"].green_button,.white,input[type="submit"].positive_button {
color:#fff
}
.search_page_block i,.page_links .current,.busi,.page_is,div.block {
padding:1px
}
.page_links,.font0 {
font-size:0
}
.page_links i {
padding:0 1px
}
.page_links .current {
background:#686868;
background:-webkit-gradient(linear,left top,left bottom,from(#686868),to(#adadad));
background:-moz-linear-gradient(top,#686868,#adadad);
background:-o-linear-gradient(top,#686868,#adadad);
border:1px solid #737373
}
.pagination_ar,.page_links {
_font-size:medium;
}
.page_links a:hover {
_text-decoration:none;
_background:#fefefe;
}
.page_links .current {
_color:#fff;
}
.page_links a:hover, .page_links input.page_choose:hover, button.custom_button:hover {
background: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#d0d0d0));
}
.page_links a:active, .page_links input.page_choose:active, button.custom_button:active {
background:-webkit-gradient(linear,left top,left bottom,from(#d0d0d0),to(#fefefe));
}
.round_corners, .busi_switcher table a, .busi_switcher table span.active_item, .button_block input, .form_button, .friends_access_list, input[type="submit"].main_submit, input[type="submit"].green_button, .edit_button {
-webkit-border-radius: 1px;
border-radius: 1px;
}
.go {
border: 1px solid #a0a0a0;
text-shadow: 1px 1px 0 #fff;
padding: 1px 1px;
margin: 0;
}
.go:hover {
background:#fefefe;
background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#d0d0d0));
background:-moz-linear-gradient(top,#fefefe,#d0d0d0);
background:-o-linear-gradient(top,#fefefe,#d0d0d0);
}
.go:active {
background:#d0d0d0;
background:-webkit-gradient(linear,left top,left bottom,from(#d0d0d0),to(#fefefe));
background:-moz-linear-gradient(top,#d0d0d0,#fefefe);
background:-o-linear-gradient(top,#d0d0d0,#fefefe);
}
.go {
background: #fefefe;
background: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#e6e6e6));
background: -moz-linear-gradient(top,#fefefe,#e6e6e6);
background: -o-linear-gradient(top,#fefefe,#e6e6e6);
font-size:medium;
border:1px solid #a0a0a0;
text-shadow:1px 1px 0 #fff;
padding:1px 1px;
margin-left: 1px;
-webkit-border-radius:4px;
border-radius:1px;
cursor: pointer;
}
.separate_links_item {
border-left: 1px solid #CCC;
margin: 0 4px;
}
</style>
<?
if ($page<1)$page=1;
echo '<form method="get" action="'.$link.'" style="background: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;">';
echo "<div class='pagination'>n";
echo "<div style='pagination_ar'>n";
if ($page>1)echo "<a href='".$link."p=".($page-1)."' class='prev'><span>← Предыдущая</span></a>n";
if ($page<$k_page)echo ($page>1?"<i class='separate_links_item'></i>":NULL)."<a href='".$link."p=".($page+1)."' class='next'><span>Следующая →</span></a>n";
echo "</div>n";
echo "<div class='page_links'>n";
if ($page!=1)echo "<a href='".$link."p=1'><span> 1 </span></a><i></i>n";
else echo "<span class='current'><span> 1 </span></span><i></i>n";
for ($ot=-3; $ot<=3; $ot++){
if ($page+$ot>1 && $page+$ot<$k_page){
if ($ot==-3 && $page+$ot>2)echo " ..";
if ($ot!=0)echo "<a href='".$link."p=".($page+$ot)."'><span> ".($page+$ot)." </span></a><i></i>n";
else echo "<span class='current'><span> ".($page+$ot)." </span></span><i></i>n";
if ($ot==3 && $page+$ot<$k_page-1)echo " ..";}}
if ($page!=$k_page)echo "<a href='".$link."p=end'><span> $k_page </span></a><i></i>n";
elseif ($k_page>1)echo "<span class='current'><span> $k_page </span></span></a><i></i>n";
?>
<span class="wrap_page_num_input">
<input name="page" size="3" style="-wap-input-format:'5N'" maxlength="5" value="" class="page_num_input" />
</span>
<input type="submit" value="GO" class="go" />
</span>
<?
echo "</div>n";
echo "</div>n";
echo '</form>';
}
?>