First thank you AshDigg, Yankidank & co for this great CMS. And beatniak for sharing the Mollio-Beat Template 1.0. With the beta 7 release and the mollio template, I've managed to get a Faroese languaged 'digg-clone' almost totally working, even if I'm very much a newbie. See http://www.sjey.com/
But I'm having trouble with especially the RSS feeds. Because of some special nordic characters like ð and ø and á, I've had to replace the UTF-8 charset/encoding strewn around in the Pligg source code with ISO-8859-1. And now it looks like it is working everywhere but in the RSS feeds (and maybe the 'friendly URL's).
I've tried replacing the UTF-8 in rss2.php with ISO-8859-1, and although it now looks better when looking at eg. the http://www.sjey.com/rss2.php?status=all xml-file, the nordic characters get replaced with '�' when added for example as Live Bookmarks in Firefox. That is my issue.
Also, as mentioned, all special characters get dropped in my friendly URLs. I guess that this is because of some similar issue as with the RSS feeds. And I understand that I maybe shouldn't have ð and ø and ý's in my URL. But could it be replaced with some substitute character (eg. ð -> d) ?
I'm SO close now, to have this site ready for launch. So please please help me :-)
(and by the way, in this forum it is REALLY hard to search for posts about RSS, as the word is too short to be used as a search word)
![]() |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| RSS and localization |
| ||||
|
I just realized that when concerning category URLs, Pligg works fine with non-english characters. OK, the URL for eg. my category 'Løgið' gets changed from http://www.sjey.com/index.php?category=Løgið to http://www.sjey.com/index.php?category=L%F8gi%F0 in the browser address bar. But that is a small price to pay, when they both still work, and I don't have to try to read a link like (if we were talking the friendly story URLs) "http://www.sjey.com/index.php?category=Lgi". So, somebody with programming skills... how do I make the friendly URLs work in the same way as the category URLs? |
| |||
| special chars in friendly urls problem
hi, (sorry, my english is very poor :( ) i had a several problem with special central european characters in a title. function makeUrlFriendly in utils.php removes non english characters, and when a word in a title contains only 1-2 "english" characters the friendly url looks like ugly :( I write a second function undiacrtc() wich replaces special chars to regular. example: á => a etc.. i call this function before preg_replace in makeUrlFriendly() function.: function makeUrlFriendly($input) { // this function taken from http://us2.php.net/manual/en/functio...lace.php#54517 // then modified with the help of "j0zf" and "caomhin" Global $db; $input = undiacrtc(substr($input, 0, 240)); $output = preg_replace("/\b(an?d?|f?o(r|f)|the)\b/i" , "" , $input); $output = trim($output); // Replace spaces with underscores $output = preg_replace("/\s/e" , "_" , $output); // Remove non-word characters $output = preg_replace("/\W/e" , "" , $output); // $output = preg_replace( '/(_a_|_an_|_the_|_and_|_or_|_of_|_for_)/i', '_', $output ); $output = str_replace("_", "-", $output); $output = str_replace("--", "-", $output); $n = $db->get_var("SELECT count(*) FROM links WHERE link_title_url like '$output%'"); if ($n > 0) {return $output . "-$n";} else {return $output;} } // my function is: function undiacrtc( $text ) { $replace=array( 'á' => 'a', 'Á' => 'A', 'é' => 'e', 'É' => 'E', 'í' => 'i', 'Í' => 'I', 'ó' => 'o', 'Ó' => 'O', 'ú' => 'u', 'Ú' => 'U', 'ü' => 'u', 'Ü' => 'U', 'ö' => 'o', 'Ö' => 'O', 'õ' => 'o', 'Õ' => 'O', 'û' => 'u', 'Û' => 'U', '¾' => 'l', 'š' => 's', 'è' => 'c', '?' => 't', 'ž' => 'z', 'ý' => 'y', 'ô' => 'o', 'ä' => 'a', 'ò' => 'n', 'å' => 'l', '¼' => 'l', 'Š' => 's', 'È' => 'C', '?' => 'T', 'Ž' => 'Z', 'Ý' => 'Y', 'Ò' => 'N', 'Å' => 'L', 'ì' => 'e', 'Ì' => 'E', ); foreach ($replace as $key => $value) { $text = ereg_replace($key, $value, $text ); } return $text; } example title: starý článok before my modification the url looks like: story.php?title=star-lnok after my modification: story.php?title=stary-clanok |
| ||||
|
thank you jalso, that works great :)
|
| |||
|
Jalso, could you explain a little more your method, or put your utils.php file for download, because I try it but it does not work : either I get an error or it does not change anything in the urls.
|
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |





Linear Mode
