Просмотр файла games/top.php

Размер файла: 1.67Kb
<?
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';
$set['title']='ТОП-100 игр';
include_once '../sys/inc/thead.php';
title();
err();
aut();
echo'<div class="menu">';
$base_url=$_SERVER['PHP_SELF']."?";
$num_items=mysql_result(mysql_query("select count(id) from `games`;"),0);
if($num_items>100) $num_items=100;
$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'];

$q=mysql_query("select * from `games` order by `downloads` 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'].'&amp;'.SID.'">'.$game['name'].'</a> [скачано: '.$game['downloads'].']<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';
?>