Файл: test.masteram.us/comm/forum/inc/file.php
Строк: 24
<?php
$q_f=mysql_query("SELECT * FROM `comm_forum_files` WHERE `id_post` = '$post[id]' AND `id_comm` = '$id_comm'");
while($file = mysql_fetch_array($q_f)){
if(is_file(H.'style/themes/'.$set['set_them'].'/loads/'.$file['ras'].'.png')){
echo '<img src="/style/themes/'.$set['set_them'].'/loads/'.$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/file.png" alt=""/>';
$ras=$file['ras'];
}
echo '<a href="files.php?id='.$file['id'].'&id_comm='.$id_comm.'">'.$file['name'].''.$ras.'</a> ('.size_file($file['size']).') ';
$k_vote=mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_forum_files_rating` WHERE `id_file` = '$file[id]' AND `id_comm` = '$id_comm'"), 0);
$sum_vote=mysql_result(mysql_query("SELECT SUM(`rating`) FROM `comm_forum_files_rating` WHERE `id_file` = '$file[id]' AND `id_comm` = '$id_comm'"), 0);
if($sum_vote==null){
$sum_vote=0;
}
if(isset($user) && $admin['uid']==$user['id'] && $admin['priv']>0){
echo '<a href="files.php?id='.$file['id'].'&id_comm='.$id_comm.'&del"><img src="/style/themes/'.$set['set_them'].'/forum/del_file.png" alt=""/></a>';
}
echo '<br/>Рейтинг: ';
if(isset($user) && $admin['uid']==$user['id'] && $user['balls']>=50 && mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_forum_files_rating` WHERE `id_user` = '$user[id]' AND `id_file` = '$file[id]' AND `id_comm` = '$id_comm'"), 0)==0){
echo '<a href="index.php?id_forum='.$forum['id'].'&id_razdel='.$razdel['id'].'&id_them='.$them['id'].'&page='.$page.'&id_file='.$file['id'].'&id_comm='.$id_comm.'&rating=down">[-]</a>';
}
echo ' '.$sum_vote.'/'.$k_vote.' ';
if(isset($user) && $admin['uid']==$user['id'] && $user['balls']>=50 && mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_forum_files_rating` WHERE `id_user` = '$user[id]' AND `id_file` = '$file[id]' AND `id_comm` = '$id_comm'"), 0)==0){
echo '<a href="index.php?id_forum='.$forum['id'].'&id_razdel='.$razdel['id'].'&id_them='.$them['id'].'&page='.$page.'&id_file='.$file['id'].'&id_comm='.$id_comm.'&rating=up">[+]</a>';
}
echo ' | Скачано: '.$file['count'].' раз(а) <br/>';
}
?>