View file pages/about.php

File size: 17.34Kb
<?php

$title='Информация о пользователе';


//функция определения времени на сайте
function makestime($string) { $day = floor($string / 86400);  $hours = floor(($string / 3600) - $day * 24);  $min = floor(($string - $hours * 3600 - $day * 86400) / 60);  $sec = $string - ($min * 60 + $hours * 3600 + $day * 86400); return sprintf("%01d дн. %02d:%02d:%02d", $day, $hours, $min, $sec); }

require"../system/config.php";
require"../system/functions.php";
require"../system/head.php";
require"../system/error.php";
//System BOTT

switch($mod){

//Главная анкеты
default:
echo'<div class="i">Информация о нике<br></div>';


echo'<div class="p">';
if(isset($_GET['id'])){$id=prov($_GET['id']);}else{$id='';}
$infuz=mysql_query("select * from users where id_user='$id' limit 1");
if(mysql_num_rows($infuz)==0){
echo'Ошибка! Пользователь не найден!<br></div>';
}else{
$uzin=mysql_fetch_array($infuz);
if(empty($uzin['age'])){$uzin['age']='Не указано';}if(empty($uzin['name'])){$uzin['name']='Не указано';}
if(empty($uzin['surname'])){$uzin['surname']='Не указано';}

if(empty($uzin['gorod'])){$uzin['gorod']='Не указано';}
if(empty($uzin['phone'])){$uzin['phone']='Не указано';}
if(empty($uzin['operator'])){$uzin['operator']='Не указано';}
if(empty($uzin['icq'])){$uzin['icq']='Не указано';}
if(empty($uzin['about'])){$uzin['about']='Не указано';}
if($uzin['pol']==0){$uzin['pol']='Мужской';}elseif($uzin['pol']==1){$uzin['pol']='Женский';}else{$uzin['pol']='Не указано';}
if($uzin['balls']<5){$uzbs='Прохожий';}
if($uzin['balls']>=5 and $uzin['balls']<10){$uzbs='Гость';}
if($uzin['balls']>=10 and $uzin['balls']<50){$uzbs='Новичёк';}
if($uzin['balls']>=50 and $uzin['balls']<100){$uzbs='Ученик';}
if($uzin['balls']>=100 and $uzin['balls']<150){$uzbs='Любитель';}
if($uzin['balls']>=150 and $uzin['balls']<300){$uzbs='Местный';}
if($uzin['balls']>=300 and $uzin['balls']<500){$uzbs='Продвинутый';}
if($uzin['balls']>=500 and $uzin['balls']<700){$uzbs='Мастер';}
if($uzin['balls']>=700 and $uzin['balls']<1000){$uzbs='Гений';}
if($uzin['balls']>=1000 and $uzin['balls']<1500){$uzbs='Ветеран';}
if($uzin['balls']>=1500){$uzbs='Легенда';}
$photuz=mysql_result(mysql_query("SELECT COUNT(*) FROM `photos` WHERE `id_user`='".$uzin['id_user']."' AND `type`='file'"),0);
echo'<div class="p"> '.nik_one($uzin['id_user']).' [ID: '.$uzin['id_user'].']<br>';
if($uzin['online']>(time()-120)){echo'Сейчас: <font color="green">На сайте</font></div>';}else{echo'Последний раз был: '.$uzin['ldate'].'</div>';}
#Если забанен#
$uzbanned=mysql_query("select * from banned where id_user='".$uzin['id_user']."' order by id_ban desc limit 1");
if(mysql_num_rows($uzbanned)!=0){
$banned=mysql_fetch_array($uzbanned);
if($banned['srok']==0 or ($banned['timer']+$banned['srok'])>time()){
echo'<font color="red">Забанен до ';
if($banned['srok']==0){
echo'отмены администрацией';
}else{
echo date('d.m.Y в H:i:s',$banned['timer']);
}
echo'</font><br>';
}
}
$stenau=mysql_result(mysql_query("SELECT COUNT(*) FROM `stena` WHERE `user_id`='$id'"),0); $totgrg=mysql_result(mysql_query("SELECT COUNT(*) FROM `groups` WHERE `id_user`='$id'"),0);
$totgrd=mysql_result(mysql_query("SELECT COUNT(*) FROM `groups_user` WHERE `id_user`='$id'"),0);

$cougr=$totgrg+$totgrd;
if(isset($uzin['age'])){
$explz=explode('.',$uzin['age']);
$coublog=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog` WHERE `id_user`='$id'"),0);
echo'Дата рождения: '.$uzin['age'].' '.v_zodiak($explz[0],$explz[1]);} echo'
Имя: '.$uzin['name'].'<br>
Фамилия: '.$uzin['surname'].'<br>
Пол: '.$uzin['pol'].'<div class="p">
<a href="about.php?mod=6&id_kogo='.$uzin['id_user'].'">Фотоальбом</a> ['.$photuz.']<br>
<a href="stena.php?yid='.$uzin['id_user'].'">Стена сообщений</a> ['.$stenau.']<br><a href="/blog/user/'.$uzin['id_user'].'/">Блоги</a> ['.$coublog.']<br><a href="/groups/user/'.$uzin['id_user'].'/">Группы</a> ['.$cougr.']</div>';
if($uzin['strana']==""){$strana='Не указано';}
if($uzin['strana']==1){$strana='Украина <img src="'.$dirsite.'/images/ukraine.gif" alt="">';}
if($uzin['strana']==2){$strana='Россия <img src="'.$dirsite.'/images/russia.gif" alt="">';}

echo'Страна: '.$strana.'
<br>Город: '.$uzin['gorod'].'<br>
<div class="p">

ICQ: '.$uzin['icq'].'<br>
Телефон: '.$uzin['phone'].'<br>
Оператор: '.$uzin['operator'].'<br></div>
О себе: '.vizual($uzin['about']).'<br>Посещений: '.$uzin['unsite'].'<br>Провел на сайте: '.makestime($uzin['onsite']).'<br>Баллов: '.$uzin['balls'];
$uzaadm=mysql_query("select * from system where name='admin' and value='".$uzin['id_user']."' limit 1");
if(mysql_num_rows($uzaadm)==1){echo'<br>Должность: <b>Администратор</b>';}
$uzamoder=mysql_query("select * from system where name='moder' and value='".$uzin['id_user']."' limit 1");
if(mysql_num_rows($uzamoder)==1){echo'<br>Должность: <b>Модератор</b>';}
$uzacre=mysql_query("select * from system where name='creater' and value='".$uzin['id_user']."' limit 1");
if(mysql_num_rows($uzacre)==1){echo'<br>Должность: <b>Король</b>';}
echo'<br>Статус: '.$uzbs.'<br>';
$sgol=mysql_query("select * from rating where type='user' and zakogo='".$uzin['id_user']."' and kto='$id_user' and `date`<'".(time()+86400)."' limit 1");
if($vhod==1 and mysql_num_rows($sgol)==0 and $id_user!=$uzin['id_user'] and $user['balls']>=50){
echo'<a href="/pages/raiting/'.$uzin['id_user'].'/">Рейтинг:</a> <a href="about.php?id_zako='.$uzin['id_user'].'&mod=1&znak=1">+</a>'.$uzin['prating'].'/<a href="about.php?id_zako='.$uzin['id_user'].'&mod=1">-</a>'.$uzin['mrating'].'<br>';
}else{echo'<a href="/pages/raiting/'.$uzin['id_user'].'/">Рейтинг:</a> +'.$uzin['prating'].'/-'.$uzin['mrating'].'<br>';}
echo'Дата реги: '.date('d.m.y в H:i',$uzin['dateregi']).'<div class="p"><img src="/design/default/act.gif" alt="-"> <a href="about.php?mod=5&id='.$uzin['id_user'].'">Актив на сайте</a></div>';

if($vhod==1 and $user['login']!=$uzin['login']){echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="post.php?mod=1&id_komu='.$uzin['id_user'].'">Написать в приват</a>';}

if($uzin['site']!='http://' and !empty($uzin['site'])){
echo'<img src="../design/default/act.gif" alt="-"> <a href="'.$uzin['site'].'">Перейти на сайт</a>';}}
echo'</div>'; if($vhod==1){if($adm_pr==4 or $adm_pr==3){echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="/mpanel/control.php?mod=20&id_izmo='.$uzin['id_user'].'">Редактировать</a></div>';} if($adm_pr==4 or $adm_pr==3 or
$adm_pr==2){echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="/mpanel/control.php?mod=38&id_user='.$uzin['id_user'].'">Забанить</a></div>';}}
echo'</div>';

break;
case'1': if(isset($_GET['id_zako'])){$id_zako=cifry($_GET['id_zako']);}else{$id_zako=0;}if(isset($_GET['znak'])){$znak=cifry($_GET['znak']);}else{$znak=0;}echo'<div class="i">Рейтинг<br></div>';
echo'<div class="p">';
if($vhod==1){
$infuz=mysql_query("select balls, id_user from users where id_user='$id_zako' limit 1");
if(mysql_num_rows($infuz)==0){
echo'Ошибка! Такого пользователя нет в системе!<br>';
}else{
$uzin=mysql_fetch_array($infuz);
$sgol=mysql_query("select * from rating where type='user' and zakogo='".$uzin['id_user']."' and kto='$id_user' limit 1");

$quie=mysql_num_rows(mysql_query("select * from rating where type='user' and zakogo='".$uzin['id_user']."' and kto='$id_user' and `date`<'".(time()+86400)."' limit 1"));
if(mysql_num_rows($sgol)==0 and $id_user!=$uzin['id_user'] and $user['balls']>=50){
if($quie==1){
echo'Ошибка! Вы сегодня уже изменяли рейтинг этого пользователя!<br>';
}else{ $kome=prov($_POST['kome'],300);
if(!empty($kome)){
if($znak==1){
mysql_query("update users set prating=prating+1 where id_user='$id_zako' limit 1");
mysql_query("insert into rating set type='user', zakogo='$id_zako', kto='$id_user', `komm`='$kome', `ocenka`='plus', `date`='".time()."'");
}else{
mysql_query("update users set mrating=mrating+1 where id_user='$id_zako' limit 1");
mysql_query("insert into rating set type='user', zakogo='$id_zako', kto='$id_user', `komm`='$kome', `ocenka`='minus', `date`='".time()."'");
}

echo'Рейтинг пользователя успешно изменен!<br>';
}else{echo'<form action="about.php?id_zako='.$id_zako.'&mod=1&znak=1" method="post">Комментарий<br><textarea cols="20" rows="3" name="kome" class="form"></textarea><br><input type="submit" class="but" value="Голосовать"/></form>
';}}
}else{
echo'Ошибка! Вы не можете изменить рейтинг этого пользователя!<br>';
}
}
}else{echo'Ошибка! Вы не авторизованы!<br>';}
echo'</div>';
break;
case'7': $id=(int)$_GET['id']; $quer=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `id_user`='$id' LIMIT 1")); if($quer==0){echo'Нет такого пользователя!';}else{ $total=mysql_result(mysql_query("SELECT COUNT(*) FROM `rating`
WHERE `zakogo`='$id' AND `type`='user'"),0);

$page = abs((int)$_GET['page']);

if($page < 0 || $page > $total) $page = 0;

if ($total < $page + 10) $end = $total;
else $end = $page + 10;
$query=mysql_query("SELECT * FROM `rating` WHERE `zakogo`='$id' AND `type`='user' ORDER BY `id_rat` DESC LIMIT $page,10"); if($total==0){echo'Нет голосов';}else{
while($data=mysql_fetch_array($query)){ if($data['ocenka']=='plus'){$ocenka=str_replace('plus','за',$data['ocenka']);  }else{$ocenka=str_replace('minus','против',$data['ocenka']); }echo'<div class="p"><b>Хто:</b> '.nik_two($data['kto']).'<br>'.date_fixed($data['date']).'<br>
'.vizual($data['komm']).'<br><b>Оценка:</b> '.$ocenka.'</div>'; }
strmpage($page, 10, $total,"/pages/raiting/$id/");}} break;
case'2':
echo'<div class="i">Фотки<br></div>';
if(isset($_GET['id_kogo'])){$id_kogo=cifry($_GET['id_kogo']);}else{$id_kogo=0;}
$prosm=mysql_query("select login from users where id_user='$id_kogo' limit 1");
$sucha=mysql_num_rows($prosm);
if($sucha==0){echo'<div class="p">Пользователь не найден...<br></div>';}else{

if(isset($_GET['id_cat'])){$id_cat=cifry($_GET['id_cat']);}else{$id_cat=0;}

$aphot=mysql_query("SELECT * FROM `photos` WHERE `id_user`='$id_kogo' AND `id_cat`='$id_cat' AND `type`='file'");
$page = abs((int)$_GET['page']);

if($page < 0 || $page > $total) $page = 0;

if ($total < $page + 10) $end = $total;
else $end = $page + 10;

$sphot=mysql_query("SELECT * FROM `photos` WHERE `id_user`='$id_kogo' AND `id_cat`='$id_cat' AND `type`='file' ORDER BY `id_photo` DESC LIMIT $page,10");
$total=mysql_num_rows($aphot);
if($total==0){
echo'<div class="p">
Сдесь покамисть нет фотографий<br>
</div>';
}else{
while($photo=mysql_fetch_array($sphot)){
$razmy=getimagesize('../photos/'.$photo['id_photo'].'_'.$id_kogo.'_'.$krsite.'.'.$photo['format']);
echo'<div class="p"><center><b>'.prov($photo['name']).'</b><br>
<img src="../photos/'.$photo['id_photo'].'_'.$id_kogo.'_'.$krsite.'.'.$photo['format'].'" width="70" height="90" alt="Скрин"></center>
Описание: '.vizual($photo['opis']).'<br>
Размеры: '.$razmy[1].'x'.$razmy[0].'<br>';
$sgol=mysql_query("select * from rating where type='photo' and zakogo='".$photo['id_photo']."' and kto='$id_user' limit 1");
if($vhod==1 and mysql_num_rows($sgol)==0 and $id_user!=$photo['id_user']){echo'Рейтинг: <a href="about.php?id_photo='.$photo['id_photo'].'&mod=3&znak=1">+</a>'.$photo['rplus'].'/<a href="about.php?id_photo='.$photo['id_photo'].'&
mod=3">-</a>'.$photo['rminus'].'<br>';}else{echo'Рейтинг: +'.$photo['rplus'].'/-'.$photo['rminus'].'<br>';}
echo'Скачали: '.$photo['loads'].'<br>
<a href="../photo/load.php?id_photo='.$photo['id_photo'].'">Скачать</a> ['.round((filesize('../photos/'.$photo['id_photo'].'_'.$id_kogo.'_'.$krsite.'.'.$photo['format']))/1024).'Кб]<br>';
$koments=mysql_num_rows(mysql_query("select * from koments where type='foto' and id_kogo='".$photo['id_photo']."'"));
echo'<a href="koments.php?id_wm='.$photo['id_photo'].'&type=foto&">Комментарии</a> ['.$koments.']<br>';
echo'</div>';
strpage($page, 10, $total, 'about.php','mod=2&id_cat='.$id_cat.'&&id_kogo='.$id_kogo.'amp;');
}}
}
break;

case'6':   if(isset($_GET['id_kogo'])){$id_kogo=cifry($_GET['id_kogo']);}else{$id_kogo=0;} $prosm=mysql_query("select login from users where id_user='$id_kogo' limit 1"); $such_uz=mysql_num_rows($prosm); if($such_uz==0){echo'<div class="p">Пользователь
не найден...<br></div>';}else{ echo'<div class="p">Категории:</div>';
$allgod=mysql_result(mysql_query("SELECT COUNT(*) FROM `photos` WHERE `id_user`='$id_kogo' AND `type`='cat'"),0);
if($allgod==0){echo'Не создано не одной категории'; }
$allrum=mysql_query("SELECT `id_cat`,`name`,`opis` FROM `photos` WHERE `id_user`='$id_kogo' AND `type`='cat'");
while($data=mysql_fetch_array($allrum)){
$kkk=$data['id_cat'];
$kolss=mysql_result(mysql_query("SELECT COUNT(*) FROM `photos` WHERE `id_user`='$id_kogo' AND `type`='file' AND `id_cat`='$kkk'"),0);
echo'<div class="p"><img src="/design/default/act.gif" alt="">
<a href="about.php?mod=2&id_cat='.$data['id_cat'].'&id_kogo='.$id_kogo.'">'.$data['name'].'</a> ['.$kolss[0].'] <br>'.vizual($data['opis']).'</div>';}}
break;

//Рейтинг +/- для фото
case'3':
if(isset($_GET['id_photo'])){$id_photo=cifry($_GET['id_photo']);}else{$id_photo=0;}
if(isset($_GET['znak'])){$znak=cifry($_GET['znak']);}else{$znak=0;}
echo'<div class="i">Рейтинг<br></div>';
echo'<div class="p">';
if($vhod==1){
$infuz=mysql_query("select * from photos where id_photo='$id_photo' limit 1");
if(mysql_num_rows($infuz)==0){
echo'Ошибка! Фото не существует!<br>';
}else{
$uzin=mysql_fetch_array($infuz);
$sgol=mysql_query("select * from rating where type='photo' and zakogo='$id_photo' and kto='$id_user' limit 1");
if(mysql_num_rows($sgol)==0 and $id_user!=$photo['id_user']){
if($znak==1){
mysql_query("update photos set rplus=rplus+1 where id_photo='$id_photo' limit 1");
}else{
mysql_query("update photos set rminus=rminus+1 where id_photo='$id_photo' limit 1");
}
mysql_query("insert into rating set type='photo', zakogo='$id_photo', kto='$id_user'");
echo'Рейтинг фото успешно изменен!<br>';
}else{
echo'Ошибка! Вы не можете изменить рейтинг этого фото!<br>';
}
}
}else{echo'Ошибка! Вы не авторизованы!<br>';}
echo'</div>';
break;

//Актив на сайте
case'5':
$id=(int)$_GET['id'];
if($id==0){echo'Fatal error';}else{
$prid=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `id_user`='$id' LIMIT 1"));
if($prid==0){echo'Нет такого пользователя';}else{
$dad=mysql_fetch_array(mysql_query("SELECT `login` FROM `users` WHERE `id_user`='$id' LIMIT 1"));
echo'<div class="i">Актив '.$dad['login'].'</div>';
$coufm=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_messages` WHERE `id_user`='$id'"),0);
$couft=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_themes` WHERE `id_user`='$id'"),0);
$cougd=mysql_result(mysql_query("SELECT COUNT(*) FROM `groups` WHERE `id_user`='$id'"),0); $coulib=mysql_result(mysql_query("SELECT COUNT(*) FROM `library` WHERE `id_user`='$id' AND `stat`='0'"),0);
$cougm=mysql_result(mysql_query("SELECT COUNT(*) FROM `groups_user` WHERE `id_user`='$id'"),0); $cougr=$cougm+$cougd;
$couchat=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_msg` WHERE `id_user`='$id'"),0);
$couobm=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmen_files` WHERE `avtor`='$id'"),0);
$coustol=mysql_result(mysql_query("SELECT COUNT(*) FROM `stol` WHERE `avtor`='$id'"),0); $coukomm=mysql_result(mysql_query("SELECT COUNT(*) FROM `koments` WHERE `id_user`='$id'"),0);
$coucodes=mysql_result(mysql_query("SELECT COUNT(*) FROM `codes_id` WHERE `id_user`='$id'"),0);
$coucred=mysql_fetch_assoc(mysql_query("SELECT `kolcred` FROM `users` WHERE `id_user`='$id'"));
$couscr=mysql_result(mysql_query("SELECT COUNT(*) FROM `load_files` WHERE `hto`='$id'"),0); $coublog=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog` WHERE `id_user`='$id'"),0);
echo'<div class="p">Сообщений в чате: <b>'.$couchat.'</b><div class="p">Сообщений в форуме: <b>'.$coufm.'</b><br>Тем в форуме: <b>'.$couft.'</b></div>Всего комментариев: <b>'.$coukomm.'</b><br>Заказов:
<b>'.$coustol.'</b><br>Кредитов в клубе: <b>'.$coucred['kolcred'].'</b><br>Добавил кодов: <b>'.$coucodes.'</b><br>Добавил в обменник: <a href="/obmen/user_files.php?id='.$id.'"><b>'.$couobm.'</b></a><br>Создал
блогов: <a href="/blog/user/'.$id.'/"><b>'.$coublog.'</b></a><br>Добавил скриптов: <b>'.$couscr.'</b><br>Создал групп: <b>'.$cougr.'</b><br>Выложил статей: <a href="/library/user/'.$id.'/"><b>'.$coulib.'</b></a><br>
</div>';
echo'<div class="p"><img src="/design/default/act.gif" alt=""> <a href="about.php?id='.$id.'">В анкету</a></div>';
}}}
require"../system/foot.php";
?>