kantry, Вот
download.php (+/-)
<?php
/**
* Gallery for JohnCMS. NO SALE!
* Author: ValekS
* File: down.php
*/
define('_IN_JOHNCMS', 1);
require('../incfiles/core.php');
require('func.php');
$lng_gallery = core::load_lng('gallery');
// Получаем сохраненные настройки
$settings = unserialize($set['gallery']);
if ($id) {
$img = mysql_fetch_assoc(mysql_query(" SELECT `name`, `file_name`, `mime_type` FROM `gallery_img` WHERE `id` = ".$id ));
} else {
require('../incfiles/head.php');
echo '<div class="phdr"><a href="index.php">'.$lng['gallery'].'</a> | '.$lng['error'].'</div>';
echo functions::display_error($lng_gallery['error_no_id'].'<br /><a href="index.php">'.$lng['gallery'].'</a>');
require('../incfiles/end.php');
exit;
}
if (!$user_id && !$settings['guest_downl']) {
require('../incfiles/head.php');
echo '<div class="phdr"><a href="index.php">'.$lng['gallery'].'</a> | '.$lng['error'].'</div>';
echo functions::display_error($lng_gallery['error_no_rights'].'<br /><a href="index.php">'.$lng['gallery'].'</a>');
require('../incfiles/end.php');
exit;
}
if ($img['file_name']) {
$s_name = 'file-'.$id;
if (empty($_SESSION[$s_name])) {
mysql_query(" UPDATE `gallery_img` SET `downl_count` = `downl_count` + 1 WHERE `id` = ".$id );
}
$_SESSION[$s_name] = 1;
file_download('../files/gallery/img/'.$img['file_name'], $img['name'], $img['mime_type']);
} else {
require('../incfiles/head.php');
echo '<div class="phdr"><a href="index.php">'.$lng['gallery'].'</a> | '.$lng['error'].'</div>';
echo functions::display_error($lng_gallery['error_no_img'].'<br /><a href="index.php">'.$lng['gallery'].'</a>');
require('../incfiles/end.php');
exit;
}Добавлено: 28.04.2018 / 15:56
Все спасибо нашел, 11 строка вместо func.php надо functions.php