diff options
-rw-r--r-- | admin/thumbnail.php | 2 | ||||
-rw-r--r-- | admin/upload.php | 2 | ||||
-rw-r--r-- | include/config_default.inc.php | 3 | ||||
-rw-r--r-- | include/functions.inc.php | 4 | ||||
-rw-r--r-- | include/ws_functions.inc.php | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/admin/thumbnail.php b/admin/thumbnail.php index 3034e8478..46e42c33e 100644 --- a/admin/thumbnail.php +++ b/admin/thumbnail.php @@ -204,7 +204,7 @@ while ( $row=mysql_fetch_assoc($result) ) // searching the element $filename_wo_ext = get_filename_wo_extension($filename); $tn_ext = ''; - $base_test = $dirname.'/thumbnail/'; + $base_test = $dirname.'/'.$conf['dir_thumbnail'].'/'; $base_test.= $conf['prefix_thumbnail'].$filename_wo_ext.'.'; foreach ($conf['picture_ext'] as $ext) { diff --git a/admin/upload.php b/admin/upload.php index b871f6677..a8b88ccf2 100644 --- a/admin/upload.php +++ b/admin/upload.php @@ -187,7 +187,7 @@ while ( $row = mysql_fetch_array( $result ) ) $thumbnail.= get_filename_wo_extension( $row['file'] ); $thumbnail.= '.'.$row['tn_ext']; $url = $cat_names[$row['storage_category_id']]['dir']; - $url.= 'thumbnail/'.$thumbnail; + $url.= $conf['dir_thumbnail'].'/'.$thumbnail; $tpl_var['thumbnail'] = array( diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 27648fd0f..7ad3b6d86 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -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; diff --git a/include/functions.inc.php b/include/functions.inc.php index cccd0ed80..a8c65f0e9 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -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 ); diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index 591763d5b..00394c791 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -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)) |