Changeset 560
- Timestamp:
- 07/15/08 17:05:24 (4 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
plog-admin/includes/install-functions.php (modified) (1 diff)
-
plog-globals.php (modified) (1 diff)
-
plog-includes/plog-functions.php (modified) (4 diffs)
-
plog-load-config.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-admin/includes/install-functions.php
r555 r560 304 304 305 305 $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 } 306 310 // verify that gallery URL contains a trailing slash. if not, add one. 307 311 if ($config['gallery_url']{strlen($config['gallery_url'])-1} != '/'){ -
trunk/plog-globals.php
r550 r560 1 1 <?php 2 ini_set('include_path', ini_get('include_path'));2 @ini_set('include_path', ini_get('include_path')); 3 3 @ini_set("arg_separator.output","&"); 4 4 if (intval(ini_get("max_execution_time")) < 300){ -
trunk/plog-includes/plog-functions.php
r559 r560 792 792 function get_album_by_name($name) { 793 793 $sql = "SELECT * 794 FROM `".TABLE_PREFIX."albums s`794 FROM `".TABLE_PREFIX."albums` 795 795 WHERE `name` = '".mysql_real_escape_string($name)."'"; 796 796 $result = run_query($sql); … … 1260 1260 } 1261 1261 1262 // Ardamis fix from diffuser theme, don't quite understand why it's needed1263 if ( !$plaintext){1264 $rv = str_replace("& id","&id",$rv);1262 // replace & with & if outputting to email 1263 if ($plaintext !== false){ 1264 $rv = str_replace("&","&",$rv); 1265 1265 } 1266 1266 … … 1336 1336 $msg .= plog_tr("Comment") . ":\n$comment\n\n"; 1337 1337 $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); 1339 1339 $msg .= $picurl; 1340 1340 $headers = "From: $author <$email>\r\n"; … … 1345 1345 $config['admin_email'], 1346 1346 '[' . SmartStripSlashes($config['gallery_name']) . '] ' . plog_tr('New Comment From') . ' ' . $author, 1347 $msg,1347 SmartStripSlashes($msg), 1348 1348 $headers); 1349 1349 } -
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 }
