Mod fix lỗi font tiếng việt trên tiêu đề JohnCMS

Hình đại diện của thành viên
#1 29/03/2016 21:15
Cách sửa (fix) lỗi font chữ tiếng việt trên tiêu đề rất đơn giản tao chỉ cần thêm1 đoạn code vào 2 file forum/index.php và incfiles/head.php
Mở forum/index.php
tìm

Mã:
if (empty($id)) {
$textl '' $lng['forum'] . '';
} else {
$req mysql_query("SELECT `text` FROM `forum` WHERE `id`= '" $id "'");
$res mysql_fetch_assoc($req);
$textl ''.$res['text'].' - Vina4z.tk';

thay thành
Mã:
if (empty($id)) {
$textl '' $lng['forum'] . '';
} else {
$req mysql_query("SELECT `text`, `type` FROM `forum` WHERE `id`= '" $id "' LIMIT 1;");
$res mysql_fetch_assoc($req);
$hdr strtr($res['text'], array (
'"' => '',
'&' => '',
'<' => '',
'>' => '',
''' => ''
));
$hdr=html_entity_decode($hdr,ENT_QUOTES,'
UTF-8'); ////fix lỗi font title
$hdr = mb_substr($hdr, 0, 100);
$hdr = functions::checkout($hdr);
$textl = mb_strlen($res['
text']) > 100 ? $hdr . '...' : $hdr .' '.$set['copyright'];
}

Mở incfiles/head.php
Tìm
Mã:
defined('_IN_JOHNCMS') or die('Error: restricted access'); 

Thêm Bên Dưới
Mã:
$headmod = isset($headmod) ? mysql_real_escape_string($headmod) : '';
$textl html_entity_decode($textl,ENT_QUOTES,'UTF-8'); ////fix lỗi font title
$textl = isset($textl) ? $textl $set['copyright']; 

- Save and test
- Chúc thành công! :D
(Nokia 5130c-2)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
_______________
Facebook
Website
Trả lời nhanh

Chủ đề tương tự
Ai đang trực tuyến?