Файл: www/android/new.php
Строк: 58
<?php
define('SECURED', true);
include 'ini.php';
include '../config.php';
div('Новинки');
$rid=intval($_GET['rid']);
$ntime = $time - (3600*24*$config['day_new']);
if(isset($_GET['rid'])){
$num_items=mysql_result(mysql_query("select count(id) from `games_and` where (`added` > '".$ntime."' or `two_added` > '".$ntime."') and `razd` = '$rid';"),0);
echo 'Новинок: '.$num_items.'<br/>';
if(!isset($aut)){
$st=10;
}else{
$st=30;}
$cp=ceil($num_items/$st);
if(isset($_GET['p']) and !empty($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp){
$p=intval($_GET['p']);
}else{
$p=1;}
$start=$p*$st-$st;
$q=mysql_query("select * from `games_and` where (`added` > '".$ntime."' or `two_added` > '".$ntime."') and `razd` = '$rid' order by `added` desc limit $start,$st");
while($game=mysql_fetch_array($q))
{
$n++;
if(is_integer($n/2)){
echo '<div class="msg2">';
}else{
echo '<div class="msg1">';}
$cat=mysql_fetch_array(mysql_query("select * from `categorys_and` where `id`='".$game['cat_id']."';"));
$titlee='Имя: <a href="/android/'.$game['id'].'/">'.$game['name'].'</a>';
$post="Категория: <a href='/android/cat/$cat[id]/'>$cat[name]</a><br/>Добавлено: ".data($game['added']).(empty($game['two_added'])?null:'<br/>Обновлено: '.data($game['two_added']));
echo $titlee.'<br/>'.$post.'</div>';
}
navi($p,$cp,'/android/new_ld/'.$rid.'/?');
echo '» <a href="/android/?rid='.$rid.'">Назад</a></div>';
}else{
echo '» <a href="/android/new/1/">Новинки Android (игры)</a> ['.mysql_result(mysql_query("select count(id) from `games_and` where (`added` > '".$ntime."' or `two_added` > '".$ntime."') and `razd` = '1';"),0).']<br/>';
echo '» <a href="/android/new/2/">Новинки Android (софт)</a> ['.mysql_result(mysql_query("select count(id) from `games_and` where (`added` > '".$ntime."' or `two_added` > '".$ntime."') and `razd` = '2';"),0).']<br/>';
}
echo '</div>';
include '../foot.php';
echo '</div>';
?>