MyBB Community Forums

Full Version: MyAlerts - a notification/alert system for MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
One more question - is the text "Alerts" hardcoded? I could not find it in language files and was not able to locate template where to change it as well?
[Image: attachment.php?aid=27315]
Found it!
Could you list total queries it runs on each page euantor? Also is majority of the queries cached?
I can do that, yes. Nothing is cached as caching should only be used for objects that don't frequently change. Obviously, alerts do change fairly often. Templates are, of course, cached though.
Ok, global queries: 1;

SELECT COUNT(id) AS count FROM mybb_alerts WHERE uid = 1 AND unread = 1 AND type IN ('rep','pm','buddylist','quoted','thread_reply')

User CP (Alerts listing): 12 total;

User CP (Alerts settings): 9 total;

Sending PM: 1;

Adding to buddylist: 1;

Adding rep: 1;

Quoting: 2 (though one of them can be sizeable depending on how many people are getting quoted...)

Reply to thread: 1;


I've tried to keep them to an absolute minimum wherever I can. There are likely more optimisations I can make and that's pretty much all I'm working on right now.
Quote:SELECT COUNT(id) AS count FROM mybb_alerts WHERE uid = 1 AND unread = 1 AND type IN ('rep','pm','buddylist','quoted','thread_reply')

IMO you should just add a new user column to save the number of alerts pending reading. That will remove one query for each page being seen.
That seems like such an untidy way of doing things. I already hate how I store alerts settings. If you've taken any classes in database structure you'll know why I'm against it Wink
Oh well, I have not even read a single PHP/DB book, lol

It just seems to me that it is better that reading a full DB table each time a page is loaded.
It may well be "better" in that way, but it means adding a query each time an alert is added and storing a count of values within another table in a column is really not a good idea Wink
Has there been any progress on getting Frost to update his plugin?
He has updated his PluginLibrary and MyAlerts seem to work with it Wink
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41