New feature : configuration option for thumbnail directory

git-svn-id: http://piwigo.org/svn/trunk@3720 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou 2009-08-02 13:04:17 +00:00
commit 513b3e0bd6
5 changed files with 8 additions and 5 deletions

View file

@ -264,6 +264,9 @@ $conf['allow_html_descriptions'] = true;
// contain characters among : a to z (case insensitive), "-" or "_".
$conf['prefix_thumbnail'] = 'TN-';
// dir_thumbnail : directory where thumbnail reside.
$conf['dir_thumbnail'] = 'thumbnail';
// users_page: how many users to display in screen
// Administration>Identification>Users?
$conf['users_page'] = 20;

View file

@ -256,7 +256,7 @@ function mkgetdir($dir, $flags=MKGETDIR_DEFAULT)
*/
function mkget_thumbnail_dir($dirname, &$errors)
{
$tndir = $dirname.'/thumbnail';
$tndir = $dirname.'/'.$conf['dir_thumbnail'];
if (! mkgetdir($tndir, MKGETDIR_NONE) )
{
array_push($errors,
@ -865,7 +865,7 @@ function get_thumbnail_location($element_info)
{
$path = substr_replace(
get_filename_wo_extension($element_info['path']),
'/thumbnail/'.$conf['prefix_thumbnail'],
'/'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'],
strrpos($element_info['path'],'/'),
1
);

View file

@ -1065,7 +1065,7 @@ SELECT
// thumbnail directory is a subdirectory of the photo file, hard coded
// "thumbnail"
$thumbnail_dir = $upload_dir.'/thumbnail';
$thumbnail_dir = $upload_dir.'/'.$conf['dir_thumbnail'];
if (!is_dir($thumbnail_dir)) {
umask(0000);
if (!@mkdir($thumbnail_dir, 0777))