trippo / ResponsiveFilemanager

Completely Responsive Filemanager with integration for tinyMCE,CKEditor and CLEditor editor
http://responsivefilemanager.com
Other
815 stars 364 forks source link

folder config.php #599

Open nzyeehaa opened 4 years ago

nzyeehaa commented 4 years ago

separate config.php inside image folder with different message and settings... have used this successfully before (with an older version) but get an error in v9.14.0...

There is an error! The upload folder there isn't. Check your config.php file.

config.php

<?php
$config = array(
'folder_message'=>"images resized and cropped to 1280px wide, 400px high on upload, (crop before uploading to avoid problems) use only small letters - e.g 1.jpg ",

//Automatic resizing //
'image_resizing'                          => true,
'image_resizing_width'                    => 1280,
'image_resizing_height'                   => 400,
'image_resizing_mode'                     => 'auto', // same as $image_max_mode
'image_resizing_override'                 => false,

);
?>

website says

and set the config array only with the element do you need to change. (Don't change current_path,upload_dir,base_url,root).

any ideas?

P.S. ./media/images/ (base folder- works) ./media/images/accommodation/ (sub folder - works) ./media/images/slides/ (contains config.php - shows error as above)

use empty config.php with <?php ?> php tags still produces error so maybe it is a core issue

aroncal commented 4 years ago

I think it's not well documented. Looking into the code where it merges the global and the local config.php files in dialog.php:

if (file_exists($config['current_path'] . $parent . "config.php")) {
  $configTemp = include $config['current_path'] . $parent . 'config.php';
  $config = array_merge($config, $configTemp);
  $cycle = FALSE;
}

it uses include to feed $configTemp. I've changed my local config.php to this an it has worked:

<?php
return array(
  'image_max_width'                        => 800,
  'image_max_height'                       => 600,
  'fixed_image_creation'                   => true,
  'fixed_path_from_filemanager'            => array('../../../../uploads_m/'),
  'fixed_image_creation_name_to_prepend'   => array(''),
  'fixed_image_creation_to_append'         => array(''),
  'fixed_image_creation_width'             => array(350),
  'fixed_image_creation_height'            => array('')
);
?>

I'm using PHP 5.6.40

WebVooruit commented 4 years ago

@aroncal thank you, that solved our issue !