MyBB Community Forums

Full Version: [ASK] Inferno Shoutbox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
how to apply this method in the shoutbox inferno mybb 1.6?
=>http://community.mybb.com/thread-166192....d+shoutbox

please answer if anyone knows  Smile
have you tried it ? it might work without any changes.
I have not tried it, but do you think work
That shouldn't work for the inferno shoutbox, only the DVZ one. A quick patch for the inferno shoutbox would be replacing in inferno.js.php

        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }



with



        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
            var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                        if (inferno.manage_anus())
                        {
                            audio.play();
                            console.log("played file");
                            inferno.close_anus();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }

and in class_core.php changing
    public function update_anus()

    {
        if ($this->anus)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

to
    public function update_anus()

    {
        if (true)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

You will have to add a sound file yourself and add the path that you use for your sound file to inferno.js.php on this line
var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.

In this case, I have it pointing to a file in my inferno folder called sound.ogg

Good luck with this working and I probably won't add this to my copy of it, since this really is a hacky way of doing it (the sound will probably be delayed by half a second) and with the way the shoutbox works, there really isn't a cleaner way of doing it.
oh! somehow I overlooked the requirement Sad Thank You Clank
(2015-01-29, 05:30 AM)Clank Wrote: [ -> ]That shouldn't work for the inferno shoutbox, only the DVZ one. A quick patch for the inferno shoutbox would be replacing in inferno.js.php

        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }



with



        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
            var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                        if (inferno.manage_anus())
                        {
                            audio.play();
                            console.log("played file");
                            inferno.close_anus();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }

and in class_core.php changing
    public function update_anus()

    {
        if ($this->anus)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

to
    public function update_anus()

    {
        if (true)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

You will have to add a sound file yourself and add the path that you use for your sound file to inferno.js.php on this line
var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.

In this case, I have it pointing to a file in my inferno folder called sound.ogg

Good luck with this working and I probably won't add this to my copy of it, since this really is a hacky way of doing it (the sound will probably be delayed by half a second) and with the way the shoutbox works, there really isn't a cleaner way of doing it.

if you've tried?
I have tried but have not come out of his voice.
(2015-01-29, 01:44 PM)Newbie22 Wrote: [ -> ]
(2015-01-29, 05:30 AM)Clank Wrote: [ -> ]That shouldn't work for the inferno shoutbox, only the DVZ one. A quick patch for the inferno shoutbox would be replacing in inferno.js.php


        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }



with




        if (this.tab != -1)

        {
            this.tab = -1;
            this.shoutbox_content.innerHTML = 'Loading...';
            this.load_shouts();
            var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.
        }

        if (this.tab == -1)
        {
            this.interval = setInterval(function() {
                if (inferno.tab == -1)
                {
                    if (inferno.is_idle() == false)
                    {
                        if (inferno.anus)
                        {
                            if (inferno.manage_anus())
                            {
                                inferno.load_shouts();
                                inferno.close_anus();
                            }
                        }
                        else
                        {
                            inferno.load_shouts();
                        }
                        if (inferno.manage_anus())
                        {
                            audio.play();
                            console.log("played file");
                            inferno.close_anus();
                        }
                    }
                }
            }, this.refresh_rate);
            inferno.update_idle_time();
        }
    }

and in class_core.php changing

    public function update_anus()

    {
        if ($this->anus)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

to

    public function update_anus()

    {
        if (true)
        {
            $fp = fopen(MYBB_ROOT . 'inc/plugins/inferno/anus.php', 'w');
            fwrite($fp, TIME_NOW);
            return fclose($fp);
        }
        return false;
    }

You will have to add a sound file yourself and add the path that you use for your sound file to inferno.js.php on this line

var audio = new Audio("./inc/plugins/inferno/sound.ogg"); //Change this to the sound file you want.

In this case, I have it pointing to a file in my inferno folder called sound.ogg

Good luck with this working and I probably won't add this to my copy of it, since this really is a hacky way of doing it (the sound will probably be delayed by half a second) and with the way the shoutbox works, there really isn't a cleaner way of doing it.

if you've tried?
I have tried but have not come out of his voice.

I did try it and the code works perfectly on my end. You do need to add your own sound file though and change the line of code that I noted to the path of your own sound file.
In version 2 I will add full functionality for sound so you don't have to deal with this in the future
I've put the sound file in Cpanel with .ogg format but when I test no sound if I can wear .mp3 format?
(2015-01-30, 08:29 AM)Newbie22 Wrote: [ -> ]I've put the sound file in Cpanel with .ogg format but when I test no sound if I can wear .mp3 format?

You can use whatever format your browser supports. I know mine uses ogg and I had an ogg file handy, so that's what I used. For best compatibility, I would suggest mp3.
Pages: 1 2