Файл: WM-Koder/files.php
Строк: 33
<?php
require 'system/sid.php';
require 'system/config.php';
include 'system/user.php';
include 'system/head.php';
include 'system/navigator.php';
whorm(0, 'fo');
$nk = my_int($_GET['nk']);
if (!user_inf($nk)) {
header('Location: index.php?');
die();
}
echo $div_title . 'Файлы/' . us($nk) . $div_end;
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `fo_files` WHERE `moder` = '0' AND `author` = '$nk'"), 0);
if ($count != FALSE) {
$n = new navigator($count, 10, '?');
$select = mysql_query("SELECT * FROM `fo_files` WHERE `moder` = '0' AND `author` = '$nk' ORDER BY id DESC {$n->limit}");
$i = 0;
while($a = mysql_fetch_assoc($select)) {
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
$ext = strtolower(end(explode('.', $a['url'])));
if ($ext == 'zip') $format = '<img src="fo/img/zip.gif" alt="*"/> ';
elseif ($ext == 'rar') $format = '<img src="fo/img/rar.gif" alt="*"/> ';
elseif ($ext == 'gz') $format = '<img src="fo/img/gz.gif" alt="*"/> ';
elseif ($ext == 'tar') $format = '<img src="fo/img/tar.gif" alt="*"/> ';
else $format = '<img src="fo/img/unknown.gif" alt="*"/> ';
echo $format . '<a href="fo/info.php?i='.$a['id'].'">' . $a['title'] . '</a>' . $div_end;
}
echo $n->navi();
} else {
echo 'Файлов не найдено!<br/>';
}
include 'system/foot.php';
?>