Page 1 of 1

phpBB forum/topic reply notifications

PostPosted: 25 Feb 2015, 06:26
by Jason
This notification will alert your users when one of their subscribed forums has a new thread or a subscribed thread has a new reply.


Image


Thread Reply Markup (alter as you wish):
Code: Select all
<div class="arrowchat_notification_box arrowchat_blue_link">   <img src="/arrowchat/themes/new_facebook_full/images/icons/notification_comment.png" class="arrowchat_notification_icon" />   The topic <a href="/{misc1}">{misc2}</a> has a new reply.<br />   <div class="arrowchat_received">Received {longago}</div></div><div class="arrowchat_notifications_divider"></div>


Forum Reply Markup (alter as you wish):
Code: Select all
<div class="arrowchat_notification_box arrowchat_blue_link">   <img src="/arrowchat/themes/new_facebook_full/images/icons/notification_wall_post.png" class="arrowchat_notification_icon" />   The forum <a href="/{misc1}">{misc2}</a> has a new thread.<br />   <div class="arrowchat_received">Received {longago}</div></div><div class="arrowchat_notifications_divider"></div>


Open the includes/functions_posting.php file.

Find $messenger->send($addr['method']);, ADD AFTER:
Code: Select all
            // BEGIN ARROWCHAT NOTIFICATION
            if (in_array($addr['user_id'], $update_notification['topic']))
            {
               $forum_url = "viewtopic.php?f=" . $forum_id . "&t=" . $topic_id;
               $topic_title_insert = htmlspecialchars_decode($topic_title);
               $sql = "INSERT INTO arrowchat_notifications (to_id, author_id, author_name, misc1, misc2, type, alert_time)
                  VALUES ('".$addr['user_id']."', '1', 'NA', '".$db->sql_escape($forum_url)."', '".$db->sql_escape($topic_title_insert)."', '5', '".time()."')";
               $db->sql_query($sql);
            } else if (in_array($addr['user_id'], $update_notification['forum'])) {
               $forum_url = "viewforum.php?f=" . $forum_id;;
               $forum_title_insert = htmlspecialchars_decode($forum_name);
               $sql = "INSERT INTO arrowchat_notifications (to_id, author_id, author_name, misc1, misc2, type, alert_time)
                  VALUES ('".$addr['user_id']."', '1', 'NA', '".$db->sql_escape($forum_url)."', '".$db->sql_escape($forum_title_insert)."', '6', '".time()."')";
               $db->sql_query($sql);
            }
            // END ARROWCHAT NOTIFICATION


Don't forget to change the notification IDs of 5 and 6 above to the IDs that you got after creating new notifications in the ArrowChat admin panel.

Re: phpBB forum/topic reply notifications

PostPosted: 29 Oct 2015, 13:02
by DDziedzic
How to install in phpBB 3.1?

The source code in 3.1 is different ...

Re: phpBB forum/topic reply notifications

PostPosted: 29 Oct 2015, 13:24
by Jason
DDziedzic wrote:How to install in phpBB 3.1?

The source code in 3.1 is different ...

Haven't checked but it should be very similar. You probably just need to change where to insert the code.

Re: phpBB forum/topic reply notifications

PostPosted: 29 Oct 2015, 13:51
by DDziedzic
Unfortunately, is not similiar ...

function $messenger->send and variables $update_notification, $addr - they do not exist.

I can't find where place modifications and how replace non-existent variables...

Re: phpBB forum/topic reply notifications

PostPosted: 21 Jan 2016, 17:17
by Sbenny
Is it possible to make a notification when there's a new topic also if the user didn't subscribe to that forum?