Latin-1 rewriting ? [é-è-à]
CaLL Me ZeNy
Posted on 14-02-2010 19:32
Offline
Newbie
Posts: 4
Joined: 14.02.10
Warnings:
Hello everyone - I've recently downloaded PimpedFusion, and tried the SEO Url-Rewriting...
Pretty cool, but I use some Latin-1 characters like à-é-è-î and I can't find the way to replace by a-e-i .
I tried a str_replace in the function clean_subject_urlrewrite or make_url of maincore.php, without success.
Anyone has a solution?
Thanks in advance.
Keep up the good work.
x 1
slaughter
Posted on 14-02-2010 19:53
Offline
Head Developer
Super Admin
Posts: 1091
Joined: 28.12.09
Gender: male
Warnings:
try this:
Code
// Cleanes the Title in Urls for url-rewrite
function clean_subject_urlrewrite($subject) {
$search = array("ä", "Ä", "ü", "Ü", "ö", "Ö", "ß", "&", "€", "RE:-", "á", "à", "é", "è", "î");
$replace = array("ae", "Ae", "ue", "Ue", "oe", "Oe", "ss", "and", "euro", "", "a", "a", "e", "e", "i");
$subject = str_replace($search, $replace, $subject);;
$subject = preg_replace("/[^\d\w]+/", "-", $subject);
$subject = trim($subject, "-");
$subject = strtolower($subject);
return $subject;
}
But I don't know for sure if this works or not.
Edit: It works for me here on this page.
look here:
http://pimped-fus...l#post_334
Edited by slaughter on 14-02-2010 19:59
x 1
CaLL Me ZeNy
Posted on 14-02-2010 20:06
Offline
Newbie
Posts: 4
Joined: 14.02.10
Warnings:
Thanks for your reply, but it doesn't work... :(
Seems that ß, €, RE:-n aren't replaced too.
[Edit]
Strange - I don't understand why it doesn't work for me.
:)
Edited by CaLL Me ZeNy on 14-02-2010 20:19
Signature Sorry for my bad English =)
ritmi
Posted on 14-02-2010 21:04
Offline
Senior Member
Posts: 221
Joined: 06.01.10
Gender: male
Age: 21
Warnings:
do you have our databaze on utf8 or german_latin1 ?
Advertising Bot Posted on 23-05-2012 02:06
Bot Agent Posts: n^xJoined: Always
CaLL Me ZeNy
Posted on 14-02-2010 21:44
Offline
Newbie
Posts: 4
Joined: 14.02.10
Warnings:
My database is on latin1_swedish_ci.
Signature Sorry for my bad English =)
ritmi
Posted on 14-02-2010 21:59
Offline
Senior Member
Posts: 221
Joined: 06.01.10
Gender: male
Age: 21
Warnings:
make it
utf8_unicode_ci for standart
test page with uft8_unicode_ci
http://loove.kilu...tml#post_3
Edited by ritmi on 14-02-2010 22:00
x 1
CaLL Me ZeNy
Posted on 15-02-2010 11:18
Offline
Newbie
Posts: 4
Joined: 14.02.10
Warnings:
I converted my database and all tables to uft8_unicode_ci, but the result is the same...
Too bad, I think I'll remove the news subjects from the URL.
Thanks anyway.
[Edit]
I reconverted to latin1_general_ci, and everything works well :)
Thanks !
Edited by CaLL Me ZeNy on 15-02-2010 11:39
Signature Sorry for my bad English =)
ritmi
Posted on 15-02-2010 14:44
Offline
Senior Member
Posts: 221
Joined: 06.01.10
Gender: male
Age: 21
Warnings: