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

Размер файла: 2.01Kb
<?
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']='Новинки Ява-игр!';
include_once '../sys/inc/thead.php';
title();
err();
aut();

$ntime = time() - (3600*24*$config['day_new2']);
$base_url=$_SERVER['PHP_SELF']."?";
$num_items=mysql_result(mysql_query("select count(id) from `games` where `added` > '".$ntime."';"),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">';
if($total_files==0) 
{
	echo 'За последний '.$config['day_new'].' день новых файлов не было<br/>';
}

$q=mysql_query("select * from `games` where `added` > '".$ntime."' 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' • <a href="game.php?ID='.$game['id'].'">'.$game['name'].'</a>';
	echo ' ['.date("d.m.y",$game['added']).']<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';
?>