View file include/user.php

File size: 8.39Kb
<?
$id = intval($_GET['id']);
$th = intval($_GET['th']);
if( !mysql_result(mysql_query("SELECT COUNT(*) FROM `rating` WHERE rat_user = $id AND `moder` = '$username'"), 0))
{
if(($status == "moderator" OR $status == "admin") AND !empty($_GET['rat']) AND $_GET['rat'] == 1)
		{
			mysql_query("UPDATE users
			             SET `rating`=`rating`+'".intval($_GET['rat'])."'
			             WHERE id=".$id);
			
			mysql_query("INSERT INTO `rating` VALUES(0, '".$username."', '".$id."', '+', ".time().")");
			header("Location: ".$_SERVER['PHP_SELF'].'?p=0&v='.$version.'&sid='.$sid.'&rnd='.$ref);
		}

if(($status == "moderator" OR $status == "admin") AND !empty($_GET['antirat'])  AND $_GET['antirat'] == 1)
{
			mysql_query("UPDATE users
			     SET `antirating` = `antirating` + '".intval($_GET['antirat'])."'
			     WHERE id=".$id);
			mysql_query("INSERT INTO `rating` VALUES(0, '".$username."', '".$id."', '-', ".time().")");
			header("Location: ".$_SERVER['PHP_SELF'].'?p=0&v='.$version.'&sid='.$sid.'&rnd='.$ref);
}
}
$query = mysql_query("SELECT * FROM users WHERE id=".$id);
$q = mysql_fetch_assoc($query);
$arruser = $q['username'];
	if(mysql_num_rows($query) < 1)
	{
		if($version == "wml")
		{
			header('Content-type: text/vnd.wap.wml; charset=utf-8');
			header("Cache-Control: no-cache");
			echo(doctype("Ошибка").$tag.'Пользователя не существует! <br />

<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">Форумы</a> '.$tagC.'
</p></card></wml>');
		} elseif($version == "xhtml")
		{
			header("Content-type: text/html; charset=utf-8");
			header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
			echo('<html>
<head>
<title>Ошибка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Ошибка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['text'].'">'.$tag.'
Пользователя не существует!
'.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?p=0&amp;v=xhtml&amp;sid='.$sid.'">Форумы</a> '.$tagC.'
</td></tr></table>
</body></html>');
		}
		exit;
	}
    else
	{
			if($version == "wml")
			{
				header('Content-type: text/vnd.wap.wml; charset=utf-8');
				header("Cache-Control: no-cache");
				echo(doctype("Анкета ".$arruser."").$tag);
				$photo=$q['photo'];
				
				$clban = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `username`='".$arruser."'"), 0);
				
			if(!empty($photo))
			{
			echo('<p align="center"><img src="http://'.$photo.'" alt="'.$arruser.'" /></p><br />');
			}
			if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`
	                      WHERE `username`='".$arruser."'
	                      AND `time` > UNIX_TIMESTAMP()"),0))
			{
			echo('<b>Пользователь заблокирован!</b><br />');
			}
			echo('<b>Рейтинг:</b> +'.$q['rating'].'/-' . $q['antirating'] . '<br />');
			echo('<b>Зарегистрирован:</b> '.date("d/m/y", $q['regdate']).'<br />');
			echo('<b>Нарушений:</b> '.$clban.'<br />');
			echo('<b>ID:</b> '.$q['id'].'<br />');
				echo(empty($q['realname']) ? '<b>Реальное имя:</b>' : '<b>Реальное имя:</b> '.$q['realname'].'<br />');
				if($q['sex'] == "m")
				{
					echo('<b>Пол:</b> М <br />');
				} elseif($q['sex'] == "f")
				{
					echo('<b>Пол:</b> Ж <br />');
				}
		echo(empty($q['rdate']) ? '<b>Дата рождения:</b>' : '<b>Дата рождения:</b> '.$q['rdate'].'<br />');
		echo(empty($q['mail']) ? '<b>E-mail:</b>' : '<b>E-mail:</b> '.$q['mail'].'<br />');
		echo(empty($q['icq']) ? '<b>ICQ:</b>' : '<b>ICQ:</b> '.$q['icq'].'<br />');
		echo(empty($q['site']) ? '<b>Сайт:</b>' : '<b>Сайт:</b> <a href="go/?http://'.$q['site'].'">http://'.$q['site'].'</a><br />');
		echo(empty($q['about']) ? '<b>О себе:</b>' : '<b>О себе:</b> '.$q['about'].'<br />');
		/*echo('Дата регистрации: '.date("d.m.Y H:i", $q['regdate']).' <br />
Визит: '.date('d.m.Y H:i:s', $q['last_time']).' <br />
Постов: '.mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `name`='".$q['username']."'"), 0).'<br />');*/
			} elseif($version == "xhtml")
			{
				header("Content-type: text/html; charset=utf-8");
				header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
				echo('<html>
<head>
<title>Анкета '.$arruser.'</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">');
echo('<tr><td align="center" bgcolor="'.$style['title'].'"  colspan="2">');
echo('<font color="#FFFFFF"><b>Анкета '.$arruser.'</b></font>');
echo('</td></tr>');
echo('<tr><td bgcolor="'.$style['bottom'].'" colspan="2">');
$clban = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `username`='".$arruser."'"), 0);
$photo=$q['photo'];
			if(!empty($photo))
			{
			echo('<p align="center"><img src="http://'.$photo.'" alt="'.$arruser.'" /></p>');
			}
echo('</td></tr>');
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`
	                      WHERE `username`='".$arruser."'
	                      AND `time` > UNIX_TIMESTAMP()"),0))
{
echo('<tr><td bgcolor="'.$style['text'].'" colspan="2">');
echo('<b>Пользователь заблокирован!</b>');
echo('</td></tr>');
}
echo('<tr bgcolor="'.$style['text'].'"><td>');
echo('Рейтинг:');
echo('</td><td>');
			echo('+'.$q['rating'].'/-' . $q['antirating'] . '');
			echo('</td></tr>');
			echo('<tr bgcolor="'.$style['text'].'"><td>');
			echo('Зарегистрирован:');
			echo('</td><td>');
			echo(date("d/m/y", $q['regdate']));
			echo('</td></tr>');
			echo('<tr bgcolor="'.$style['text'].'"><td>');
			echo('Нарушений:');
			echo('</td><td>');
			echo(''.$clban.'');
			echo('</td></tr>');
			echo('<tr bgcolor="'.$style['text'].'"><td>');
			echo('ID:');
			echo('</td><td>');
			echo(''.$q['id'].'');
			echo('</td></tr>');
				echo(empty($q['realname']) ? '<tr bgcolor="'.$style['text'].'" nowrap><td>Реальное имя:</td><td width="100%"></td></tr>' : '<tr bgcolor="'.$style['text'].'" nowrap><td>Реальное имя:</td><td width="100%">'.$q['realname'].'</td></tr>');
				if($q['sex'] == "m")
				{
					echo('<tr bgcolor="'.$style['text'].'"><td>Пол:</td><td>М</td></tr>');
				} elseif($q['sex'] == "f")
				{
					echo('<tr bgcolor="'.$style['text'].'"><td>Пол:</td><td>Ж</td></tr>');
				}
		echo(empty($q['rdate']) ? '<tr bgcolor="'.$style['text'].'"><td>Дата рождения:</td><td></td></tr>' : '<tr bgcolor="'.$style['text'].'"><td>Дата рождения:</td><td>'.$q['rdate'].'</td></tr>');
		echo(empty($q['mail']) ? '<tr bgcolor="'.$style['text'].'"><td>E-mail:</td><td></td></tr>' : '<tr bgcolor="'.$style['text'].'"><td>E-mail:</td><td>'.$q['mail'].'</td></tr>');
		echo(empty($q['icq']) ? '<tr bgcolor="'.$style['text'].'"><td>ICQ:</td><td></td></tr>' : '<tr bgcolor="'.$style['text'].'"><td>ICQ:</td><td>'.$q['icq'].'</td></tr>');
		echo(empty($q['site']) ? '<tr bgcolor="'.$style['text'].'"><td>Сайт:</td><td></td></tr>' : '<tr bgcolor="'.$style['text'].'"><td>Сайт:</td><td><a href="go/?http://'.$q['site'].'">http://'.$q['site'].'</a></td></tr>');
		echo(empty($q['about']) ? '<tr bgcolor="'.$style['text'].'"><td>О себе:</td><td></td></tr>' : '<tr bgcolor="'.$style['text'].'"><td>О себе:</td><td>'.$q['about'].'</td></tr>');
		/*echo('<tr bgcolor="'.$style['text'].'"><td>Дата регистрации:</td><td>'.date("d.m.Y H:i", $q['regdate']).'</td></tr>
				<tr bgcolor="'.$style['text'].'"><td>Визит:</td><td>'.date('d.m.Y H:i:s', $q['last_time']).'</td></tr>
				<tr bgcolor="'.$style['text'].'"><td>Постов:</td><td>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `name`='".$q['username']."'"), 0).'</td></tr>');*/
    }
		if($version == "wml")
		{
echo($tag.'<anchor>Назад<prev /></anchor>'.$tagC.'
</p></card></wml>');
		} elseif($version == "xhtml")
		{
	echo($tag);
	echo('<tr><td bgcolor="'.$style['bottom'].'"  colspan="2">');
echo('<a href="javascript:history.back(1)">Назад</a>'.$tagC.'
</td></tr></table>
</body></html>');
		}
		}
?>