Changeset 538

Show
Ignore:
Timestamp:
05/09/08 16:22:50 (2 months ago)
Author:
sidtheduck
Message:

+ additional cleanup for ticket #157
+ additional bug fixes for ticket #156

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/plog-admin-functions.php

    r536 r538  
    8383                $result['errors'] .= sprintf(plog_tr('Could not create directory %s!'),$create_path); 
    8484                return $result; 
    85         }; 
     85        } 
    8686 
    8787        if (is_uploaded_file($tmpname)) { 
     
    9595                $result['errors'] .= sprintf(plog_tr('Could not move file! %s to %s'),$tmpname,$final_fqfn); 
    9696                return $result; 
    97         }; 
     97        } 
    9898 
    9999        if (is_file($tmpname)){ 
    100100                @unlink($tmpname); 
    101101        } 
    102         $res = chmod($final_fqfn, 0755); 
     102        $res = @chmod($final_fqfn, 0755); 
    103103 
    104104        // Get the EXIF data. 
  • trunk/admin/plog-import.php

    r537 r538  
    6161        $captions = $_POST['captions']; 
    6262        $descriptions = $_POST['descriptions']; 
    63         $files = $_POST['files']
     63        $files = isset($_POST['files']) ? $_POST['files'] : ''
    6464        $selected = $_POST['Selected']; 
    6565 
  • trunk/gallery.php

    r511 r538  
    1818                if (isset($resolved_path['mode'])) { 
    1919                        $_GET['mode'] = $resolved_path['mode']; 
    20                 }; 
     20                } 
    2121 
    2222                // get page number from url, if present 
     
    2525                        parse_str($parts["query"],$query_parts); 
    2626                        if (!empty($query_parts["plog_page"])) $_GET["plog_page"] = $query_parts["plog_page"]; 
    27                 }; 
     27                } 
    2828                $path = $parts["path"]; 
    29         }; 
    30 }; 
     29        } 
     30} 
    3131 
    3232// Set sorting session variables if they are passed 
    3333if (isset($_GET['sortby'])) { 
    3434        $_SESSION['plogger_sortby'] = $_GET['sortby']; 
    35 }; 
     35} 
    3636 
    3737if (isset($_GET['sortdir'])) { 
    3838        $_SESSION['plogger_sortdir'] = $_GET['sortdir']; 
    39 }; 
     39} 
    4040 
    4141// The three GET parameters that it accepts are 
     
    5555if (!in_array($GLOBALS['plogger_level'],$allowed_levels)) { 
    5656        $GLOBALS['plogger_level'] = 'collections'; 
    57 }; 
     57} 
    5858 
    5959// Some Estonian remarks was here ?!? 
     
    8585                } else { 
    8686                        $use_file = 'search.php'; 
    87                 }; 
     87                } 
    8888        } 
    8989        elseif ($GLOBALS['plogger_level'] == "album") { 
     
    9393                } else { 
    9494                        $use_file = 'album.php'; 
    95                 }; 
     95                } 
    9696        } 
    9797        else if ($GLOBALS['plogger_level'] == "collection") { 
    9898                $use_file = 'collection.php'; 
    99         }; 
     99        } 
    100100 
    101101        // if the theme does not have the requested file, then use the one from the default template 
  • trunk/plog-functions.php

    r536 r538  
    14081408         
    14091409        // right now only single id is supported, maybe I want to specify multiple id-s as well 
    1410         $value = ($arr['value'] > 0) ? $arr['value'] : -1; 
     1410        $value = (isset($arr['value']) && $arr['value'] > 0) ? $arr['value'] : -1; 
    14111411         
    14121412        if ('collection' == $type) { 
     
    19871987 
    19881988function plogger_get_picture_description() { 
    1989         return SmartStripSlashes($GLOBALS["current_picture"]["description"]); 
     1989        if (isset($GLOBALS['current_picture']['description'])){ 
     1990                return SmartStripSlashes($GLOBALS['current_picture']['description']); 
     1991        } else { 
     1992                return false; 
     1993        } 
    19901994} 
    19911995 
     
    22612265                $numresult = run_query($numquery); 
    22622266                return mysql_result($numresult, 'num_pictures'); 
     2267        } else { 
     2268                return 0; 
    22632269        } 
    22642270} 
  • trunk/plog-rss.php

    r536 r538  
    111111header("Content-Type: application/xml"); 
    112112 
    113 $level = isset($_GET["level"]) ? $_GET["level"] : ""; 
    114 $id = isset($_GET["id"]) ? intval($_GET["id"]) : ""; 
     113$level = isset($_GET['level']) ? $_GET['level'] : ""; 
     114$id = isset($_GET['id']) ? intval($_GET['id']) : ""; 
    115115 
    116116// process path here - is set if mod_rewrite is in use 
    117117 
    118118// Some Estonian remarks was here 
    119 if (!empty($_REQUEST["path"])) { 
     119if (!empty($_REQUEST['path'])) { 
    120120        // The following line calculates the path in the album and excludes any subdirectories if 
    121121        // Plogger is installed in one 
     
    123123        $resolved_path = resolve_path($path); 
    124124        // there is no meaningful RSS feed for images 
    125         if (is_array($resolved_path) && $resolved_path["level"] != "picture") { 
    126                 $level = $resolved_path["level"]; 
    127                 $id = $resolved_path["id"]; 
    128         }; 
    129 }; 
     125        if (is_array($resolved_path) && isset($resolved_path['level']) && $resolved_path['level'] != "picture") { 
     126                $level = $resolved_path['level']; 
     127                $id = $resolved_path['id']; 
     128        } 
     129} 
    130130 
    131 $parts = parse_url($_SERVER["REQUEST_URI"]); 
    132 parse_str($parts["query"],$query_parts); 
    133 if (isset($query_parts["searchterms"])) { 
    134         generate_RSS_feed($level, $id, $query_parts["searchterms"]); 
     131$parts = parse_url($_SERVER['REQUEST_URI']); 
     132if (isset($parts['query'])){ 
     133        parse_str($parts['query'],$query_parts); 
     134
     135if (isset($query_parts['searchterms'])) { 
     136        generate_RSS_feed($level, $id, $query_parts['searchterms']); 
    135137} else { 
    136138        generate_RSS_feed($level, $id);