Hi,
My webiste is in Vietnamese and when I post an article via CB, an alias of the article is created but it change all special alias into a dash '-' I want the specials characters to be relevant Latin characters and I tried to change the following code in the file components/com_comprofiler/plugin/user/plug_cbblogs/models/joomla25.php
private static function getTitleAlias( $title )
{
$alias = str_replace( '-', ' ', $title );
$alias = trim( cbIsoUtf_strtolower( $alias ) );
$alias = preg_replace( '/(\s|[^A-Za-z0-9\-])+/', '-', $alias );
$alias = trim( $alias, '-' );
return $alias;
}
into following code:
private static function getTitleAlias( transliterateString( $title ) )
{
$transliterationTable = array('á' => 'a', 'Á' => 'A', 'à' => 'a', 'À' => 'A', 'ả' => 'a', 'Ả' => 'A', 'ã' => 'a', 'Ã' => 'A', 'ạ' => 'a', 'Ạ' => 'A', 'ắ' => 'a', 'Ắ' => 'A', 'ằ' => 'a', 'Ằ' => 'A', 'ẳ' => 'a', 'Ẳ' => 'A', 'ẵ' => 'a', 'Ẵ' => 'A', 'ặ' => 'a', 'Ặ' => 'A', 'ấ' => 'a', 'Ấ' => 'A', 'ầ' => 'a', 'Ầ' => 'A', 'ẩ' => 'a', 'Ẩ' => 'A', 'ẫ' => 'a', 'Ẫ' => 'A', 'ậ' => 'a', 'Ậ' => 'A', 'đ' => 'd', 'Đ' => 'D', 'ó' => 'o', 'Ó' => 'O', 'ò' => 'o', 'Ò' => 'O', 'ỏ' => 'o', 'Ỏ' => 'O', 'õ' => 'o', 'Õ' => 'O', 'ọ' => 'o', 'Ọ' => 'O', 'ố' => 'o', 'Ố' => 'O', 'ồ' => 'o', 'Ồ' => 'O', 'ổ' => 'o', 'Ổ' => 'O', 'ỗ' => 'o', 'Ỗ' => 'O', 'ộ' => 'o', 'Ộ' => 'O', 'ớ' => 'o', 'Ớ' => 'O', 'ờ' => 'o', 'Ờ' => 'O', 'ở' => 'o', 'Ở' => 'O', 'ỡ' => 'o', 'Ỡ' => 'O', 'ợ' => 'o', 'Ợ' => 'O', 'é' => 'e', 'É' => 'E', 'è' => 'e', 'È' => 'E', 'ẻ' => 'e', 'Ẻ' => 'E', 'ẽ' => 'e', 'Ẽ' => 'E', 'ẹ' => 'e', 'Ẹ' => 'E', 'ế' => 'e', 'Ế' => 'E', 'ề' => 'e', 'Ề' => 'E', 'ể' => 'e', 'Ể' => 'E', 'ễ' => 'e', 'Ễ' => 'E', 'ệ' => 'e', 'Ệ' => 'E', 'í' => 'i', 'Í' => 'I', 'ì' => 'i', 'Ì' => 'I', 'ỉ' => 'i', 'Ỉ' => 'I', 'ĩ' => 'i', 'Ĩ' => 'I', 'ị' => 'i', 'Ị' => 'I', 'ú' => 'u', 'Ú' => 'U', 'ù' => 'u', 'Ù' => 'U', 'ủ' => 'u', 'Ủ' => 'U', 'ũ' => 'u', 'Ũ' => 'U', 'ụ' => 'u', 'Ụ' => 'U', 'ứ' => 'u', 'Ứ' => 'U', 'ừ' => 'u', 'Ừ' => 'U', 'ử' => 'u', 'Ử' => 'U', 'ữ' => 'u', 'Ữ' => 'U', 'ự' => 'u', 'Ự' => 'U', ' ' => '-', "'" => '', '&' => '');
$title = str_replace(array_keys($transliterationTable), array_values($transliterationTable), $title);
$alias = str_replace( '-', ' ', $title );
$alias = trim( cbIsoUtf_strtolower( $alias ) );
$alias = preg_replace( '/(\s|[^A-Za-z0-9\-])+/', '-', $alias );
$alias = trim( $alias, '-' );
return $alias;
}
But it makes the site down.
Can anybody know how to correct it?
Thanks,
Hai