
Hôm nay mình hướng dẫn tiếp cách 2
mở /forum/includes/tema.php
tìm dòng
- Mã: Chọn tất cả
$txt_tmp = str_replace("[/l]", "", $txt_tmp);
Thêm bên dưới
- Mã: Chọn tất cả
$txt_tmp = preg_replace('#\[thank\](.*?)\[/thank\]#', '[Nội Dung Ẩn]', $txt_tmp);
tìm tiếp
- Mã: Chọn tất cả
$txt_tmp = str_replace("\r\n", "
", $txt_tmp);
thêm bên dưới
- Mã: Chọn tất cả
$txt_tmp = preg_replace('#\[thank\](.*?)\[/thank\]#', '[Nội Dung Ẩn]', $txt_tmp);
Lưu lại nhé

mở /forum/includes/post.php
Tìm dòng
- Mã: Chọn tất cả
$text = functions::smileys($text, ($res['rights'] >= 1) ? 1 : 0);
Thêm bên dưới
- Mã: Chọn tất cả
$checkthank = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $res['id'] . '" and `user` = "' . $res['user_id'] . '"');
$thankcheck = [url=http://chiase123.com/memberlist.php?mode=viewprofile&un=mysql_result%28%24checkthank]@[b]mysql_result($checkthank[/b][/url], 0);
if($thankcheck < 1 && $user_id != $res['user_id']) {
$text = preg_replace('#\[thank\](.*?)\[/thank\]#si', '<div class="mainblok"><div class="phdr">Nội dung ẩn</div><div class="list1">Bạn vui lòng cảm ơn bài viết này để xem nội dung ẩn</div></div>', $text);
} else {
$text = preg_replace('#\[thank\](.*?)\[/thank\]#si', '\1', $text);
}
Xong. Lưu lại nhé
Nguồn: GocMaster