- $wht = $target."\$1/wht/";
- $target2 = str_replace("/", "\\/", $target);
- $test = preg_replace("/".$target2."(.*)&what=/i", $wht, $test);
-
- if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test)))
- {
- // Replace data when rallye extension is active
- // Add more if you need more like these entries
- $REPLACE = array("rallye", "activate", "auto", "notify", "sub");
- foreach ($REPLACE as $var)
- {
- // This will replace "&var=" to "/var/"
- $test = preg_replace("/&".$var."=/i", "/".$var."/", $test);
- }
- }
-
- // Simple from->to replacements
- $REPLACE = array(
- 'search' => array("u_id", "url", "page", "offset", "mid", "bid", "sub", "home"),
- 'replace' => array("u" , "url", "page", "offset", "m" , "b" , "s" , "h")
- );
-
- if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test)))
- {
- // Replace &admin= with "/aid/"
- $REPLACE['search'][] = "admin";
- $REPLACE['replace'][] = "aid";
- }
-
- // Replace all array elements through
- foreach ($REPLACE['search'] as $k => $v)
- {
- if (eregi("$v=", $test))
- {
- // Replace &u_id= with /u/
- $test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test);
- }
- }