//
function REWRITE_LINKS ($HTML) {
- global $_CONFIG;
-
// Skip rewriting for the admin area (which search engine may enter here???)
if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML;
// Strip slashes with double-backslashes for the preg_replace() function
- $URL = str_replace("/", "\\/", URL);
+ $URL = str_replace("/", "\\/", constant('URL'));
// Generate target URL
- $target = URL."/cms/";
+ $target = constant('URL')."/cms/";
// Convert modules.php?module=...
$test = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML);
if (eregi(SERVER_URL, $test)) {
// Konvert URLs from my server
- $URL = str_replace("/", "\\/", SERVER_URL);
- $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", SERVER_URL."/cms/", $test);
+ $URL = str_replace("/", "\\/", constant('SERVER_URL'));
+ $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", constant('SERVER_URL')."/cms/", $test);
} // END - if
// Strip slashes as above for the main URL
// Simple from->to replacements
$REPLACE = array(
- 'search' => array("u_id", "url", "page", "offset", "mid", "bid", "sub", "home"),
+ 'search' => array("uid", "url", "page", "offset", "mid", "bid", "sub", "home"),
'replace' => array("u" , "url", "page", "offset", "m" , "b" , "s" , "h")
);
// Replace all array elements through
foreach ($REPLACE['search'] as $k => $v) {
if (eregi("$v=", $test)) {
- // Replace &u_id= with /u/
+ // Replace &uid= with /u/
$test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test);
} // END - if
} // END - foreach