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.
(2017-02-18, 02:11 PM)Stormyy Wrote: [ -> ]Does this still work? because I installed it and ended up having a blank page when clicking on the settings in the usercp.

(2017-02-05, 02:18 PM)Marisa Wrote: [ -> ]
(2017-02-05, 02:07 PM)Euan T Wrote: [ -> ]
(2017-02-05, 01:55 PM)thelovelyone Wrote: [ -> ]I'd pay you for an update of this Toungue

Unfortunately that wouldn't help me find the time needed to update it. I will try and get an update out within the next month or two though!

Can I volunteer to do your chores so we can save you some time?

Laundry?
Cook your meals?
University thesis?

omg and it says you are from japan. sounds very much waifu.  Toungue

Yes, it definitely still works. I'm going to guess that you've either:

a) Got an old version of MyBB 1.8, you need to use the current version
b) Got an old version of PHP before PHP 5.3
c) Not uploaded all of the required files, such as ClassLoader.php: https://community.mybb.com/thread-171301...pid1264148
(2017-02-18, 02:48 PM)Euan T Wrote: [ -> ]
(2017-02-18, 02:11 PM)Stormyy Wrote: [ -> ]Does this still work? because I installed it and ended up having a blank page when clicking on the settings in the usercp.

(2017-02-05, 02:18 PM)Marisa Wrote: [ -> ]
(2017-02-05, 02:07 PM)Euan T Wrote: [ -> ]
(2017-02-05, 01:55 PM)thelovelyone Wrote: [ -> ]I'd pay you for an update of this Toungue

Unfortunately that wouldn't help me find the time needed to update it. I will try and get an update out within the next month or two though!

Can I volunteer to do your chores so we can save you some time?

Laundry?
Cook your meals?
University thesis?

omg and it says you are from japan. sounds very much waifu.  Toungue

Yes, it definitely still works. I'm going to guess that you've either:

a) Got an old version of MyBB 1.8, you need to use the current version
b) Got an old version of PHP before PHP 5.3
c) Not uploaded all of the required files, such as ClassLoader.php: https://community.mybb.com/thread-171301...pid1264148

you can find the link to my site in my signature. it has the latest version of mybb, php version is 7,  I guess I might have tried the last one then Smile

thanks, it works. I downloaded the plugin early from the plugin repository, then downloaded the latest one from the github, used the pluginloader, then it started working Big Grin
Glad you got it fixed Smile
[Image: YJ4ogks.png]I just found that my alert settings page is blank. I am wondering why
I want to add a sound notification, is that possible? E.g. there is a new alert, itll give a sound when you open the forum.
(2017-02-18, 06:37 PM)thelovelyone Wrote: [ -> ]I want to add a sound notification, is that possible? E.g. there is a new alert, itll give a sound when you open the forum.

I am not exactly sure about this plugin, because I just downloaded it and it doesn't even work for me.   Huh
anyway something like this should do the work. Keep the audio tags within the body, and before using the script make sure to check the number of alerts, then use if condition and enclose the " document.getElementById("alert_sound").play();", so if there are alerts more than 0 make it true like 

if(alert_number > 0)
{
document.getElementById("alert_sound").play();
}

, then it will trig the sound to play.


Quote:<audio id="alert_sound" src="myalert.mp3"></audio>

<script>
    document.getElementById("alert_sound").play();
</script>

Even though the plugin doesn't work as I showed above, still I can see the number of alerts in my site. Currently it shows as 0. So I made this javascript solution for playing notifications. This should work, but didn't test.

As I found the number of alerts show in "myalerts" class.

<li class="alerts ">
    <a href="https://nucuta.com/community/alerts.php" class="myalerts">Alerts(1)</a>
</li>

So.. Use this code to retrieve the number of alerts that it shows. As I believe, it shows the number of alerts received, but it shows with some characters. in that case regular expression has to be used to retrieve the number out of it. 

<script>
var number = document.getElementsByClassName("myalerts")[0].innerHTML;
var num = number.match(/\d/g)[0];
</script>


Then use a if condition to find out if it's larger than 0..


<audio id="alert_sound" src="myalert.mp3"></audio>

<script>
if(num > 0){
    document.getElementById("alert_sound").play();
}
</script>


The complete code should be this...

<audio id="alert_sound" src="myalert.mp3"></audio>

<script>
var number = document.getElementsByClassName("myalerts")[0].innerHTML;
var num = number.match(/\d/g)[0];
if(num > 0){
   document.getElementById("alert_sound").play();
}
</script>
(2017-02-18, 06:12 PM)Stormyy Wrote: [ -> ][Image: YJ4ogks.png]I just found that my alert settings page is blank. I am wondering why

What is in the "mybb_alert_types" table?
(2017-02-18, 08:06 PM)Euan T Wrote: [ -> ]
(2017-02-18, 06:12 PM)Stormyy Wrote: [ -> ][Image: YJ4ogks.png]I just found that my alert settings page is blank. I am wondering why

What is in the "mybb_alert_types" table?

nothing  Confused
[Image: rTEh39n.png]

oops sorry, I didn't realize you were asking about the database table. It returns nothing.

[Image: 6ZsBhyG.png]

solved. omg I didn't realize I had an old version of the pluginlibrary, so I downloaded the latest version from github.
@Stormyy

Thanks, it works. Appreciated!
(2017-02-18, 09:36 PM)thelovelyone Wrote: [ -> ]@Stormyy

Thanks, it works. Appreciated!

No problem, but make sure to use mp3 format, as even Internet Explorer supports it.  Toungue I know less people use Internet Explorer, but just saying.