Размер файла: 3.41Kb
<?
define('SECURED', true);
include 'ini.php';
include 'inc/func_pages.php';
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$id=intval($_GET['ID']);
$game=mysql_fetch_array(mysql_query("select * from `games` where `id`='$id';"));
$category=mysql_fetch_array(mysql_query("select * from `categorys` where `id`='$game[cat_id]';"));
$set['title']=''.$game['name'].'';
include_once '../sys/inc/thead.php';
title();
err();
aut();
echo '<div class="menu">Категория: <a href="index.php?ID='.$category['id'].'">'.$category['name'].'</a></div>';
if($_GET['rate']=='plus' || $_GET['rate']=='minus')
{
$ips = explode("|",$game['raters']);
if (in_array($_SERVER['REMOTE_ADDR'] ,$ips) === false)
{
if(empty($game['raters'])) $ipp = $_SERVER['REMOTE_ADDR']; else $ipp = $game['raters']."|".$_SERVER['REMOTE_ADDR'];
if($_GET['rate']=='minus') $str = "UPDATE `games` SET `neg_rating`=`neg_rating`+1, `raters`='".$ipp."' WHERE `id` = '$id';";
if($_GET['rate']=='plus') $str = "UPDATE `games` SET `pos_rating`=`pos_rating`+1,`raters`='".$ipp."' WHERE `id` = '$id';";
mysql_query($str);
$game=mysql_fetch_array(mysql_query("select * from `games` where `id`='$id';"));
echo '<div class="menu"><b>Спасибо, ваш голос учтен!</b></div>';
}
else echo '<div class="menu"><b>Вы уже голосовали за этот файл.</b></div>';
}
if(!empty($game['screenshot'])) echo'<img src="'.$game['screenshot'].'" alt="'.$config['site'].'"/><br/>';
echo '<div class="menu">Производитель: <a href="vendors.php?name='.$game['vendor'].'">'.$game['vendor'].'</a></div><div class="body">';
$game['description']=str_replace("\r\n",'<br/>',$game['description']);
$game['description']=str_replace("\n",'<br/>',$game['description']);
echo $game['description'];
$comments=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '3' AND `id_razdel` = '21' AND `id_them` = '$game[forum]'"),0);
$obs='<a href="../forum/3/21/'.$game['forum'].'/">Обсудить</a>';
$comm='['.$comments.']';
if ($game['forum']==0)$obs=NULL;
if ($comments==0)$comm=NULL;
echo'</div><div class="menu">';
$q=mysql_query("select * from `files` where `game_id`='".$game['id']."' order by `position`;");
while($file=mysql_fetch_array($q))
{
echo '• <a href="download.php?ID='.$file['id'].'">'.$file['description'].'</a> ['.$file['size'].' Кб] (<a href="download.php?ID='.$file['id'].'&jad=true">jad</a>)<br/>';
}
echo'</div>Скачиваний: '.$game['downloads'].'<br/>';
echo'Рейтинг: <span class="on"><b>'.$game['pos_rating'].'</b></span>/<span class="off">'.$game['neg_rating'].'</span><br/>Голосовать: (<a href="game.php?ID='.$game['id'].'&rate=plus"><span class="on">+</span></a>/<a href="game.php?ID='.$game['id'].'&rate=minus"><span class="off">-</span></a>)<div class="menu">'.$obs.' '.$comm.'';
echo '</div><div class="menu">« <a href="/games/">Назад</a></div>';
if (($link=file("".$config['count']."")) == true) {
$LinkCount=count($link);
$NL=rand(0, $LinkCount-1);
echo $link[$NL];
}
include_once '../sys/inc/tfoot.php';
?>