Вход Регистрация
Файл: CMS/core/modules/users_files_download.php
Строк: 32
<?php

if (!defined('CMS')) { die('Access Denied!'); }

if (!empty(
$_GET['id'])) {

    
$idk = num($_GET['id']);

    
$row = $db->selectRow( "SELECT * FROM ?_downs WHERE `downs_id`= ? LIMIT 1", $idk );

    if (!empty(
$row)) {

        include_once( 
ENGINE . '/classes/down.class.php' );

        
$files_path = ROOTPATH . DS . $config['files_folder'] . DS . $idk . DS . $row['downs_link'];

        if (
file_exists($files_path)) {

            if (empty(
$_SESSION[SP]['dload'][$idk])) {

                
$db->query( "UPDATE ?_downs SET `downs_load` = (`downs_load` + 1), `downs_last_load` = ?
                             WHERE `downs_id` = ? LIMIT 1"
, SITE_TIME, $idk );
            }

            
$_SESSION[SP]['dload'][$idk] = 1;

            
//redirect($config['site_url'] . DS . $config['files_folder'] . DS . $idk . DS . $row['downs_link']);

            
Getf::download( @file_get_contents( $files_path ), $row['downs_link'], true, false );
            exit;

        }
        else {

            
$inSes->addMessage('Ошибка 404! Файл не найден или ссылка не верна!');
            
gen_red('files', '', RND);
        }
    }
    else {

        
$inSes->addMessage('Ошибка 404! Файл не найден или ссылка не верна!');
        
gen_red('files', '', RND);
    }
}
else {

    
$inSes->addMessage('Ошибка 404! Файл не найден или ссылка не верна!');
    
gen_red('files', '', RND);
}

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