Файл: www/theme/top_file.php
Строк: 27
<?php
include '../config.php';
div('TOP файлов');
$count=mysql_num_rows(mysql_query("SELECT * FROM `theme_file`"));
if(isset($aut)){
$st=30;
}else{
$st=10;}
$cp=ceil($count/$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 `theme_file` ORDER BY `load` DESC LIMIT $start,$st");
while($r=mysql_fetch_array($q)){
$n++;
if(is_integer($n/2)){
echo '<div class="msg2">';
}else{
echo '<div class="msg1">';}
$k=mysql_fetch_array(mysql_query("SELECT * FROM `theme_cat` WHERE `id`='$r[id_cat]'"));
if($r['type']==1)$type='Sony Ericsson';
if($r['type']==2)$type='Nokia';
$ex=pathinfo($r['file']);
$ext=strtolower($ex['extension']);
if($ext=='thm' and $r['type']==1)
echo '<img src="file_thm.php?fid='.$r['id'].'" width="40" height="60"></a><br/>';
if($ext=='nth' and $r['type']==2)
echo '<img src="file_nth.php?fid='.$r['id'].'" width="40" height="60"></a><br/>';
echo '<a href="/theme/f'.$r['id_cat'].'/">'.htmlspecialchars(stripslashes($k['name'])).'</a> » <a href="/theme/'.$r['type'].'/">'.$type.'</a><br/>Добавлена: ['.data($r['time']).']<br/>Размер: <br/>Скачана раз: '.$r['load'].'<br/><a href="/theme/go'.$r['id'].'/">Скачать</a>';
echo '</div>';}
navi($p,$cp,'top_file.php?');
echo '</div>';
include '../foot.php';
echo '</div>';
?>