MyBB Community Forums
MyAlerts v2.0.4 - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: MyAlerts v2.0.4 (/thread-171301.html)



RE: MyAlerts v2.0.2 - Euan T - 12-29-2016

(12-29-2016, 12:57 PM)inTech Wrote: Hello there. I am currently developing a plugin and would like to extend MyAlerts with custom notification message whenever someone do something via my plugin. I searched the forums and the internet using Google and couldn't find any guide. Can you point anyone to the right direction?

Hi, this should help: https://github.com/MyBBStuff/MyAlerts/wiki/Integration-With-v2.0.0 Smile


RE: MyAlerts v2.0.2 - inTech - 12-30-2016

(12-29-2016, 02:05 PM)Euan T Wrote:
(12-29-2016, 12:57 PM)inTech Wrote: Hello there. I am currently developing a plugin and would like to extend MyAlerts with custom notification message whenever someone do something via my plugin. I searched the forums and the internet using Google and couldn't find any guide. Can you point anyone to the right direction?

Hi, this should help: https://github.com/MyBBStuff/MyAlerts/wiki/Integration-With-v2.0.0 Smile

Thank you for the reference. I found it to be useful. I understand the first part of the guide (Adding an alert type). However I do not understand from that point onward. For example, where should I put my Alert Formatters code in? Thank you again.

Edit: After much testing I managed to get the custom alerts to show up. Thank you.

Where can I edit this text ("Hello") from my plugin and not a language file?

 return $this->lang->sprintf(
            "Hello",

Will it be possible for me to add in more parameters to customize the message more? I am currentely doing this:
 $outputAlert['from_user'] . " have sent you a gift.",

And the output is "Admin have sent you a gift.". I want it to be like "Admin have sent you a X". How can I pass 'X' to the MyAlerts function/class? I feel that it should be inside init() but I am not too sure.

Edit #2: After much testing and viewing MentionMe Github source, I managed to find out how can I insert customizable text into the alerts string. Thank you.

For anyone interested, you will need to use the setExtraDetails() method before you call the addAlert() method in your plugin. Then inside the formatter class, you will need to use the getExtraDetails() method to fetch the custom string from the database.


RE: MyAlerts v2.0.2 - Euan T - 12-31-2016

(12-30-2016, 06:46 AM)inTech Wrote:
(12-29-2016, 02:05 PM)Euan T Wrote:
(12-29-2016, 12:57 PM)inTech Wrote: Hello there. I am currently developing a plugin and would like to extend MyAlerts with custom notification message whenever someone do something via my plugin. I searched the forums and the internet using Google and couldn't find any guide. Can you point anyone to the right direction?

Hi, this should help: https://github.com/MyBBStuff/MyAlerts/wiki/Integration-With-v2.0.0 Smile

Thank you for the reference. I found it to be useful. I understand the first part of the guide (Adding an alert type). However I do not understand from that point onward. For example, where should I put my Alert Formatters code in? Thank you again.

Edit: After much testing I managed to get the custom alerts to show up. Thank you.

Where can I edit this text ("Hello") from my plugin and not a language file?

 return $this->lang->sprintf(
            "Hello",

Will it be possible for me to add in more parameters to customize the message more? I am currentely doing this:
 $outputAlert['from_user'] . " have sent you a gift.",

And the output is "Admin have sent you a gift.". I want it to be like "Admin have sent you a X". How can I pass 'X' to the MyAlerts function/class? I feel that it should be inside init() but I am not too sure.

Edit #2: After much testing and viewing MentionMe Github source, I managed to find out how can I insert customizable text into the alerts string. Thank you.

For anyone interested, you will need to use the setExtraDetails() method before you call the addAlert() method in your plugin. Then inside the formatter class, you will need to use the getExtraDetails() method to fetch the custom string from the database.

Sorry for the late reply, glad you managed to get it fixed. That's definitely the way to do it, here's an example formatter from the core: https://github.com/MyBBStuff/MyAlerts/blob/master/inc/plugins/MybbStuff/MyAlerts/src/Formatter/SubscribedThreadFormatter.php#L21


RE: MyAlerts v2.0.2 - Darkrad - 01-10-2017

Hey,

I noticed some people just simply refuse to use MyAlerts functions and after some point they get like " Alerts (1511) "

I see there's a task for automatically removing read alerts. But what about unread alerts? Those people simply do not read their alerts and honestly I don't want them to have thousand alerts. If it's possible I would really appreciate to have option such as "automatically removing alerts older than 3 months" or something similar.


RE: MyAlerts v2.0.2 - Euan T - 01-10-2017

Yeah, that's been requested before, and will be added whenever I get time to work on the next release. It definitely makes sense to add, because very few people would read more alerts than fit on a single page.


RE: MyAlerts v2.0.2 - Michael2014 - 01-25-2017

Hi Euan, where is the best place to download the plugin, from mybb or github?


RE: MyAlerts v2.0.2 - Euan T - 01-25-2017

(01-25-2017, 09:06 AM)Michael2014 Wrote: Hi Euan, where is the best place to download the plugin, from mybb or github?

GitHub, for definite. I haven't updated the version on the mods site in a long time!


RE: MyAlerts v2.0.2 - insertco - 01-25-2017

Hi Euan, Is possible to update from mybb to github version?


RE: MyAlerts v2.0.2 - Darkrad - 01-25-2017

Then you should probably add github link to first message, I am not sure if I have updated version or not.


RE: MyAlerts v2.0.2 - Euan T - 01-26-2017

(01-25-2017, 10:34 PM)insertco Wrote: Hi Euan, Is possible to update from mybb to github version?
So long as you have the current version from myBB, you just need to replace the files with the ones from GitHub.
(01-25-2017, 11:48 PM)Darkrad Wrote: Then you should probably add github link to first message, I am not sure if I have updated version or not.

Good point, will do so now.