Changeset 560 for trunk/plog-load-config.php
- Timestamp:
- 07/15/08 17:05:24 (5 months ago)
- Files:
-
- 1 modified
-
trunk/plog-load-config.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-load-config.php
r555 r560 42 42 $config = mysql_fetch_assoc($result); 43 43 44 $config[ "basedir"] = $plog_basedir;44 $config['basedir'] = $plog_basedir; 45 45 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']; 48 48 49 49 // Try to figure out whether we are embedded (for example running from Wordpress) … … 52 52 if (!defined('PLOGGER_EMBEDDED') || PLOGGER_EMBEDDED=='') { 53 53 if (dirname(__FILE__) != dirname(realpath($_SERVER['SCRIPT_FILENAME'])) && strpos($_SERVER['SCRIPT_FILENAME'],"plog-admin") === false) { 54 $config[ "embedded"] = 1;54 $config['embedded'] = 1; 55 55 // disable our own cruft-free urls, because the URL has already been processed 56 56 // by WordPress 57 $config[ "use_mod_rewrite"] = 0;57 $config['use_mod_rewrite'] = 0; 58 58 trace('Plogger is embedded'); 59 59 trace('dirname: ' . dirname(__FILE__)); … … 61 61 trace('realpath($_SERVER[\'SCRIPT_FILENAME\'])' .': '. realpath($_SERVER['SCRIPT_FILENAME'])); 62 62 } else { 63 $config[ "embedded"] = 0;63 $config['embedded'] = 0; 64 64 // 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'],"/")) . "/"; 67 67 } 68 68 } … … 70 70 // Set PLOGGER_EMBEDDED to 1 in config file to overrule automatic test 71 71 if (PLOGGER_EMBEDDED == '1') { 72 $config[ "embedded"] = 1;73 $config[ "use_mod_rewrite"] = 0;72 $config['embedded'] = 1; 73 $config['use_mod_rewrite'] = 0; 74 74 trace('Plogger is embedded'); 75 75 // Set PLOGGER_EMBEDDED to 0 in case Plogger inclusion in different folder location, but does not already use mod_rewrite paths 76 76 } else { 77 $config[ "embedded"] = 0;77 $config['embedded'] = 0; 78 78 // 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'],"/")) . "/"; 81 81 } 82 82 } … … 85 85 // remove plog-admin/ from the end, if present .. is there a better way to determine the full url? 86 86 // 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/"));87 if (strpos($config['baseurl'], "plog-admin/")) { 88 $config['baseurl'] = substr($config['baseurl'],0,strpos($config['baseurl'], "plog-admin/")); 89 89 } 90 90 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'])."/"; 92 92 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']; 95 95 96 96 $config['charset'] = 'utf-8'; … … 158 158 159 159 160 if (!isset($_SESSION[ "plogger_sortby"])){161 $_SESSION[ "plogger_sortby"] = $config['default_sortby'];160 if (!isset($_SESSION['plogger_sortby'])){ 161 $_SESSION['plogger_sortby'] = $config['default_sortby']; 162 162 } 163 163 164 if (!isset($_SESSION[ "plogger_sortdir"])){165 $_SESSION[ "plogger_sortdir"] = $config['default_sortdir'];164 if (!isset($_SESSION['plogger_sortdir'])){ 165 $_SESSION['plogger_sortdir'] = $config['default_sortdir']; 166 166 } 167 167 168 if (!isset($_SESSION[ "plogger_details"])){169 $_SESSION[ "plogger_details"] = 0;168 if (!isset($_SESSION['plogger_details'])){ 169 $_SESSION['plogger_details'] = 0; 170 170 171 171 }
