joomla-500x357

Với Joomla 1.5

Mở tập tin:
/libraries/joomla/filter/filteroutput.php

Tìm dòng:

function stringURLSafe($string)
{
//remove any ‘-‘ from the string they will be used as concatonater
$str = str_replace(‘-‘, ‘ ‘, $string);$lang =& JFactory::getLanguage();
$str = $lang->transliterate($str);// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(array(‘/\s+/’,’/[^A-Za-z0-9\-]/’), array(‘-‘,”), $str);

// lowercase and trim
$str = trim(strtolower($str));
return $str;
}

Xóa hết các dòng này đi và thay thế bằng:

Mã:

function stringURLSafe($string)
{
$trans = array(
“đ”=>”d”,”ă”=>”a”,”â”=>”a”,”á”=>”a”,”à”=>”a”,
“ả”=>”a”,”ã”=>”a”,”ạ”=>”a”,
“ấ”=>”a”,”ầ”=>”a”,”ẩ”=>”a”,”ẫ”=>”a”,”ậ”=>”a”,
“ắ”=>”a”,”ằ”=>”a”,”ẳ”=>”a”,”ẵ”=>”a”,”ặ”=>”a”,
“é”=>”e”,”è”=>”e”,”ẻ”=>”e”,”ẽ”=>”e”,”ẹ”=>”e”,
“ế”=>”e”,”ề”=>”e”,”ể”=>”e”,”ễ”=>”e”,”ệ”=>”e”,
“í”=>”i”,”ì”=>”i”,”ỉ”=>”i”,”ĩ”=>”i”,”ị”=>”i”,
“ư”=>”u”,”ô”=>”o”,”ơ”=>”o”,”ê”=>”e”,
“Ư”=>”u”,”Ô”=>”o”,”Ơ”=>”o”,”Ê”=>”e”,
“ú”=>”u”,”ù”=>”u”,”ủ”=>”u”,”ũ”=>”u”,”ụ”=>”u”,
“ứ”=>”u”,”ừ”=>”u”,”ử”=>”u”,”ữ”=>”u”,”ự”=>”u”,
“ó”=>”o”,”ò”=>”o”,”ỏ”=>”o”,”õ”=>”o”,”ọ”=>”o”,
“ớ”=>”o”,”ờ”=>”o”,”ở”=>”o”,”ỡ”=>”o”,”ợ”=>”o”,
“ố”=>”o”,”ồ”=>”o”,”ổ”=>”o”,”ỗ”=>”o”,”ộ”=>”o”,
“ú”=>”u”,”ù”=>”u”,”ủ”=>”u”,”ũ”=>”u”,”ụ”=>”u”,
“ứ”=>”u”,”ừ”=>”u”,”ử”=>”u”,”ữ”=>”u”,”ự”=>”u”,
“ý”=>”y”,”ỳ”=>”y”,”ỷ”=>”y”,”ỹ”=>”y”,”ỵ”=>”y”,
“Ý”=>”Y”,”Ỳ”=>”Y”,”Ỷ”=>”Y”,”Ỹ”=>”Y”,”Ỵ”=>”Y”,
“Đ”=>”D”,”Ă”=>”A”,””=>”A”,”Á”=>”A”,”À”=>”A”,
“Ả”=>”A”,”Ô=>”A”,”Ạ”=>”A”,
“Ấ”=>”A”,”Ầ”=>”A”,”Ẩ”=>”A”,”Ẫ”=>”A”,”Ậ”=>”A”,
“Ắ”=>”A”,”Ằ”=>”A”,”Ẳ”=>”A”,”Ẵ”=>”A”,”Ặ”=>”A”,
“É”=>”E”,”È”=>”E”,”Ẻ”=>”E”,”Ẽ”=>”E”,”Ẹ”=>”E”,
“Ế”=>”E”,”Ề”=>”E”,”Ể”=>”E”,”Ễ”=>”E”,”Ệ”=>”E”,
“Í”=>”I”,”Ì”=>”I”,”Ỉ”=>”I”,”Ĩ”=>”I”,”Ị”=>”I”,
“Ư”=>”U”,”Ô”=>”O”,”Ơ”=>”O”,”Ê”=>”E”,
“Ư”=>”U”,”Ô”=>”O”,”Ơ”=>”O”,”Ê”=>”E”,
“Ú”=>”U”,”Ù”=>”U”,”Ủ”=>”U”,”Ũ”=>”U”,”Ụ”=>”U”,
“Ứ”=>”U”,”Ừ”=>”U”,”Ử”=>”U”,”Ữ”=>”U”,”Ự”=>”U”,
“Ó”=>”O”,”Ò”=>”O”,”Ỏ”=>”O”,”Õ”=>”O”,”Ọ”=>”O”,
“Ớ”=>”O”,”Ờ”=>”O”,”Ở”=>”O”,”Ỡ”=>”O”,”Ợ”=>”O”,
“Ố”=>”O”,”Ồ”=>”O”,”Ổ”=>”O”,”Ỗ”=>”O”,”Ộ”=>”O”,
“Ú”=>”U”,”Ù”=>”U”,”Ủ”=>”U”,”Ũ”=>”U”,”Ụ”=>”U”,
“Ứ”=>”U”,”Ừ”=>”U”,”Ử”=>”U”,”Ữ”=>”U”,”Ự”=>”U”,);//remove any ‘-‘ from the string they will be used as concatonater
$str = str_replace(‘-‘, ‘ ‘, $string);$str = strtr($str, $trans);
$lang =& JFactory::getLanguage();
$str = $lang->transliterate($str);

// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(array(‘/\s+/’,’/[^A-Za-z0-9\-]/’), array(‘-‘,”), $str);

// lowercase and trim
$str = trim(strtolower($str));
return $str;
}

Sau khi sửa xong thì save file này lại. Tuy nhiên việc sửa đổi này chỉ có hiệu lực đối với các bài viết từ nay về sau mà thôi, còn các bài viết trước vẫn còn bị lỗi. Bạn phải mở (Edit) bài viết ra và xóa hết toàn bộ ký tự trong ô Alias (nằm ngay phía dưới Title) và nhấn Save (hoặc Apply) các lỗi sẽ được tự động sửa.

Với Joomla 2.x và Joomla 3.x

Mở tập tin /libraries/joomla/filter/output.php

Tìm dòng:

public static function stringURLSafe($string)
{
// remove any ‘-‘ from the string since they will be used as concatenaters
$str = str_replace(‘-‘, ‘ ‘, $string);$lang = JFactory::getLanguage();
$str = $lang->transliterate($str);

// Trim white spaces at beginning and end of alias and make lowercase
$str = trim(JString::strtolower($str));

// Remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(‘/(\s|[^A-Za-z0-9\-])+/’, ‘-‘, $str);

// Trim dashes at beginning and end of alias
$str = trim($str, ‘-‘);

return $str;
}

Thay thế bằng:

   public static function stringURLSafe($string)
{
$trans = array(
“đ”=>”d”,”ă”=>”a”,”â”=>”a”,”á”=>”a”,”à”=>”a”,
“ả”=>”a”,”ã”=>”a”,”ạ”=>”a”,
“ấ”=>”a”,”ầ”=>”a”,”ẩ”=>”a”,”ẫ”=>”a”,”ậ”=>”a”,
“ắ”=>”a”,”ằ”=>”a”,”ẳ”=>”a”,”ẵ”=>”a”,”ặ”=>”a”,
“é”=>”e”,”è”=>”e”,”ẻ”=>”e”,”ẽ”=>”e”,”ẹ”=>”e”,
“ế”=>”e”,”ề”=>”e”,”ể”=>”e”,”ễ”=>”e”,”ệ”=>”e”,
“í”=>”i”,”ì”=>”i”,”ỉ”=>”i”,”ĩ”=>”i”,”ị”=>”i”,
“ư”=>”u”,”ô”=>”o”,”ơ”=>”o”,”ê”=>”e”,
“Ư”=>”u”,”Ô”=>”o”,”Ơ”=>”o”,”Ê”=>”e”,
“ú”=>”u”,”ù”=>”u”,”ủ”=>”u”,”ũ”=>”u”,”ụ”=>”u”,
“ứ”=>”u”,”ừ”=>”u”,”ử”=>”u”,”ữ”=>”u”,”ự”=>”u”,
“ó”=>”o”,”ò”=>”o”,”ỏ”=>”o”,”õ”=>”o”,”ọ”=>”o”,
“ớ”=>”o”,”ờ”=>”o”,”ở”=>”o”,”ỡ”=>”o”,”ợ”=>”o”,
“ố”=>”o”,”ồ”=>”o”,”ổ”=>”o”,”ỗ”=>”o”,”ộ”=>”o”,
“ú”=>”u”,”ù”=>”u”,”ủ”=>”u”,”ũ”=>”u”,”ụ”=>”u”,
“ứ”=>”u”,”ừ”=>”u”,”ử”=>”u”,”ữ”=>”u”,”ự”=>”u”,
“ý”=>”y”,”ỳ”=>”y”,”ỷ”=>”y”,”ỹ”=>”y”,”ỵ”=>”y”,
“Ý”=>”Y”,”Ỳ”=>”Y”,”Ỷ”=>”Y”,”Ỹ”=>”Y”,”Ỵ”=>”Y”,
“Đ”=>”D”,”Ă”=>”A”,””=>”A”,”Á”=>”A”,”À”=>”A”,
“Ả”=>”A”,”Ô=>”A”,”Ạ”=>”A”,
“Ấ”=>”A”,”Ầ”=>”A”,”Ẩ”=>”A”,”Ẫ”=>”A”,”Ậ”=>”A”,
“Ắ”=>”A”,”Ằ”=>”A”,”Ẳ”=>”A”,”Ẵ”=>”A”,”Ặ”=>”A”,
“É”=>”E”,”È”=>”E”,”Ẻ”=>”E”,”Ẽ”=>”E”,”Ẹ”=>”E”,
“Ế”=>”E”,”Ề”=>”E”,”Ể”=>”E”,”Ễ”=>”E”,”Ệ”=>”E”,
“Í”=>”I”,”Ì”=>”I”,”Ỉ”=>”I”,”Ĩ”=>”I”,”Ị”=>”I”,
“Ư”=>”U”,”Ô”=>”O”,”Ơ”=>”O”,”Ê”=>”E”,
“Ư”=>”U”,”Ô”=>”O”,”Ơ”=>”O”,”Ê”=>”E”,
“Ú”=>”U”,”Ù”=>”U”,”Ủ”=>”U”,”Ũ”=>”U”,”Ụ”=>”U”,
“Ứ”=>”U”,”Ừ”=>”U”,”Ử”=>”U”,”Ữ”=>”U”,”Ự”=>”U”,
“Ó”=>”O”,”Ò”=>”O”,”Ỏ”=>”O”,”Õ”=>”O”,”Ọ”=>”O”,
“Ớ”=>”O”,”Ờ”=>”O”,”Ở”=>”O”,”Ỡ”=>”O”,”Ợ”=>”O”,
“Ố”=>”O”,”Ồ”=>”O”,”Ổ”=>”O”,”Ỗ”=>”O”,”Ộ”=>”O”,
“Ú”=>”U”,”Ù”=>”U”,”Ủ”=>”U”,”Ũ”=>”U”,”Ụ”=>”U”,
“Ứ”=>”U”,”Ừ”=>”U”,”Ử”=>”U”,”Ữ”=>”U”,”Ự”=>”U”,);//remove any ‘-‘ from the string they will be used as concatonater
$str = str_replace(‘-‘, ‘ ‘, $string);

$str = strtr($str, $trans);
$lang =& JFactory::getLanguage();
$str = $lang->transliterate($str);

// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(array(‘/\s+/’,’/[^A-Za-z0-9\-]/’), array(‘-‘,”), $str);

// lowercase and trim
$str = trim(strtolower($str));
return $str;
}

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
Bài viết này có ích hãy chia sẻ cho bạn bè:
Bài viết được cám ơn 0 lần. Bấm đây để Cám ơn ?

Random Posts

Các bài liên quan:

  1. Khắc phục lỗi tiếng việt joomla
  2. Windows Live Writer & Joomla MovableType XML-RPC Plugin để viết bài cho joomla
  3. Tạo bài viết mới trong joomla
  4. Hướng dẫn viết PrestaShop Modules
  5. Tạo vị trí mới trong template joomla
  6. Làm thế nào để hiển thị số lần xem bài viết Joomla 1.5
  7. Cách chuyển đổi Template từ Joomla! 1.0.x sang 1.5.
  8. Share full source Ecshop 2.7.2 tiếng việt hoàn chỉnh
  9. Hướng dẫn cài đặt Windows Live Writer cho joomla 1.7.x
  10. Việt hóa PrestaShop