SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3128
|
Posted: Tue Jul 10, 2007 6:24 pm Post subject: Re: Not Change After Upgrade the last version SEO |
|
|
In phpbb_seo_class.php, the one from the last version, you'll find :
| Code: | function format_url( $url, $type = 'topic' ) {
$url = preg_replace("`\[.*\]`U","",$url);
$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
$url = htmlentities($url, ENT_COMPAT, $this->encoding);
$url = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $url );
$url = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $url);
$url = ( $url == "" ) ? $type : strtolower(trim($url, '-'));
return $url;
} |
The best would be to keep the code you where previously using for this function, as I guess it already was modded a bit for your needs.
The original 0.2.2 code for this is :
| Code: | function format_url( $url, $type = 'topic' ) {
$url = preg_replace("(\[.*\])U","",$url);
$find = array('"','&','<','>','\r\n','\n',);
$url = str_replace ($find, '-', $url);
$url = str_replace ('ß', 'ss', $url);
$url = str_replace (array('ö','Ö'), 'oe', $url);
$url = str_replace (array('ä','Ä'), 'ae', $url);
$url = str_replace (array('ü','Ü'), 'ue', $url);
$find = "ÀÁÂÃÅàáâãåÒÓÔÕØòóôõøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛùúûÿÑñ";
$replace = "aaaaaaaaaaooooooooooeeeeeeeecciiiiiiiiuuuuuuynn";
$url = strtr($url,$find,$replace);
$url = strtolower($url);
$url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
$url = preg_replace("`([\-])+`", "\\1", $url);
$url = trim($url, '-');
$url = ( $url == "" ) ? $type : $url;
return $url;
} |
|
_________________
|
|