Changeset 105

Show
Ignore:
Timestamp:
04/ 8/08 5:52:32 AM (9 months ago)
Author:
noel
Message:

fixing those damn paths

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/config.class.php

    r57 r105  
    6767                                        $value = 'http://' . $_SERVER['HTTP_HOST'] . $base; 
    6868                                } 
    69                          
     69                                 
    7070                                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']).'/'; 
    7676                                } 
    7777                                $this->$key = $value; 
  • trunk/includes/photostack.class.php

    r104 r105  
    7777        //is template in templates dir? 
    7878        $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){ 
    8080                return $this->config->pathto_current_template."index.php"; 
    8181        } 
     
    170170 
    171171        //reindex the galleries 
    172         if(!$this->reindexed) $this->reindex(); 
     172        if(!@$this->reindexed) $this->reindex(); 
    173173 
    174174    //sort galleries and images 
     
    200200        $images_changed = 0; 
    201201 
    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"); 
    203203        usort($this->gallery->images, array($this, "quicksort")); 
    204204        foreach($this->gallery->images as $key => $value) $filenames[] = $value->filename; 
     205         
    205206        if(is_array($filenames) && is_array($dir->files)) $unset = array_diff($filenames, $dir->files); 
    206207        if($unset) { 
     
    806807} 
    807808 
    808 function loop($kind = null) { 
     809function loop() { 
    809810        /* Thanks Matt & Wordpress! */ 
    810  
    811         if(!$this->index) { $this->index = $this->startat; } 
     811        if(!$this->index) { $this->index = $this->startat;} 
    812812        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()) { 
    814814                $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()) { 
    816816                $selected = $this->selected_images_count(); 
    817817        } 
    818         if($this->index < $selected + $this->startat ) return true; 
     818        if($this->index < $selected + $this->startat) return true; 
     819        return false; 
    819820} 
    820821 
  • trunk/organize.php

    r94 r105  
    1313$ps = new admin(); 
    1414 
    15                         if($_REQUEST['session_id']) session_id($_REQUEST['session_id']); 
    16                         session_start(); 
     15if($_REQUEST['session_id']) session_id($_REQUEST['session_id']); 
     16session_start(); 
    1717 
    1818//check if user is logged in 
  • trunk/thumb.php

    r101 r105  
    2121   
    2222  //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 
    2526        $ext = strtolower(pathinfo($img_path, PATHINFO_EXTENSION)); 
    2627  if(substr($img_path,0,strlen($gal_path)) != $gal_path) header("HTTP/1.0 404 Not Found"); 
     
    3334if(in_array($ext, $movie_extensions)) $movie = true; 
    3435 
    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 
    3638        $thumb_path = $this->config->pathto_cache.$max_width."x".$max_height.($force_size?"f":"").strtr("-$gallery-$image",":/?\\","----"); 
    3739        $movie_path = $this->config->pathto_cache.md5(strtr("-$gallery-$image",":/?\\","----")).'.flv'; 
     
    5759        } 
    5860        } 
    59         #header('Content-Disposition: inline; filename='.$_GET['image']); 
     61        header('Content-Disposition: inline; filename='.$_GET['image']); 
    6062 
    6163        //if thumbnail is newer than image then output cached thumbnail and exit 
    6264        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"); 
    6466        readfile($thumb_path); 
    6567        exit; 
     
    8587                $thumbQuality = $this->config->thumbnail_quality; 
    8688                list($image_width, $image_height, $image_type) = GetImageSize($image_path); 
     89 
    8790        } 
    8891          //if aspect ratio is to be constrained set crop size