Файл: public_html/modules/up/folder.php
Строк: 49
<?php
/*
* @author: Ivan Kotliar (wanya26ua), Sergiy Mazurenko (Tesla), Taras Chornyi (Artas)
* @link: http://perfclub.ru
* @year: 2013
* @package: PerfCMS Ultra
*/
$locate = 'in_obmen';
$title = $lang->word('share');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('share'));
echo '<div class="post">'. $lang->word('sort') .' '.(isset($_GET['sort']) && $_GET['sort'] == 'name' ? '<a href="/up/folder/">'.$lang->word('sdate').'</a>/<b>'. $lang->word('sname') .'</b>' : '<b>'.$lang->word('sdate').'</b>/<a href="/up/folder/?sort=name">'.$lang->word('sname').'</a>').'</div>';
$files_r = $db->query("SELECT * FROM `up_files` WHERE `cat_id` = '". $cat_id ."'")->rowCount();
$pages = new Paginator($files_r, $ames);
if($files_r == 0) {
echo $tpl->div('menu', $lang->word('no_files'));
}
else {
$files_q = $db->query("SELECT * FROM `up_files` WHERE `cat_id` = '". $cat_id ."' ORDER BY ".(isset($_GET['sort']) && $_GET['sort'] == 'name' ? 'name ASC' : 'time')." LIMIT $start, $ames");
while($files = $files_q->fetch()) {
echo '<div class="menu">
'.(preg_match('/jpeg|jpg|gif|png|bmp/i', $files['ext']) ? img('image.png') : NULL).'
'.(preg_match('/jar|sis|sisx|jad|apk/i', $files['ext']) ? img('application.png') : NULL).'
'.(preg_match('/mp4|3gp|avi|flv/i', $files['ext']) ? img('video.png') : NULL).'
'.(preg_match('/mp3|aac|amr|wav|midi|mid/i', $files['ext']) ? img('music.png') : NULL).'
'.(preg_match('/zip|rar|tar.gz|7z/i', $files['ext']) ? img('box.png') : NULL).'
<a href="/up/file/'. $files['id'] .'/">'. $files['name'] .'</a> ('.strtoupper($files['ext']).')<br/>
'.(preg_match('/jpeg|jpg|gif|png|bmp/i', $files['ext']) ? '<img style="border: 1px solid #000;" weight="80" height="60" src="/files/up/'. $files['path_name'] .'" alt="Screen" /><br/>'."n" : (file_exists(ROOT.'/files/preview/'.$files['path_name'].'.png') ? '<img style="border: 1px solid #000;" weight="80" height="60" src="/files/preview/'.$files['path_name'].'.png" alt="Screen" /><br/>'."n" : NULL)) .'
'. substr($files['text'], 0, 60).'...
</div>';
}
$pages->view('/up/folder/?');
}
$tpl->div('block', NAV .'<a href="/up/">Обменник</a><br/>' . HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>