Add transliteration slug (friendly url)
Hi voro,
it implemented, I used iconv (http://php.net/manual/en/book.iconv.php), may be you don't have installed this module.
You have your own server ?
it implemented, I used iconv (http://php.net/manual/en/book.iconv.php), may be you don't have installed this module.
You have your own server ?
Code: Select all
public static function cleanUrl($string, $separator='-')
{
if(function_exists('iconv')) {
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
}
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
$string = trim($string, '-');
$string = self::lowercase($string);
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
return $string;
}
iconv is installed, see the phpinfo http://bludit.ml/phpinfo.phpdiego wrote:Hi voro,
it implemented, I used iconv (http://php.net/manual/en/book.iconv.php), may be you don't have installed this module.
You have your own server ?
try enter title of post in cyrillic lang eg. тест
http://bludit.ml/admin
pass: 326764
Yes I saw the problem.. I am searching a solution for it, have you some recomendation ? thanks
Good works only character mapdiego wrote:Yes I saw the problem.. I am searching a solution for it, have you some recomendation ? thanks
Code: Select all
array (
'А'=>'a','Б'=>'b','В'=>'v',
'Г'=>'g','Д'=>'d','Е'=>'e','Ё'=>'yo','Ж'=>'zh',
'З'=>'z','И'=>'i','Й'=>'j','К'=>'k','Л'=>'l',
'М'=>'m','Н'=>'n','О'=>'o','П'=>'p','Р'=>'r',
'С'=>'s','Т'=>'t','У'=>'u','Ф'=>'f','Х'=>'h',
'Ц'=>'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','х'=>'h','ц'=>'c','ч'=>'ch',
'ш'=>'sh','щ'=>'shh','ъ'=>'','ы'=>'y','ь'=>'',
'э'=>'e','ю'=>'yu','я'=>'ya',' '=>'-','-'=>'-','»'=>''
);
Yes I remember the array list, but I'm looking for another way.
Some CMS uses the slug directly тест instead test, I'm thinking uses characters in UTF in the URI.
Some CMS uses the slug directly тест instead test, I'm thinking uses characters in UTF in the URI.
Done, after a while searching a better solution on Google, I used the array with the characters.
Please download the version from Github and let me know if there are some error.
thanks
Please download the version from Github and let me know if there are some error.
thanks
I move the topic to General forum.
Hello! Help me!
Please tell me how to add automatic transliteration for slug (friendly URL) in Bludit v3.15.0? Unfortunately, I didn't understand how the issue was resolved in this topic. I'm not very familiar with PHP and English language.
Please tell me how to add automatic transliteration for slug (friendly URL) in Bludit v3.15.0? Unfortunately, I didn't understand how the issue was resolved in this topic. I'm not very familiar with PHP and English language.