Файл: forum/files_list.php
Строк: 76
<?
include_once '../sys/includes/start.php';
include_once '../sys/includes/compress.php';
include_once '../sys/includes/sess.php';
include_once '../sys/includes/home.php';
include_once '../sys/includes/settings.php';
include_once '../sys/includes/db_connect.php';
include_once '../sys/includes/ipua.php';
include_once '../sys/includes/fnc.php';
include_once '../sys/includes/user.php';
$set['title']='Форум - TOP 20 файлов';
include_once '../sys/includes/header.php';
title();
auter();
$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");
while ($file = mysql_fetch_assoc($q_f))
{
echo "<div class='forum'>";
echo "<img src='/s-klub/img/file.png'> Файл: $file[name]<br />";
echo "<img src='/s-klub/img/format-f.png'> Формат: ";
if (is_file(H.'s-klub/raz/'.$file['ras'].'.png'))
{
echo "<img src='/s-klub/raz/$file[ras].png' alt='$file[ras]' /> ($file[ras])";
if ($set['echo_rassh_forum']==1)
{
$ras="$file[ras]";
}else{
$ras=NULL;
}
}else{
echo "$file[ras]";
$ras=".$file[ras]";
}
echo "<br />";
echo "<img src='/s-klub/img/razmer.png'> Размер: ".size_file($file['size'])."<br />";
$k_vote=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files_rating` WHERE `id_file` = '$file[id]'"), 0);
$sum_vote=mysql_result(mysql_query("SELECT SUM(`rating`) FROM `forum_files_rating` WHERE `id_file` = '$file[id]'"), 0);
if ($sum_vote==null)
{
$sum_vote=0;
}
echo "<img src='/s-klub/img/top.png'> Рейтинг: $sum_vote/$k_vote<br />";
if (isset($user) && $user['balls']>=50 && $user['rating']>=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files_rating` WHERE `id_user` = '$user[id]' AND `id_file` = '$file[id]'"), 0)==0)
{
echo "<img src='/s-klub/img/top.png'> Голосовать: <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&id_file=$file[id]&rating=up' title='Отдать положительный голос'><img src='/s-klub/img/up.png'></a> | ";
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&id_file=$file[id]&rating=down' title='Отдать отрицательный голос'><img src='/s-klub/img/down.png'></a><br />";
}
echo "<img src='/s-klub/img/download.png'> Скачано: $file[count] раз(а)<br />n";
echo "<img src='/s-klub/img/download.png'> <a href='/forum/files/$file[id]/$file[name].$file[ras]'>Скачать</a><br />";
if (isset($user) && $user['level']>=3)
{
echo "<img src='/s-klub/img/del.png'> <a href='/forum/files/delete/$file[id]/' title='Удалить из списка'>Удалить</a><br />";
}
echo "</div>";
}
echo "<a href='/forum/'><div class='foot'>";
echo "<img src='/s-klub/img/left.png'> Форум<br />";
echo "</div></a>";
include_once '../sys/includes/footer.php';
?>