View file down/inc/file.php

File size: 1.54Kb
<?
echo "<div class='contur'><div class='header'>";

echo $i+1;
echo ". $filename<br />\n";

if ($setall['loads']==0 || !empty($_SESSION['login']))
{
echo "<a href=\"index.php?l=$prl$filename\">Скачать</a><br />\n";
}

$filesize=filesize("$l/$file");
$filesize_ed='B';
if ($filesize>=1024)
{
$filesize= round($filesize/1024 , 2);
$filesize_ed='KB';
}
if ($filesize>=1024)
{
$filesize= round($filesize/1024 , 2);
$filesize_ed='MB';
}

echo "Размер: <font color='red'>$filesize $filesize_ed</font><br />";

if (is_file("$l/$file.opis"))
{
$opis=file("$l/$file.opis");
$opis=implode("",$opis);

$opis=str_replace("\r\n","<br />",$opis);
$opis=str_replace("\r","<br />",$opis);
$opis=str_replace("\n","<br />",$opis);
echo "Описание:<br />$opis<br />\n";
}
else
{
echo "Описание: Отсутствует<br />\n";
}

$q = mysql_query("SELECT COUNT(*) FROM `loads_komm` WHERE `file` = '$prl$file';");
echo "<a href=\"komm.php?file=$prl$file\">Комментарии</a>(". mysql_result($q, 0).") ";

$q = mysql_query("SELECT COUNT(*) FROM `downloads` WHERE `file` = '$prl$file';");
echo "Скачивали: <b>". mysql_result($q, 0)."</b> раз.<br />\n";

if ($qw['type']=="999" && $r=="ok")
{
$prl_2=ereg_replace("/$","",$prl);
$prl_2=ereg_replace("^/","",$prl_2);
echo "[<a href=\"dir.php?l=$prl_2&amp;set=$file&amp;act=del\">Удалить</a>]";
echo "[<a href=\"dir.php?l=$prl_2&amp;set=$file&amp;act=set&amp;page=$page\">Параметры</a>]";
}
echo "</div>\n";
echo "</div>\n";
?>