View file games/vendors.php

File size: 2.16Kb
<?
define('SECURED', true);
include 'ini.php';
include 'inc/func_validate.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';
$vendor=val($_GET['name']);
$set['title']='Игры от '.$vendor.'';
include_once '../sys/inc/thead.php';
title();
err();
aut();

$base_url=$_SERVER['PHP_SELF']."?name=$_GET[name]";
$num_items=mysql_result(mysql_query("select count(id) from `games` where `vendor`='$vendor';"),0);
$pages = ceil($num_items/$config['files_on_page']);
if(!empty($_REQUEST['page']))
{
	$page = intval($_REQUEST['page']);
	if($page<=0) $page=1; 
	if($page>=$pages) $page=$pages; 
} else
{
	$page = 1;
}
$start = $page * $config['files_on_page'] - $config['files_on_page'];

$max=$start+$config['files_on_page'];
if($max>$num_items) $max=$num_items;
$total_files = $start + 1;
if($num_items==0) $total_files=0;
echo '<div class="menu"><b>Игры '.$total_files.'-'.$max.' из '.$num_items.'</b></div><div class="menu">';

echo'';

$q=mysql_query("select * from `games` where `vendor`='$vendor' order by `added` desc limit $start,".$config['files_on_page'].";");
while($game=mysql_fetch_array($q))
{
	list($cat_name)=mysql_fetch_array(mysql_query("select `name` from `categorys` where `id`='".$game['cat_id']."';"));
	echo' • ';
	echo' <a href="game.php?ID='.$game['id'].'">'.$game['name'].'</a> [скачано: '.$game['downloads'].']<br/>';
	echo 'Добавлен: '.date("d-m-Y, H:i",$game['added']).'<br/>';
	echo 'Категория: <a href="/games/index.php?ID='.$game['cat_id'].'">'.$cat_name.'</a><br/>';
}
	echo '</div>';
echo pages($base_url, $pages, $page);



echo'<div class="menu">&#171;&#160;<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';
?>