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

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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}