MyBB Community Forums

Full Version: MyAlerts v2.0.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I always planned to have "live" notifications, but never got round to it. If I were writing this plugin today, I'd change a lot of things about it for definite. I've considered going back and changing stuff up, but I'm not sure when/if I'll get the time to do so. For example, there are issues where you get an alert for having quoted yourself in a thread - somehting that makes 0 sense to be alerted about at all. You can also get duplicate notifications for a quote reply (one for the quote, one for a reply to your created thread). Perhaps I'll try and make some time to improve these kinds of things, but there are bigger architectural things I'd change (such as how alerts are saved being weird).

Regarding the timestamp, it uses a DATETIME column which is designed for storing dates. Storing it as an actual date datatype makes it much easier to reason about when looking at the database contents, and means you can easily use the date functions provided by the database, such as MySQL's DATE_SUB function rather than working with raw timestamps.
Euan, it's okay.  I assume if you wrote this today you'd change a great deal.  My biggest gripe is the coding method isn't MyBB standard.  You have everything under /inc/plugins/MybbStuff/  which is cumbersome imho.

Then there is code like this which drives me nuts.

 /**
 * Get an instance of the AlertFormatterManager if one has been created via
 * @see createInstance().
 *
 * @return bool|MybbStuff_MyAlerts_AlertFormatterManager The existing
 *                                                       instance, or false
 *                                                       if not already
 *                                                       instantiated.
 */
         public static function getInstance()
 {
 if (static::$instance === null) {
 return false;
 }

 return static::$instance;
 }

It's all abstraction framework style which again, is not MyBB standard. Did you use a framework to create this plugin? It doesn't seem to be code you'd write from scratch.


There also seems to be a bug where hitting Reply doesn't give a notification like when you Quote. We're still working on this at HF. Since this thread is so long it's not easy to read it all and I assume all known bugs are fixed in latest version. Of course Xerotic and I are adept at troubleshooting so we'll hunt down bugs and fix them. Are you aware of any we need to go after?

btw, thanks for making the plugin. I don't want to sound ungrateful. It's just not how I would code it.

EDIT: Oh, I have one other comment. I'm thinking of running the mybb_alerts table as HEAP/MEMORY. Any thoughts on that? I feel it would be faster that way and if the table is truncated it won't matter. Since it's your plugin and no one knows it better maybe you have a reason I shouldn't do it. Currently table is MyISAM but I switch it to INNODB. It won't go memory unless extra_details is changed from TEXT/BLOB type. I assume a varchar(256) would be sufficient?
Nope, that's just the way I wrote it. It was written based on old versions and over a long timespan with little bits of work here and there leading into the monster it currently is.

Reply should give a quote alert if the post contains a [quote] tag, though there's some weird interaction with quotes and SCeditor that I've observed in the past (usually it only happens when the suername being quoted contains a space as far as I've seen, but it might happen under other conditions too) which cause the regex in the plugin to not match.

There are quite a few open issues on the repository, though some of them are feature requests rather than bugs.

I did start a new repository this afternoon to see if I can clean things up a little bit: https://github.com/MyBBStuff/myalerts-redux - I haven't committed much yet, but it's probably going to be MyAlerts v3 within the enxt month or so if I get time to finish what I've started. The new version should be much easier to understand and hopefully less prone to bugs.
Quote:Reply should give a quote alert if the post contains a [quote] tag, though there's some weird interaction with quotes and SCeditor that I've observed in the past (usually it only happens when the suername being quoted contains a space as far as I've seen, but it might happen under other conditions too) which cause the regex in the plugin to not match

Any chance you can look into that bug and get a fix? Probably just some regex stuff like you said.

EDIT: btw can I ask you to link to the Github page in OP so it's easy to find?
(2018-03-31, 06:39 PM)labrocca Wrote: [ -> ]
Quote:Reply should give a quote alert if the post contains a
Quote: tag, though there's some weird interaction with quotes and SCeditor that I've observed in the past (usually it only happens when the suername being quoted contains a space as far as I've seen, but it might happen under other conditions too) which cause the regex in the plugin to not match

Any chance you can look into that bug and get a fix? Probably just some regex stuff like you said.

EDIT: btw can I ask you to link to the Github page in OP so it's easy to find?
Yeah, I'll be looking at it as I work on the reformatted version anyway so I'll try and work out a patch. 
I've added a link to the GitHub project in the first post, hadn't realised it wasn't there actually.
Can you add support for this plugin http://www.mybbcentral.com/thread-7776.html? Because if you try and give a person anonymous rep their name still shows in the alerts.
(2018-04-05, 10:43 PM)Brian. Wrote: [ -> ]Can you add support for this plugin http://www.mybbcentral.com/thread-7776.html? Because if you try and give a person anonymous rep their name still shows in the alerts.

I would need to create an account on MyBB Central and see how that plugin works. Generally, MyAlerts doesn't go out of its way to work with other 3rd party plugins. If I do add support for it in some way, it won't be until the next major release.
Hi My Alerts doesn't show up Red when I have new alerts. How to change this?
Here is a screenshot: https://i.imgur.com/s1vEc2P.png
(2018-04-06, 08:13 PM)HumptyDumpty Wrote: [ -> ]Hi My Alerts doesn't show up Red when I have new alerts. How to change this?
Here is a screenshot: https://i.imgur.com/s1vEc2P.png

Hi,

You need to add some custom CSS to change the colour of the alerts text when there are new alerts. Something like this should work:

.alerts--new a {
  color: red !important;
}
MyAlerts v2.0.4 is now released.

This release fixes a possible XSS vulnerability reported by Labrocca. You can download the archive attached to this post, or you can download the project from GitHub: https://github.com/MyBBStuff/MyAlerts/ar...62d9dd.zip