Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
requests-topic
add sanitize_title action in sf_create_slug
Avatar
unodj
Guest
Guests
Mar 4, 2009 - 11:23 am

Hi!

Please, add in file sf-slugs.php default WP filter “sanitize_title”

Then in the topic, forums etc, will be able to create pretty-permalinks in languages other than English

Here is an example of the use of:
sf-slugs.php
function sf_create_slug($title, $type)
{
   $title = apply_filters('sanitize_title',$title);   // unodj added
    $title = sf_check_slug_unique($title, $type);
    return $title;
}
most popular plugin rus-to-lat.php
$iso = array(
   “Є”=>”YE”,”І”=>”I”,”Ѓ”=>”G”,”і”=>”i”,”№”=>”#”,”є”=>”ye”,”ѓ”=>”g”,
   “А”=>”A”,”Б”=>”B”,”В”=>”V”,”Г”=>”G”,”Д”=>”D”,
   “Е”=>”E”,”Ё”=>”YO”,”Ж”=>”ZH”,
   “З”=>”Z”,”И”=>”I”,”Й”=>”J”,”К”=>”K”,”Л”=>”L”,
   “М”=>”M”,”Н”=>”N”,”О”=>”O”,”П”=>”P”,”Р”=>”R”,
   “С”=>”S”,”Т”=>”T”,”У”=>”U”,”Ф”=>”F”,”Х”=>”X”,
   “Ц”=>”C”,”Ч”=>”CH”,”Ш”=>”SH”,”Щ”=>”SHH”,”Ъ”=>”'”,
   “Ы”=>”Y”,”Ь”=>”",”Э”=>”E”,”Ю”=>”YU”,”Я”=>”YA”,
   “а”=>”a”,”б”=>”b”,”в”=>”v”,”г”=>”g”,”д”=>”d”,
   “е”=>”e”,”ё”=>”yo”,”ж”=>”zh”,
   “з”=>”z”,”и”=>”i”,”й”=>”j”,”к”=>”k”,”л”=>”l”,
   “м”=>”m”,”н”=>”n”,”о”=>”o”,”п”=>”p”,”р”=>”r”,
   “с”=>”s”,”т”=>”t”,”у”=>”u”,”ф”=>”f”,”х”=>”x”,
   “ц”=>”c”,”ч”=>”ch”,”ш”=>”sh”,”щ”=>”shh”,”ъ”=>”",
   “ы”=>”y”,”ь”=>”",”э”=>”e”,”ю”=>”yu”,”я”=>”ya”,”«”=>”",”»”=>”",”—”=>”-”
  );
function sanitize_title_with_translit($title) {
return strtr($title, $iso);
}
add_action('sanitize_title', 'sanitize_title_with_translit', 0);
Thanks, and great work! [Image Can Not Be Found]

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Mar 5, 2009 - 1:23 am

I had not heard of this plugin but it does seem like a good idea.
I will raise a ticket for discussion and see what we can do for 4.1

andy-signature.png
YELLOW
SWORDFISH
Avatar
unodj
Guest
Guests
Mar 5, 2009 - 8:26 am

This is plug-in for transliterating words in other languages

you speak and write in English, you do not need a plugin like rus-to-lat, it is natural that you have not heard about him [Image Can Not Be Found]

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Mar 5, 2009 - 8:51 am

I have raised a ticket to get this introduced.

andy-signature.png
YELLOW
SWORDFISH
Avatar
unodj
Guest
Guests
Mar 5, 2009 - 9:08 am

since we are talking about changes that relate to other languages,
want to add about a file sf-postsupport.php
there is a lines
$htmlmsg .= '< p style=" f o nt-f am ily:Arial;padding:0 5px;">< a href="'.$newpost['url'].'">' . sprintf(__('Post: %s', "sforum"), '< /a ></ p >< div style="padding:2px 5px;">'.utf8_encode($post_content) ) . "</ div >";
and
$emessage .= sprintf(__('Post: %s', "sforum"), "\\r\\n" . utf8_encode($post_content) ).$eol.$eol;

function utf8_encode() breaks russian letters in the letters that are sent to subscribers
I changed them to:
$htmlmsg .= '< p style=" f o nt-family:Arial;padding:0 5px;"><a href="'.$newpost['url'].'">' . sprintf(__('Post: %s', "sforum"), '</a></p>< div style="p adding:2px 5px;">'.$post_content ) . "</ div >";
and
$emessage .= sprintf(__('Post: %s', "sforum"), "\\r\\n" . $post_content ).$eol.$eol;
because WP gives a strings in utf-8 and there is no meaning to convert from utf-8 encoding to utf-8 encoding

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626