Skip to content

Commit

Permalink
🐛 fix always alert on new/edit post not working
Browse files Browse the repository at this point in the history
  • Loading branch information
popiazaza committed Apr 1, 2023
1 parent 80a0fb6 commit 288bd25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion th_chat/discuz_plugin_th_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<item id="datatables"><![CDATA[]]></item>
<item id="directory"><![CDATA[th_chat/]]></item>
<item id="copyright"><![CDATA[newz & popiazaza]]></item>
<item id="version"><![CDATA[3.3.8]]></item>
<item id="version"><![CDATA[3.3.9]]></item>
<item id="__modules">
<item id="0">
<item id="name"><![CDATA[hook]]></item>
Expand Down
4 changes: 2 additions & 2 deletions th_chat/hook.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function post_middle_message($args)
if ($config['new_post'] > 0 && $args['param'][0] == 'post_newthread_succeed') {
$forums = unserialize($config['category_post']);
if (in_array($args['param'][2]['fid'], $forums)) {
if ($config['new_post'] == 2 || $_POST['th_chat_notify']) {
if ($config['new_post'] == 1 || $_POST['th_chat_notify']) {
if ($post = DB::fetch_first("SELECT * FROM " . DB::table('forum_post') . " WHERE `fid` = " . $args['param'][2]['fid'] . " AND `tid` = " . $args['param'][2]['tid'] . " AND `pid` = " . $args['param'][2]['pid'])) {
$msg = "โพสต์ <a target=\"_blank\" href=\"forum.php?mod=viewthread&tid=" . $post['tid'] . "\">" . addslashes($post['subject']) . "</a>";
if ($config['show_category']) {
Expand All @@ -56,7 +56,7 @@ function post_middle_message($args)
} else if ($config['edit_post'] > 0 && $args['param'][0] == 'post_edit_succeed') {
$forums = unserialize($config['category_post']);
if (in_array($args['param'][2]['fid'], $forums)) {
if ($config['edit_post'] == 2 || $_POST['th_chat_notify']) {
if ($config['edit_post'] == 1 || $_POST['th_chat_notify']) {
if ($post = DB::fetch_first("SELECT * FROM " . DB::table('forum_post') . " WHERE `fid` = " . $args['param'][2]['fid'] . " AND `tid` = " . $args['param'][2]['tid'] . " AND `pid` = " . $args['param'][2]['pid'])) {
$msg = "อัปเดตโพสต์ <a target=\"_blank\" href=\"forum.php?mod=viewthread&tid=" . $post['tid'] . "\">" . addslashes($post['subject']) . "</a>";
if ($config['show_category']) {
Expand Down

0 comments on commit 288bd25

Please sign in to comment.