Файл: forum/files_list.php
Строк: 60
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
$set['title'] = 'Форум - TOP 20 файлов';
require_once '../sys/inc/thead.php';
aut();
$q_f = mysql_query("SELECT COUNT(`forum_files_rating`.`rating`) AS `c_rating`, SUM(`forum_files_rating`.`rating`) AS `rating`, `forum_files`.* FROM `forum_files` LEFT JOIN `forum_files_rating` ON `forum_files`.`id` = `forum_files_rating`.`id_file` GROUP BY `forum_files`.`id` ORDER BY `rating` DESC LIMIT 20");
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files`"), 0);
echo "<div class = 'menu_razd'>Файлы</div>";
if ($k_post == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет файлов";
echo "</td></tr></table>";
}
while ($file = mysql_fetch_assoc($q_f)) {
echo "<table class = 'foot'><tr><td class = 'null'>";
if (is_file(H . 'style/icons/files/' . $file['ras'] . '.png')) {
echo "<img src = '/style/icons/files/$file[ras].png' alt = '$file[ras]' />n";
if ($set['echo_rassh_forum'] == 1) {
$ras = ".$file[ras]";
} else {
$ras = NULL;
}
} else {
echo "<img src = '/style/icons/compress.png' />n";
$ras = ".$file[ras]";
}
echo "<a href = '/forum/$file[id]/$file[name].$file[ras]'>$file[name]$ras</a> (" . size_file($file['size']) . ") n";
echo "<br />Рейтинг: ";
if ($file['rating'] == null) {
$file['rating'] = 0;
}
echo " $file[rating]/$file[c_rating] ";
echo " | ";
echo "Скачано: $file[count] раз(а) ";
echo "</td></tr></table>";
}
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/'>Форум</a>";
echo "</div>";
require_once '../sys/inc/tfoot.php';