Файл: forum/inc/file.php
Строк: 67
<?
if ($set['web'])
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files` WHERE `id_post` = '$post[id]'"), 0)>0)
{
?>
<table width='100%' border='1' style='margin:5px;'>
<tr class='forum_file_table_title'>
<td width='14'>
</td>
<td>
Файл
</td>
<td>
Тип
</td>
<td width='50'>
Размер
</td>
<td width='50'>
Скачано
</td>
<td width='50'>
Рейтинг
</td>
<td width='50'>
</td>
<?
if (isset($user) && $user['level']>1) echo "<td width='14'></td>n";
?>
</tr>
<?
$q_f=mysql_query("SELECT * FROM `forum_files` WHERE `id_post` = '$post[id]'");
while ($file = mysql_fetch_assoc($q_f))
{
echo "<tr class='forum_file_table_file'>n";
echo "<td>n";
if (is_file(H.'style/themes/'.$set['set_them'].'/loads/14/'.$file['ras'].'.png'))
{
echo "<img src='/style/themes/$set[set_them]/loads/14/$file[ras].png' alt='$file[ras]' />n";
if ($set['echo_rassh_forum']==1)$ras=".$file[ras]";else $ras=NULL;
}
else
{
echo "<img src='/style/themes/$set[set_them]/forum/14/file.png' alt='' />n";
$ras=".$file[ras]";
}
echo "</td>n";
echo "<td>$file[name]$ras</td>n";
echo "<td>$file[type]</td>n";
echo "<td>".size_file($file['size'])."</td>n";
if (!isset($file['count']))mysql_query("ALTER TABLE `forum_files` ADD `count` INT DEFAULT '0' NOT NULL");
echo "<td style='text-align:center;'>$file[count]</td>n";
echo "<td style='text-align:center;'> ";
$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;
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 "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&id_file=$file[id]&rating=down" title="Отдать отрицательный голос">[-]</a>";
echo " $sum_vote/$k_vote ";
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 "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&id_file=$file[id]&rating=up" title="Отдать положительный голос">[+]</a>";
echo "</td>n";
echo "<td><a href='/forum/files/$file[id]/$file[name].$file[ras]'>Скачать</a></td>n";
if (isset($user) && $user['level']>1)
echo "<td><a href='/forum/files/delete/$file[id]/' title='Удалить из списка'><img src='/style/themes/$set[set_them]/forum/14/del_file.png' alt='' /></a></td>n";
echo "</tr>n";
}
}
}
else
{
$q_f=mysql_query("SELECT * FROM `forum_files` WHERE `id_post` = '$post[id]'");
while ($file = mysql_fetch_assoc($q_f)){
echo '<div style="margin: 10px;">';
$check_screen = ['png', 'jpg', 'jpeg', 'gif'];
// start while (...) {
if (is_file(H . 'style/themes/' . $set['set_them'] . '/loads/14/' . $file['ras'] . '.png')) {
if (in_array($file['ras'], $check_screen)) {
echo "<a href='/forum/files/$file[id]/$file[name].$file[ras]'>";
echo '<img src="/forum/files/' . $file['id'] . '/' . urlencode($file['name']) . '.' . $file['ras'] . '" alt="*" style="max-width: 250px;;border: 3px solid white; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);"/></a></br>';
} else {
echo '<img src="/style/themes/' . $set['set_them'] . '/loads/14/' . $file['ras'] . '.png" alt="' . $file['ras'] . '" />'."";
}
if ($set['echo_rassh_forum'] == 1) {
$ras = ".$file[ras]";
} else {
$ras = null;
}
} else {
echo '<img src="/style/themes/' . $set['set_them'] . '/forum/14/file.png" alt="" />'."";
$ras = '.' . $file['ras'];
}
// }end while
echo "<a href='/forum/files/$file[id]/$file[name].$file[ras]'><span style='color: #007e8e;font-size: 12px;'>$file[name]$ras</span></a> <span style='color: #0e6f7b;font-size: 12px;'>[".size_file($file['size'])."]</span> ";
$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;if (isset($user) && $user['level']>1)
echo "<a href='/forum/files/delete/$file[id]/' title='Удалить из списка'><i class='fas fa-times-circle'></i></a>";
echo '</div>';
}
}
?>