<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';






if (!isset($_GET['id']) && !is_numeric($_GET['id'])){header("Location: index.php?".SID);exit;}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_list` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1",$db), 0)==0){header("Location: index.php?".SID);exit;}
$blog=mysql_fetch_array(mysql_query("select * from `blog_list` where `id`='".intval($_GET['id'])."';"));

$set['title']='Файлы-'.$blog['name'].'';
include_once '../sys/inc/thead.php';
title();
aut();


err();


$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_files` WHERE `id_blog` = '".intval($_GET['id'])."'"),0);
if($k_post==0)
{
echo "Файлов пока нет<br />";
}




$q_f=mysql_query("SELECT * FROM `blog_files` WHERE `id_blog` = '".intval($_GET['id'])."'");
while ($file = mysql_fetch_assoc($q_f))
{
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 "<a href='files.php?id=$file[id]'>$file[name]$ras</a> (".size_file($file['size']).") \n";





echo "<br />\n";


echo " | ";

echo "Скачано: $file[count] раз(а) ";
echo "<br />\n";
}



echo"<div class='foot'>\n";
echo"<a href='list.php?id=".intval($_GET['id'])."'>Назад</a><br />\n";
echo"<a href='index.php'>Дневники</a><br />\n";
echo"</div>\n";

include_once '../sys/inc/tfoot.php';

?>