Вход Регистрация
Файл: modules/share/new_files.php
Строк: 36
<?php
if(isset($user)) {
$locate    = 'in_share';
$title = $lang->word('new_files').' | '.$lang->word('share');
require_once(
SYS.'/view/header.php');
$tpl->div('title', $lang->word('new_files').' | '.$lang->word('share'));
$files_r = $db->query("SELECT * FROM `share_files` WHERE `time` > '". (time()-60*60*24) ."'")->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 `share_files` WHERE `time` > '". (time()-60*60*24) ."' ORDER BY time DESC 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|torrent|rar|tar.gz|7z/i', $files['ext']) ? img('box.png') : NULL).'
                 <a href="/share/file/'
. $files['id'] .'/">'. $files['name'] .'</a> ('.strtoupper($files['ext']).')<br/>
                 '
. mb_substr($files['text'], 0, 60).'...
                </div>'
;
        }
    
$pages->view('/share/new_files/?');
}
$tpl->div('block', img('share.png') . ' <a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(
SYS.'/view/footer.php');

} else {
$title = 'Загруз-центр';
require_once(
SYS.'/view/header.php');
$tpl->div('title', 'Загруз-центр');
$tpl->div('menu', '<center>Загруз-центр доступен только зарегистрированным пользователям!</center>');
$tpl->div('block',HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(
SYS.'/view/footer.php');
}

?>
Онлайн: 2
Реклама