The Soda Pop
Wapsite đang trong quá trình nâng cấp các bạn hãy chờ đợi nhé. Cảm ơn !
20/10/2015 - 23:24


[Share] Mod Thông Báo Cho Johncms



Tác giả: Inuyasha :D
Yêu cầu: wap phải có function màu níck nick() và dùng bbcode tags().
-Đầu tiên upload lần lượt file thongbao.zip và icon_thongbao.zip tải ở phía dưới lên thư mục users và images.
-xong giải nén 2 file đó ra ta đc 2 file install.php và thongbao.php và thư mục images/thongbao.
-chạy http://domain.xxx/users/install.php để cài data. báo "cài đặt thành công " là ok :D

xong giờ ta mở file forum/includes/say.php để mod thông báo trích dẫn bài viết :)
Mở say.php tìm :
// Вычисляем, на какую страницу попадает добавляемый пост
$page = $set_forum['upfp'] ? 1 : ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 'm' AND `refid` = '$th'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0) / $kmess);


Copy Code Trên:

thêm vào bên trên đoạn code vừa tìm đc:

////mod thong bao trich dan
$tong=mysql_result(mysql_query("select count(*) from forum where refid = '{$th}' and type='m' order by time desc"),0);
$topic=mysql_fetch_array(mysql_query("select * from forum where refid='{$th}' and type='m' order by time asc limit 1"));
$sotrang=ceil($tong/$kmess);
mysql_query("INSERT INTO `thongbao` SET
`id_from`='".$user_id."',
`id_to` = '".$type1['user_id']."',
`hanhdong`='0',
`id_forum`='".$th."',
`text` = '".$sotrang."|".$fadd."',
`type`='f',
`time` = '" . time() . "'
");
/////ket thuc thong bao trich dan


Copy Code Trên:

vậy là xong thông báo trích dẫn :D
-Tiếp đến là thông báo like.
Mở forum/index.php tìm:
$checkthankdau = mysql_query('SELECT COUNT(*) FROM `forum_thank` WHERE `userthank` = "' . $user_id . '" and `topic` = "' . $_GET['thanks'] . '" and `user` = "' . $_GET['user'] . '"');
if ($user_id && $user_id != $_GET['user'] && (mysql_result($checkthankdau, 0) < 1)) {
if ((isset ($_GET['thank']))&&(isset ($_GET['user']))&&(isset ($_GET['thanks']))) {


Copy Code Trên:

chèn vào ngay bên dưới :
////mod thong bao like
$tong=mysql_result(mysql_query("select count(*) from forum where refid = '{$_GET['id']}' and type='m' order by time desc"),0);
$sotrang=ceil($tong/$kmess);
mysql_query("INSERT INTO `thongbao` SET
`id_from`='".$user_id."',
`id_to` = '".$_GET['user']."',
`hanhdong`='1',
`id_forum`='".$_GET['id']."',
`text` = '".$sotrang."|".$_GET['thanks']."',
`type`='f',
`time` = '" . time() . "'
");
/////ket thuc thong bao like


Copy Code Trên:

p/s: cái này là mod like của john 4.4 .
Vậy là xong :D giờ đến phần hiện thông báo ở head :)
Mở incfiles/head.php chèn vào chỗ thích hợp.
$thongbao=mysql_result(mysql_query("select count(*) from `thongbao` where `id_to`='{$user_id}' and `type`='f'"),0);
if($thongbao >0)
echo '<div class="phdr"><a href="../users/thongbao.php">Thông báo:<font color="red">'.$thongbao.'</font></a></div>';


Copy Code Trên:

Done...mới viết chưa test kĩ có gì anh em thông cảm:))

Facebook Google Plus Twitter
Chuyển Qua GD Mobile
C-STAT