Hi, Khách!
![]() | ![]() ![]() ![]() ![]() |
Code này trong bản gốc cũng có rồi, tại mọi người không để ý thôi
Hướng dẫn:
Bước 1:
mở forum/index.php tìm
PHP:
thêm bên dưới
<?php
$postres = mysql_fetch_assoc(mysql_query("SELECT `forum`.* FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id` WHERE `forum`.`type` = 'm' AND `forum`.`refid` = '$id' ORDER BY `forum`.`id` ASC LIMIT 1"));
$tukhoa = $textl;
$mota = bbcode::notags($postres['text');
?>
Copy code
$postres = mysql_fetch_assoc(mysql_query("SELECT `forum`.* FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id` WHERE `forum`.`type` = 'm' AND `forum`.`refid` = '$id' ORDER BY `forum`.`id` ASC LIMIT 1"));
$tukhoa = $textl;
$mota = bbcode::notags($postres['text');
?>
Copy code
Xong. Lưu vào nhé!
Bước 2:
mở incfiles/head.php tìm
PHP:
thêm bên dưới
PHP:
<?php
if (strlen($tukhoa) < 5)
$tukhoa = $set['meta_key';
if (strlen($mota) < 5)
$mota = $set['meta_desc';
$mota = html_entity_decode($mota, ENT_QUOTES, 'UTF-8');
$tukhoa = html_entity_decode($tukhoa, ENT_QUOTES, 'UTF-8');
?>
Copy code
if (strlen($tukhoa) < 5)
$tukhoa = $set['meta_key';
if (strlen($mota) < 5)
$mota = $set['meta_desc';
$mota = html_entity_decode($mota, ENT_QUOTES, 'UTF-8');
$tukhoa = html_entity_decode($tukhoa, ENT_QUOTES, 'UTF-8');
?>
Copy code
tìm tiếp:
PHP:
<?php
(!empty($set['meta_key') ? "\n" . '<meta name="keywords" content="' . $set['meta_key' . '" />' : '') .
(!empty($set['meta_desc') ? "\n" . '<meta name="description" content="' . $set['meta_desc' . '" />' : '') .
?>
Copy code
(!empty($set['meta_key') ? "\n" . '<meta name="keywords" content="' . $set['meta_key' . '" />' : '') .
(!empty($set['meta_desc') ? "\n" . '<meta name="description" content="' . $set['meta_desc' . '" />' : '') .
?>
Copy code
thay tất cả thành:
PHP:
<?php
"\n" . '<meta name="keywords" content="'.mb_substr($tukhoa, 0, 160).'" />' .
"\n" . '<meta name="description" content="'.mb_substr($mota, 0, 160).'" />' .
?>
Copy code
"\n" . '<meta name="keywords" content="'.mb_substr($tukhoa, 0, 160).'" />' .
"\n" . '<meta name="description" content="'.mb_substr($mota, 0, 160).'" />' .
?>
Copy code
Xong. Lưu lại nhé. Thế là dc rồi
Có lỗi báo ngay nhé

Nguồn: Wap10xMobi và GocMasterMobi

Trực Tuyến:
Khách: 1