Просмотр файла obmen/top_raiting.php

Размер файла: 1.97Kb
<?php

$title='Топ файлов';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
echo'<div class="i">'.$title.'<br></div>';
$num=10;
$total=mysql_result(mysql_query("select count(*) from obmen_files limit 50"),0);
$page = abs((int)$_GET['page']);

if($page < 0 || $page > $total) $page = 0;
if ($total < $page + 10) $end = $total;
else $end = $page + 10;
$sdata=mysql_query("select * from obmen_files order by rplus desc limit $page,$num");
if($total==0){
echo'<div class="p">
пусто<br>
</div>';
}else{
while($ofile=mysql_fetch_array($sdata)){


$sotg=time()-86400*3;
$newcolor=mysql_num_rows(mysql_query("SELECT * FROM `obmen_files` WHERE `kogda`>'$sotg' AND `id_file`='".$ofile['id_file']."'")); $dokuda='../files/'.$ofile['id_file'].'_'.$krsite.'.'.$ofile['format'];
$vesma=round(filesize($dokuda)/1024); #Вес файла
if($vesma==0){$vesma='Менее 1';}
echo'<div class="p">';


echo'<b>Имя:</b> <a href="'.$ofile['id_file'].'.info">'; if($newcolor==1){echo'<font color="red">';}
echo $ofile['name'];

if($newcolor==1){echo'</font>';}
echo'</a><br><b>Описание: </b>'; if($ofile['opis']==""){echo'нет';}else{echo mb_substr($ofile['opis'],0,200,'UTF-8');} echo'<br>
Рейтинг: +'.$ofile['rplus'].'/-'.$ofile['rminus'].'<br>
Скачали: '.$ofile['loads'].' раз<br>
<a href="load.php?id_file='.$ofile['id_file'].'">Скачать</a> ['.strtoupper($ofile['format']).'] ['.$vesma.'Кб]<br>
';
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
echo'<a href="../pages/koments.php?id_wm='.$ofile['id_file'].'&amp;type=obmen">Комментарии</a> ['.$koments.']<br>
</div>';


}}


strpage($page, 10, $total, "top_raiting.php");
require"../system/foot.php";
?>