XtGem Forum catalog
Mod theo dõi chủ đề cho johncms | Johncms | Wapmaster - Forum-VN #ref-menu
▼ Mod theo dõi chủ đề cho johncms
* Tamhoangdk
- Cấp bậc: admin
19-04-2016
cái tên nói lên tất cả :D
yêu cầu phải dùng mod thông báo by inu share trong diễn đàn haha
-tải file đính kèm bên dưới upload và giải nén lên host.
-import file thongbao.sql vào data
-bắt đầu:
mở users/thongbao.php tìm:
$hanhdong=
Copy code

thêm vào trong array sau dấu );
,"bình luận"
Copy code

mở forum/index.php dán vào chỗ muốn hiển thì nút theo dõi :
if($user_id){
$data =mysql_result(mysql_query("select count(*) from `theodoi` where `topic`='$id' and `user_id`='$user_id'"),0);
if($data==0)
echo '<a href="'.$home.'/forum/theodoi.php?t='.$id.'"><input type="button" value="Theo dõi chủ đề"></a>';
else
echo '<a href="'.$home.'/forum/theodoi.php?t='.$id.'"><input type="button" value="Hủy theo dõi"/></a>';
}
Copy code

mở users/includes/profile/office.php tìm:
'<div><img src="../images/contacts.png" width="16" height="16"/> <a href="profile.php">' . $lng_profile['my_profile'] . '</a></div>' .
Copy code

chèn vào bên dưới :
'<div><img src="../images/guestbook.gif" width="16" height="16"/> <a href="theodoi.php">Chủ đề theo dõi</a></div>' .
Copy code

mở say.php tìm:
mysql_query("INSERT INTO `forum` SET
                `refid` = '$id',
                `type` = 'm' ,
                `time` = '" . time() . "',
                `user_id` = '$user_id',
                `from` = '$login',
                `ip` = '" . core::$ip . "',
                `ip_via_proxy` = '" . core::$ip_via_proxy . "',
                `soft` = '" . mysql_real_escape_string($agn1) . "',
                `text` = '" . mysql_real_escape_string($msg) . "'
            ");
            $fadd = mysql_insert_id();
Copy code

(nếu không có đoạn $fadd = mysql_insert_id(); thì tự thêm vào luôn :D)
thêm vào dưới:
//////mod theo doi chu de
if($user_id !=$type1['user_id']){
$sobai=mysql_result(mysql_query("select count(*) from forum where refid ='{$id}' and type='m' and id<='{$fadd}' order by time desc"),0);
$sopage=ceil($sobai/$kmess);
$theodoi=mysql_query("select * from `theodoi` where `topic`='$id' and `check`='1'");
$i=0;
while($theo=mysql_fetch_array($theodoi)){
mysql_query("insert into `thongbao` set `id_from`='".$user_id."',`id_to`='".$theo['user_id']."',`hanhdong`='4',`id_forum`='".$id."',`text`='".$sopage."|".$fadd."',`type`='f',
`time`='".time()."'");
}
}
///////ket thuc mod theo doi chu de
Copy code

tìm tiếp :
mysql_query("INSERT INTO `forum` SET
                `refid` = '$th',
                `type` = 'm',
                `time` = '" . time() . "',
                `user_id` = '$user_id',
                `from` = '$login',
                `id_user` = '" . $type1['user_id'] . "',
                `ip` = '" . core::$ip . "',
                `ip_via_proxy` = '" . core::$ip_via_proxy . "',
                `soft` = '" . mysql_real_escape_string($agn1) . "',
                `text` = '" . mysql_real_escape_string($msg) . "'
            ");
            $fadd = mysql_insert_id();
Copy code

(nếu không có $fadd thì cũng tự thêm vào luôn :)) )
thêm vào bên dưới:
//////mod theo doi chu de
if($user_id !=$th['user_id']){
$sobai=mysql_result(mysql_query("select count(*) from forum where refid = '{$th}' and type='m' order by time desc"),0);
$sopage=ceil($sobai/$kmess);
$theodoi=mysql_query("select * from `theodoi` where `topic`='$th' and `check`='1'");
$i=0;
while($theo=mysql_fetch_array($theodoi)){
mysql_query("insert into `thongbao` set `id_from`='".$user_id."',`id_to`='".$theo['user_id']."',`hanhdong`='4',`id_forum`='".$th."',`text`='".$sopage."|".$fadd."',`type`='f',
`time`='".time()."'");
}
}
///////ket thuc mod theo doi chu de
Copy code

p/s:nhớ thay lại `hanhdong`='4' lại cho phù hợp lại wap mình :troll2:
ai chưa biết thay thế nào thì nhìn vào
$hanhdong=array(" text 0","text 1","text 2","bình luận"); thì ở đây sẽ thay thành `hanhdong`='3'....cứ đếm thứ tự từ 0 rồi thay vào :cuoi:
nguồn: inuwap.mobi !!!
- Edited:  hanthienhau )
19-04-2016
Tập tin đính kèm
* mod-theo-doi-by-inu.zip
· application/zip
· 2.72KB
▲ Tổng số: 1
- Share:
BBCode:

Link:
Online: Guests: 1

Từ khóa: theo , johncms , dõi , johncms , cho