Hướng dẫn fix mod hide thank cho JOHNCMS part 2

ID Topic: 33350 • Có 910 lượt xem
Hình đại diện của thành viên
#1 - @438401
26/03/2016 06:17
Cách 1 mới chỉ fix dc ở say.php thôi nhé ;))
Hôm nay mình hướng dẫn tiếp cách 2
mở /forum/includes/tema.php
tìm dòng
Mã:$txt_tmp = str_replace("[/l]", "", $txt_tmp);
Thêm bên dưới
Mã:$txt_tmp = preg_replace('#\[thank\](.*?)\[/thank\]#', '[Nội Dung Ẩn]', $txt_tmp);

tìm tiếp
Mã:$txt_tmp = str_replace("\r\n", "
"
, $txt_tmp);

thêm bên dưới
Mã:$txt_tmp = preg_replace('#\[thank\](.*?)\[/thank\]#', '[Nội Dung Ẩn]', $txt_tmp);
Lưu lại nhé :D

mở /forum/includes/post.php
Tìm dòng Mã:$text = functions::smileys($text, ($res['rights'] >= 1) ? 1 : 0);

Thêm bên dưới
Mã:$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
(Nokia 5130c-2)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
Sửa lần cuối: Mjhtriuday 26/03/2016 07:26. Lý do: không viết hoa toàn bộ tiêu đề nhé :)
_______________
Facebook
Website
Trả lời nhanh

Chủ đề tương tự
cron