you can now enjoy pathinfo URLs! set PRETTYURLS_PATHINFO to true in the plugin.prettyurls.php; if it'll work change was trivial (please report any strange issues, it involved altering defaults.php)

This commit is contained in:
real_nowhereman 2008-04-11 19:27:05 +00:00
parent c1cb4e10d7
commit ff3fe3cd0f
3 changed files with 12 additions and 10 deletions

View File

@ -101,7 +101,7 @@
$_SERVER['REQUEST_URI'] = 'http://localhost/flatpress/';
#define('BLOG_ROOT', dirname($_SERVER['PHP_SELF']) . '/');
define('BLOG_ROOT', ('/'==($v=dirname($_SERVER['PHP_SELF']))? $v : $v.'/') );
define('BLOG_ROOT', ('/'==($v=dirname($_SERVER['SCRIPT_NAME']))? $v : $v.'/') );
define('BLOG_BASEURL', 'http://'.$_SERVER['HTTP_HOST']. BLOG_ROOT);

View File

@ -243,7 +243,7 @@
// avoid compiled tpl collision (i.e. change theme without this and cry)
$smarty->compile_id = md5($fp_config['general']['theme']);
$smarty->template_dir = THEMES_DIR . $fp_config['general']['theme'] . '/';
$smarty->template_dir = ABS_PATH . THEMES_DIR . $fp_config['general']['theme'] . '/';
$loggedin = user_loggedin();

View File

@ -12,6 +12,7 @@ Author URI: http://www.nowhereland.it
* Place where the index is stored
*/
define('PRETTYURLS_TITLES', true);
define('PRETTYURLS_PATHINFO', false);
define('PRETTYURLS_CACHE', CACHE_DIR . '%%prettyurls-index.tmp');
define('PRETTYURLS_CATS', CACHE_DIR . '%%prettyurls-cats.tmp');
@ -80,7 +81,7 @@ class Plugin_PrettyURLs {
$date = date_from_id($id);
// yeah, hackish, I know...
return BLOG_BASEURL . "20{$date['y']}/{$date['m']}/{$date['d']}/$title/";
return $this->baseurl . "20{$date['y']}/{$date['m']}/{$date['d']}/$title/";
}
function commentlink($str, $id) {
@ -89,7 +90,7 @@ class Plugin_PrettyURLs {
}
function feedlink($str, $type) {
return BLOG_BASEURL . "feed/{$type}/";
return $this->baseurl . "feed/{$type}/";
}
@ -100,23 +101,23 @@ class Plugin_PrettyURLs {
function staticlink($str, $id) {
return BLOG_BASEURL . "$id/";
return $this->baseurl . "$id/";
}
function categorylink($str, $catid) {
if (PRETTYURLS_TITLES) {
if (@$this->categories[$catid])
return BLOG_BASEURL . "category/{$this->categories[$catid]}/";
return $this->baseurl . "category/{$this->categories[$catid]}/";
else return $str;
} else {
return BLOG_BASEURL . "category/{$catid}/";
return $this->baseurl . "category/{$catid}/";
}
}
function yearlink($str, $y) {
return BLOG_BASEURL . "20$y/";
return $this->baseurl . "20$y/";
}
function monthlink($str, $y, $m) {
@ -237,6 +238,7 @@ class Plugin_PrettyURLs {
global $fp_params;
$this->fp_params =& $fp_params;
$this->baseurl = PRETTYURLS_PATHINFO? BLOG_BASEURL . 'index.php/' : BLOG_BASEURL;
if (PRETTYURLS_TITLES) {
if ($f = io_load_file(PRETTYURLS_CACHE))
@ -406,7 +408,7 @@ class Plugin_PrettyURLs {
if ($q->single) {
$date = date_from_id($id);
$title = sanitize_title($caption);
$url = BLOG_BASEURL . "20{$date['y']}/{$date['m']}/{$date['d']}/$title/";
$url = $this->baseurl . "20{$date['y']}/{$date['m']}/{$date['d']}/$title/";
if ($v>0)
$caption = $caption . ' &raquo ';
@ -422,7 +424,7 @@ class Plugin_PrettyURLs {
/* todo: clean up this mess... which means cleaning up the mess above. oh, my! */
$l = BLOG_BASEURL;
$l = $this->baseurl ;
if ( ( is_numeric($cid = @$this->fp_params['category']) ) ||