Morpheus NS
06-20-2011, 09:51 AM
Hello, everyone! I am using .htaccess to make my links simpler, but there is a problem.
My forum is in serbian, and I have a problem because my thread names sometimes contain accented letters (š, ć, đ, etc.). Those letters look different in URLs, or doesn't show at all. I am trying to replace them with non-accented letters (s, c, dj in this case) which are easily readable in my language. I got this code:
function google($input){
setlocale(LC_ALL, "en_US.UTF8");
$input = str_replace(array("'", "-", "đ"), array("", "", "dj"), $input);
$input = mb_convert_case($input, MB_CASE_LOWER, "UTF-8");
$input = iconv("UTF-8", "ASCII//TRANSLIT", $input);
$input = preg_replace("#[^a-zA-Z0-9]+#", "-", $input);
$input = preg_replace("#(-){2,}#", "$1", $input);
$input = trim($input, "-");
return $input;
}
which should do the trick for me, but I don't know where (in which file) do I have to put this code to work. Any idea? I am using vBulletin 4.1.1
My forum is in serbian, and I have a problem because my thread names sometimes contain accented letters (š, ć, đ, etc.). Those letters look different in URLs, or doesn't show at all. I am trying to replace them with non-accented letters (s, c, dj in this case) which are easily readable in my language. I got this code:
function google($input){
setlocale(LC_ALL, "en_US.UTF8");
$input = str_replace(array("'", "-", "đ"), array("", "", "dj"), $input);
$input = mb_convert_case($input, MB_CASE_LOWER, "UTF-8");
$input = iconv("UTF-8", "ASCII//TRANSLIT", $input);
$input = preg_replace("#[^a-zA-Z0-9]+#", "-", $input);
$input = preg_replace("#(-){2,}#", "$1", $input);
$input = trim($input, "-");
return $input;
}
which should do the trick for me, but I don't know where (in which file) do I have to put this code to work. Any idea? I am using vBulletin 4.1.1