X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=7e7d4dd8ff6ad0ac067d13c54b15408459a4eb2f;hp=b4d8b17ee5ce27f6533b350ee16ec7104b7b2fd1;hb=ba67cbf2ecb051b36ba0985099a76456b5c38e15;hpb=8f46e095700c4c44b0aa3e216ca9b43bcc2fe9e6 diff --git a/phpfspot.class.php b/phpfspot.class.php index b4d8b17..7e7d4dd 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -54,7 +54,7 @@ class PHPFSPOT { /* set application name and version information */ $this->cfg->product = "phpfspot"; - $this->cfg->version = "1.3"; + $this->cfg->version = "1.4"; $this->sort_orders= array( 'date_asc' => 'Date ↑', @@ -88,6 +88,11 @@ class PHPFSPOT { exit(1); } + if(!is_writeable($this->cfg->thumb_path)) { + print $this->cfg->thumb_path .": directory is not writeable for user ". $this->getuid() ."\n"; + exit(1); + } + $this->cfg_db = new PHPFSPOT_DB($this, $this->cfg->phpfspot_db); if(!is_writeable($this->cfg->phpfspot_db)) { print $this->cfg->phpfspot_db ." is not writeable for user ". $this->getuid() ."\n"; @@ -978,6 +983,7 @@ class PHPFSPOT { $img_width[$thumbs] = Array(); $img_id[$thumbs] = Array(); $img_name[$thumbs] = Array(); + $img_fullname[$thumbs] = Array(); $img_title = Array(); for($i = $begin_with; $i < $end_with; $i++) { @@ -987,6 +993,7 @@ class PHPFSPOT { $images[$thumbs] = $photos[$i]; $img_id[$thumbs] = $i; $img_name[$thumbs] = htmlspecialchars($this->getPhotoName($photos[$i], 15)); + $img_fullname[$thumbs] = htmlspecialchars($this->getPhotoName($photos[$i], 0)); $img_title[$thumbs] = "Click to view photo ". htmlspecialchars($this->getPhotoName($photos[$i], 0)); $thumb_path = $this->get_thumb_path($this->cfg->thumb_width, $photos[$i]); @@ -1117,6 +1124,7 @@ class PHPFSPOT { $this->tmpl->assign('rss_link', $rss_link); $this->tmpl->assign('count', $count); $this->tmpl->assign('width', $this->cfg->thumb_width); + $this->tmpl->assign('preview_width', $this->cfg->photo_width); $this->tmpl->assign('thumb_container_width', $this->cfg->thumb_width); $this->tmpl->assign('thumb_container_height', $this->cfg->thumb_height+20); $this->tmpl->assign('images', $images); @@ -1124,6 +1132,7 @@ class PHPFSPOT { $this->tmpl->assign('img_height', $img_height); $this->tmpl->assign('img_id', $img_id); $this->tmpl->assign('img_name', $img_name); + $this->tmpl->assign('img_fullname', $img_fullname); $this->tmpl->assign('img_title', $img_title); $this->tmpl->assign('thumbs', $thumbs); @@ -1377,6 +1386,7 @@ class PHPFSPOT { $thumb_sub_path = substr($file_md5, 0, 2); $thumb_path = $this->cfg->thumb_path ."/". $thumb_sub_path ."/". $resolution ."_". $file_md5; + /* if thumbnail-subdirectory does not exist yet, create it */ if(!file_exists(dirname($thumb_path))) { mkdir(dirname($thumb_path), 0755); }