Changeset 105
- Timestamp:
- 04/ 8/08 5:52:32 AM (9 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
includes/config.class.php (modified) (1 diff)
-
includes/photostack.class.php (modified) (4 diffs)
-
organize.php (modified) (1 diff)
-
thumb.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/config.class.php
r57 r105 67 67 $value = 'http://' . $_SERVER['HTTP_HOST'] . $base; 68 68 } 69 69 70 70 if($key == "chmod_value") { 71 72 if(!preg_match('/0[0-9]*/', $value)) $value = "0755";73 #$pid = posix_getpwuid(posix_geteuid());74 #$pid = $pid['uid'];75 #fileowner($this->pathto_galleries);71 if(!preg_match('/0[0-9]*/', $value)) $value = "0755"; 72 } 73 74 if($key == 'base_path') { 75 $value = dirname($_SERVER['SCRIPT_FILENAME']).'/'; 76 76 } 77 77 $this->$key = $value; -
trunk/includes/photostack.class.php
r104 r105 77 77 //is template in templates dir? 78 78 $tplPath = realpath($this->config->pathto_templates); 79 if(substr( realpath($this->config->pathto_templates.$_REQUEST['template']), 0, strlen($tplPath)) != $tplPath){79 if(substr(@realpath($this->config->pathto_templates.$_REQUEST['template']), 0, strlen($tplPath)) != $tplPath){ 80 80 return $this->config->pathto_current_template."index.php"; 81 81 } … … 170 170 171 171 //reindex the galleries 172 if(! $this->reindexed) $this->reindex();172 if(!@$this->reindexed) $this->reindex(); 173 173 174 174 //sort galleries and images … … 200 200 $images_changed = 0; 201 201 202 $dir = $this->get_listing($this->config-> pathto_galleries.$this->gallery->id,"images");202 $dir = $this->get_listing($this->config->base_path.$this->config->pathto_galleries.$this->gallery->id,"images"); 203 203 usort($this->gallery->images, array($this, "quicksort")); 204 204 foreach($this->gallery->images as $key => $value) $filenames[] = $value->filename; 205 205 206 if(is_array($filenames) && is_array($dir->files)) $unset = array_diff($filenames, $dir->files); 206 207 if($unset) { … … 806 807 } 807 808 808 function loop( $kind = null) {809 function loop() { 809 810 /* Thanks Matt & Wordpress! */ 810 811 if(!$this->index) { $this->index = $this->startat; } 811 if(!$this->index) { $this->index = $this->startat;} 812 812 if($this->first_time) { $this->index++; } else { $this->index_rewind = $this->index + $this->startat; $this->first_time = true; } 813 if($this->is_gallery() && $kind != 'images' or $kind == 'albums') {813 if($this->is_gallery()) { 814 814 $selected = $this->selected_gallery_count(); 815 } elseif($this->is_album() or $this->is_image() or $kind == 'images') {815 } elseif($this->is_album() or $this->is_image()) { 816 816 $selected = $this->selected_images_count(); 817 817 } 818 if($this->index < $selected + $this->startat ) return true; 818 if($this->index < $selected + $this->startat) return true; 819 return false; 819 820 } 820 821 -
trunk/organize.php
r94 r105 13 13 $ps = new admin(); 14 14 15 if($_REQUEST['session_id']) session_id($_REQUEST['session_id']);16 session_start();15 if($_REQUEST['session_id']) session_id($_REQUEST['session_id']); 16 session_start(); 17 17 18 18 //check if user is logged in -
trunk/thumb.php
r101 r105 21 21 22 22 //security check: make sure requested file is in galleries directory 23 $gal_path = realpath($this->config->pathto_galleries); 24 $img_path = realpath($this->config->pathto_galleries.$gallery."/".$image); 23 $gal_path = realpath($this->config->base_path.$this->config->pathto_galleries); 24 $img_path = realpath($this->config->base_path.$this->config->pathto_galleries.$gallery."/".$image); 25 25 26 $ext = strtolower(pathinfo($img_path, PATHINFO_EXTENSION)); 26 27 if(substr($img_path,0,strlen($gal_path)) != $gal_path) header("HTTP/1.0 404 Not Found"); … … 33 34 if(in_array($ext, $movie_extensions)) $movie = true; 34 35 35 $image_path = realpath($this->config->pathto_galleries."$gallery/$image"); 36 $image_path = realpath($this->config->base_path.'/'.$this->config->pathto_galleries."$gallery/$image"); 37 36 38 $thumb_path = $this->config->pathto_cache.$max_width."x".$max_height.($force_size?"f":"").strtr("-$gallery-$image",":/?\\","----"); 37 39 $movie_path = $this->config->pathto_cache.md5(strtr("-$gallery-$image",":/?\\","----")).'.flv'; … … 57 59 } 58 60 } 59 #header('Content-Disposition: inline; filename='.$_GET['image']);61 header('Content-Disposition: inline; filename='.$_GET['image']); 60 62 61 63 //if thumbnail is newer than image then output cached thumbnail and exit 62 64 if($imageModified<$thumbModified) { 63 #header("Last-Modified: ".gmdate("D, d M Y H:i:s",$thumbModified)." GMT");65 header("Last-Modified: ".gmdate("D, d M Y H:i:s",$thumbModified)." GMT"); 64 66 readfile($thumb_path); 65 67 exit; … … 85 87 $thumbQuality = $this->config->thumbnail_quality; 86 88 list($image_width, $image_height, $image_type) = GetImageSize($image_path); 89 87 90 } 88 91 //if aspect ratio is to be constrained set crop size
