MyBB Community Forums
[For 1.8] DVZ Shoutbox 2.3.2 – Sound notification. - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: [For 1.8] DVZ Shoutbox 2.3.2 – Sound notification. (/thread-224057.html)



DVZ Shoutbox 2.3.2 – Sound notification. - Tomik - 07-27-2019

DVZ SHOUTBOX 2.3.2 – SOUND NOTIFICATION

Download sound notification:
[attachment=42036]

Upload the dvz_shoutbox.mp3 file to the \images

Go to ACP >>> Templates & Style >>> Templates >>> Global Templates >>> dvz_shoutbox
Add the following code before {$javascript}

<script>
dvz_shoutbox.callbacks['update'].push(function(){
    if ($('#shoutbox .entry.new').length) {
        var audio = new Audio(rootpath + '/images/dvz_shoutbox.mp3');
        audio.volume = 0.2;
        audio.play();
    }
});
</script>

The whole code:
<div id="shoutbox" class="front{$classes}">

<div class="head">
<strong>{$lang->dvz_sb_shoutbox}</strong>
<p class="right"><a href="{$mybb->settings['bburl']}/index.php?action=shoutbox_archive">&laquo; {$lang->dvz_sb_archivelink}</a></p>
</div>

<div class="body">
	
{$panel}
	
<div class="window" style="height:{$mybb->settings['dvz_sb_height']}px">
<div class="data">
{$html}
</div>
</div>
	
</div>

<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/dvz_shoutbox.js"></script>
<script>
dvz_shoutbox.callbacks['update'].push(function(){
    if ($('#shoutbox .entry.new').length) {
        var audio = new Audio(rootpath + '/images/dvz_shoutbox.mp3');
        audio.volume = 0.2;
        audio.play();
    }
});
</script>
{$javascript}

</div>

Tested on:
  • DVZ Shoutbox 2.3.2
  • MyBB 1.8.21



RE: DVZ Shoutbox 2.3.2 – Sound notification. - WallBB - 07-27-2019

This is actually very interesting, will give it a try Smile


RE: DVZ Shoutbox 2.3.2 – Sound notification. - mujeebdgk - 07-28-2019

what is the difference between author thread mention below and this tutorial ?

https://community.mybb.com/thread-166192-post-1135286.html#pid1135286


RE: DVZ Shoutbox 2.3.2 – Sound notification. - Tomik - 07-28-2019

(07-28-2019, 10:00 AM)mujeebdgk Wrote: what is the difference between author thread mention below and this tutorial ?

https://community.mybb.com/thread-166192-post-1135286.html#pid1135286

The difference is that the code just needs to be inserted before the variable, not after variable.
That's why I added a new tutorial.


RE: DVZ Shoutbox 2.3.2 – Sound notification. - ianChrist007 - 08-25-2019

it works man.. thank you!