1.6 Compatible: MyAlerts
#1
MyAlerts for MyBB 1.6

MyAlerts is a simple notification system for MyBB aimed at increasing community interaction and socialisation.

Features
  • Integrated with the MyBB core experience
  • Per user alert settings - allows users to unsubscribe from certain alert types.
  • Alerts viewable via both User CP and dropdown menu in the header.
  • Task system to clear out old read alerts to avoid the database becoming oversized.
  • Fully extensible by third party plugins.
  • Makes full use of the MyBB language system - can be translated into multiple languages.

Core Alert Types

MyAlerts has a fairly well rounded set of core types of alert that occur on certain actions. These are as follows:
  • Alert on being added to a user's buddylist.
  • Alert on receival of a Private Message (PM).
  • Alert when quoted in posts.
  • Alert when a user replies to a thread you have created.

Screenshots

[Image: Alert%20Listing.png]

[Image: Alert%20Dropdown%20-%20Closed.png]

[Image: Alert%20Dropdown%20-%20Open.png]

Support Documentation

MyAlerts has a small amount of support documentation available via GitHub.

Download

Click here to download the latest version of MyAlerts.
Reply
#2
MyAlerts 1.04

I would like to announce the immediate availability of MyAlerts 1.04 right now - available via both the Mods Site and GitHub.

Changes
  • Default avatar option for users without an avatar.
  • Forum permission checks for quote alerts and thread author alerts
  • New user settings system
  • Many bug/issue fixes

Upgrading

  1. Upload all files to your server.
  2. De-Activate MyAlerts.
  3. Re-Activate MyAlerts.
  4. Inform users that they will be required to re-enable any alert types that they wish to receive.

Direct Download

Click Here!
Reply
#3
Not sure if this is possible, but one thing I'm running into a lot is that I'll view a thread that's been updated without using MyAlerts to access it, but the alert about unread posts does not go away. Would be nice.
Reply
#4
Yeah, that can be annoying sometimes. The big problem is that doing so would add at least 2 queries to showthread - which is already one of the heaviest pages in the core. I could always add it with a setting to disable it?
Reply
#5
Queries are only wasted if they're not useful. Grin
Reply
#6
True enough. I'll add it in as soon as I get a chance. Got to track down a tricky little bug that's occurring for only 2 users first lol
Reply
#7
After having had a quick chat with Brad, I've made a few slight changes to the JS to clean it up a little. The dropdown now opens and closes a lot faster and when you click on a link in the dropdown, it doesn't close. This leads to a much smoother experience.

I've pushed the changes to GitHub, but have not tagged it as current. If you want to make these changes to your install, replace you myalerts.js file with the below:

PHP Code:
jQuery.noConflict();

jQuery(document).ready(function($)
{
    $(
'body').on({
        
click: function(event)
        {
            
event.preventDefault();
            var 
popup_id = $(this).attr('id') + '_popup';

            $(
'#' popup_id).attr('top', $(this).height() + 'px').slideToggle('fast', function() {
                var 
toMarkRead = new Array;
                $(
'[id^="alert_row_popup_"]').each(function() {
                    
toMarkRead.push($(this).attr('id').substr(16));
                });

                $.
get('xmlhttp.php?action=markRead', {
                    
my_post_keymy_post_key,
                    
toMarkReadtoMarkRead
                
}, function(data) {

                });
            });
            return 
false;
        }
    }, 
'.myalerts_popup_hook');

    $(
'.myalerts_popup *').on('click', function(event) {
        
event.stopPropagation();
    });

    $(
"body:not('.myalerts_popup:visible')").on('click', function() {
           $(
'.myalerts_popup:visible').hide();
    });

    $(
'#getUnreadAlerts').on('click', function(event) {
        
event.preventDefault();
        $.
get('xmlhttp.php?action=getNewAlerts', function(data) {
            $(
'#latestAlertsListing').prepend(data);
        });
    });

    $(
'.deleteAlertButton').on('click', function(event) {
        
event.preventDefault();
        var 
deleteButton = $(this);

        $.
getJSON(deleteButton.attr('href'), {accessMethod'js'}, function(data) {
            if (
data['success'])
            {
                
deleteButton.parents('tr').get(0).remove();
                if (
data['template'])
                {
                    $(
'#latestAlertsListing').html(data['template']);
                }
            }
            else
            {
                
alert(data['error']);
            }
        });
    });

    if (
typeof myalerts_autorefresh !== 'undefined' && myalerts_autorefresh 0)
    {
        
window.setInterval(function() {
            $.
get('xmlhttp.php?action=getNewAlerts', function(data) {
                $(
'#latestAlertsListing').prepend(data);
            });
        }, 
myalerts_autorefresh 1000);
    }

    if (
typeof unreadAlerts !== 'undefined' && unreadAlerts 0)
    {
        
document.title document.title ' (' unreadAlerts ')';
    }

}); 
Reply
#8
Best plugin ever! Happy
Reply
#9
I'm hoping to get an update to this out soon if the MyBB core devs accept a request I made earlier to provide post insert hooks in the datahandlers. This will fix many issues and improve how the plugin works greatly.
Wildcard likes this post
Reply
#10
Euan, did you ever make any progress with the plan to reverse the setting logic?
Reply