summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-11-03 13:37:38 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-11-03 13:37:38 +0000
commit6a54409eb044948947f409466a734764670c0027 (patch)
tree850cc84f5d9820b4aa614ae0da31837296cb4921
parentc4b3cd974e27aab642209a37f6da6a15bc6f4a42 (diff)
issue76, make thumbnail directory configureable
git-svn-id: file:///var/lib/svn/phpfspot/trunk@293 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r--phpfspot.class.php6
-rw-r--r--phpfspot_cfg.php.dist6
2 files changed, 9 insertions, 3 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 50ab45e..cc1c873 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -1166,7 +1166,7 @@ class PHPFSPOT {
foreach($resolutions as $resolution) {
$thumb_sub_path = substr($file_md5, 0, 2);
- $thumb_path = $this->cfg->base_path ."/thumbs/". $thumb_sub_path ."/". $resolution ."_". $file_md5;
+ $thumb_path = $this->cfg->thumb_path ."/". $thumb_sub_path ."/". $resolution ."_". $file_md5;
if(!file_exists(dirname($thumb_path))) {
mkdir(dirname($thumb_path), 0755);
@@ -1910,8 +1910,8 @@ class PHPFSPOT {
public function get_thumb_path($width, $photo)
{
$sub_path = substr($this->getMD5($photo), 0, 2);
- return $this->cfg->base_path
- . "/thumbs/"
+ return $this->cfg->thumb_path
+ . "/"
. $sub_path
. "/"
. $width
diff --git a/phpfspot_cfg.php.dist b/phpfspot_cfg.php.dist
index 013a0fc..2661bc9 100644
--- a/phpfspot_cfg.php.dist
+++ b/phpfspot_cfg.php.dist
@@ -32,6 +32,12 @@ class PHPFSPOT_CFG {
var $web_path = "/phpfspot";
+ /* path to the directory to store the generated thumbnails.
+ this path needs not do be directly reachable via the webserver
+ Default it points to a subdirectory of $base_path.
+ */
+ var $thumb_path = "/var/www/htdocs/thumbs";
+
var $theme_name = "default";
/* database access via "native" sqlite3 support or via "pdo" */