Changeset 560

Show
Ignore:
Timestamp:
07/15/08 17:05:24 (4 months ago)
Author:
sidtheduck
Message:

+ Fix for ticket #179
+ Fixes for miscellaneous minor bugs

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/plog-admin/includes/install-functions.php

    r555 r560  
    304304 
    305305        $config['gallery_url'] = "http://".$_SERVER["SERVER_NAME"]. dirname(dirname($_SERVER["PHP_SELF"])); 
     306        // remove plog-admin/ from the end, if present .. is there a better way to determine the full url? 
     307        if (strpos($config['gallery_url'], "plog-admin/")) { 
     308                $config['gallery_url'] = substr($config['gallery_url'],0,strpos($config['gallery_url'], "plog-admin/")); 
     309        } 
    306310        // verify that gallery URL contains a trailing slash. if not, add one. 
    307311        if      ($config['gallery_url']{strlen($config['gallery_url'])-1} != '/'){ 
  • trunk/plog-globals.php

    r550 r560  
    11<?php 
    2 ini_set('include_path', ini_get('include_path')); 
     2@ini_set('include_path', ini_get('include_path')); 
    33@ini_set("arg_separator.output","&amp;"); 
    44if (intval(ini_get("max_execution_time")) < 300){ 
  • trunk/plog-includes/plog-functions.php

    r559 r560  
    792792        function get_album_by_name($name) { 
    793793                $sql = "SELECT * 
    794                 FROM `".TABLE_PREFIX."albumss` 
     794                FROM `".TABLE_PREFIX."albums` 
    795795                WHERE `name` = '".mysql_real_escape_string($name)."'"; 
    796796                $result = run_query($sql); 
     
    12601260        } 
    12611261 
    1262         // Ardamis fix from diffuser theme, don't quite understand why it's needed 
    1263         if (!$plaintext){ 
    1264                 $rv = str_replace("&id","&amp;id",$rv); 
     1262        // replace &amp; with & if outputting to email 
     1263        if ($plaintext !== false){ 
     1264                $rv = str_replace("&amp;","&",$rv); 
    12651265        } 
    12661266 
     
    13361336                $msg .= plog_tr("Comment") . ":\n$comment\n\n"; 
    13371337                $msg .= plog_tr("You can see all the comments for this picture here") . ":\n"; 
    1338                 $picurl = generate_url("picture",$parent_id); 
     1338                $picurl = generate_url("picture", $parent_id, NULL, true); 
    13391339                $msg .= $picurl; 
    13401340                $headers  = "From: $author <$email>\r\n"; 
     
    13451345                $config['admin_email'], 
    13461346                '[' . SmartStripSlashes($config['gallery_name']) . '] ' . plog_tr('New Comment From') . ' ' . $author, 
    1347                 $msg, 
     1347                SmartStripSlashes($msg), 
    13481348                $headers); 
    13491349        } 
  • trunk/plog-load-config.php

    r555 r560  
    4242$config = mysql_fetch_assoc($result); 
    4343 
    44 $config["basedir"] = $plog_basedir; 
     44$config['basedir'] = $plog_basedir; 
    4545 
    46 $url_parts = parse_url($_SERVER["REQUEST_URI"]); 
    47 $config["baseurl"] = $url_parts["path"]; 
     46$url_parts = parse_url($_SERVER['REQUEST_URI']); 
     47$config['baseurl'] = "http://".$_SERVER['HTTP_HOST'].$url_parts['path']; 
    4848 
    4949// Try to figure out whether we are embedded (for example running from Wordpress) 
     
    5252if (!defined('PLOGGER_EMBEDDED') || PLOGGER_EMBEDDED=='') { 
    5353        if (dirname(__FILE__) != dirname(realpath($_SERVER['SCRIPT_FILENAME'])) && strpos($_SERVER['SCRIPT_FILENAME'],"plog-admin") === false) { 
    54                 $config["embedded"] = 1; 
     54                $config['embedded'] = 1; 
    5555                // disable our own cruft-free urls, because the URL has already been processed 
    5656                // by WordPress 
    57                 $config["use_mod_rewrite"] = 0; 
     57                $config['use_mod_rewrite'] = 0; 
    5858                trace('Plogger is embedded'); 
    5959                trace('dirname: ' . dirname(__FILE__)); 
     
    6161                trace('realpath($_SERVER[\'SCRIPT_FILENAME\'])' .': '. realpath($_SERVER['SCRIPT_FILENAME'])); 
    6262        } else { 
    63                 $config["embedded"] = 0; 
     63                $config['embedded'] = 0; 
    6464                // if mod_rewrite is on, make sure to remove the file basename 
    65                 if ($config["use_mod_rewrite"] == 1) { 
    66                         $config["baseurl"] = "http://".$_SERVER["HTTP_HOST"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; 
     65                if ($config['use_mod_rewrite'] == 1) { 
     66                        $config['baseurl'] = "http://".$_SERVER['HTTP_HOST']. substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],"/")) . "/"; 
    6767                } 
    6868        } 
     
    7070        // Set PLOGGER_EMBEDDED to 1 in config file to overrule automatic test 
    7171        if (PLOGGER_EMBEDDED == '1') { 
    72                 $config["embedded"] = 1; 
    73                 $config["use_mod_rewrite"] = 0; 
     72                $config['embedded'] = 1; 
     73                $config['use_mod_rewrite'] = 0; 
    7474                trace('Plogger is embedded'); 
    7575                // Set PLOGGER_EMBEDDED to 0 in case Plogger inclusion in different folder location, but does not already use mod_rewrite paths 
    7676        } else { 
    77                 $config["embedded"] = 0; 
     77                $config['embedded'] = 0; 
    7878                // if mod_rewrite is on, make sure to remove the file basename 
    79                 if ($config["use_mod_rewrite"] == 1) { 
    80                         $config["baseurl"] = "http://".$_SERVER["HTTP_HOST"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; 
     79                if ($config['use_mod_rewrite'] == 1) { 
     80                        $config['baseurl'] = "http://".$_SERVER['HTTP_HOST']. substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],"/")) . "/"; 
    8181                } 
    8282        } 
     
    8585// remove plog-admin/ from the end, if present .. is there a better way to determine the full url? 
    8686// had to update this for new use of links without mod_rewrite turned on (only affects the View gallery greybox in Admin) 
    87 if (strpos($config["baseurl"], "plog-admin/")) { 
    88         $config["baseurl"] = substr($config["baseurl"],0,strpos($config["baseurl"], "plog-admin/")); 
     87if (strpos($config['baseurl'], "plog-admin/")) { 
     88        $config['baseurl'] = substr($config['baseurl'],0,strpos($config['baseurl'], "plog-admin/")); 
    8989} 
    9090 
    91 $config["theme_url"] = $config["gallery_url"]."plog-content/themes/".basename($config["theme_dir"])."/"; 
     91$config['theme_url'] = $config['gallery_url']."plog-content/themes/".basename($config['theme_dir'])."/"; 
    9292 
    93 $urlarray = parse_url($config["gallery_url"]); 
    94 $config["address"] = $urlarray['scheme'] . '://' . $urlarray['host']; 
     93$urlarray = parse_url($config['gallery_url']); 
     94$config['address'] = $urlarray['scheme'] . '://' . $urlarray['host']; 
    9595 
    9696$config['charset'] = 'utf-8'; 
     
    158158 
    159159 
    160 if (!isset($_SESSION["plogger_sortby"])){ 
    161         $_SESSION["plogger_sortby"] = $config['default_sortby']; 
     160if (!isset($_SESSION['plogger_sortby'])){ 
     161        $_SESSION['plogger_sortby'] = $config['default_sortby']; 
    162162} 
    163163 
    164 if (!isset($_SESSION["plogger_sortdir"])){ 
    165         $_SESSION["plogger_sortdir"] = $config['default_sortdir']; 
     164if (!isset($_SESSION['plogger_sortdir'])){ 
     165        $_SESSION['plogger_sortdir'] = $config['default_sortdir']; 
    166166} 
    167167 
    168 if (!isset($_SESSION["plogger_details"])){ 
    169         $_SESSION["plogger_details"] = 0; 
     168if (!isset($_SESSION['plogger_details'])){ 
     169        $_SESSION['plogger_details'] = 0; 
    170170 
    171171}