Help
Discuss or request ArrowChat site notifications
User avatar
Jason
Customer
 
Posts: 2329
Joined: 12 Dec 2009, 16:06

 

by Jason 25 Feb 2015, 06:26

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.
User avatar
DDziedzic
Customer
 
Posts: 2
Joined: 27 Sep 2015, 11:32

 

by DDziedzic 29 Oct 2015, 13:02

How to install in phpBB 3.1?

The source code in 3.1 is different ...
User avatar
Jason
Customer
 
Posts: 2329
Joined: 12 Dec 2009, 16:06

 

by Jason 29 Oct 2015, 13:24

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.
User avatar
DDziedzic
Customer
 
Posts: 2
Joined: 27 Sep 2015, 11:32

 

by DDziedzic 29 Oct 2015, 13:51

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...
User avatar
Sbenny
Customer
 
Posts: 3
Joined: 22 Dec 2015, 03:24

 

by Sbenny 21 Jan 2016, 17:17

Is it possible to make a notification when there's a new topic also if the user didn't subscribe to that forum?