The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Staff online widget always offline

    Bonetz
    Bonetz
    New Member


    Male Posts : 18
    Reputation : 2
    Language : C++ , Visual Basics , PHP , Java
    Location : Cavite , Philippines

    Solved Staff online widget always offline

    Post by Bonetz 13/6/2013, 20:57

    I have a problem here in Staff Online Widget ..
    I use a Online Staff widget as a slide out hover in left side ..
    The problem is why is my status and the other staff always offline even though we are online?
    I think the Problem is the java script that i use ..

    Spoiler:

    here is the code that I use ..
    Code:
    <script type="text/javascript">
     jQuery(function() {
     var x = document.getElementById('left').getElementsByTagName('table')[1];
     var y = document.getElementById('onlineStaff').getElementsByTagName('span');
     for (i=0; i<y.length; i++) {
     if (x.innerHTML.indexOf(y[i].innerHTML) > 0) y[i].innerHTML+=' <img src="'+'http://imageshack.us/a/img198/4198/onlinebg.png'+'">';
     else y[i].innerHTML+=' <img src="'+'http://imageshack.us/a/img812/4033/offlinezn.png'+'">'; } });
     </script>




    This code was provided by P-Robs
    Source of the Link : Click Here

    I hope you help me about this one ..


    Last edited by Bonetz on 13/6/2013, 23:05; edited 1 time in total
    E-Mark
    E-Mark
    Active Poster


    Male Posts : 1411
    Reputation : 169
    Language : English
    Location : Bitcoin

    Solved Re: Staff online widget always offline

    Post by E-Mark 13/6/2013, 21:07

    LG provided this code from what i know, and he said that he can't guarantee that this will work 100%, most of the forums i saw having this doesn't work either, i always saw it offline even if they're online. LOL. Razz
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: Staff online widget always offline

    Post by LGforum 13/6/2013, 22:15

    The code you're using is for a phpbb2 forum. Try this HTML widget:
    Code:
    <div id="onlinestaff">
     Â   <span>Staff username 1</span>
     Â   <span>staff username 2</span>
     Â   <span>staff username 3</span>
    </div>
    <script>
    jQuery(function() {
     Â   var stafflist = document.getElementById('onlinestaff').getElementsByTagName('span');
     Â   var online = jQuery('.module:last', document.getElementById('left'))[0].innerHTML;
     Â   for(var i = 0, s; (s = stafflist[i++]); ) {
     Â       if(online.indexOf('>' + s.innerHTML + '</') > 0) {
     Â           s.innerHTML += ' <img src="'+'http://imageshack.us/a/img198/4198/onlinebg.png'+'">';
     Â       }
     Â       else {
     Â           s.innerHTML += ' <img src="'+'http://imageshack.us/a/img812/4033/offlinezn.png'+'">';
     Â       }
     Â   }
    });
    </script>




    That should work on your forum as long as you keep the 'Who is online' widget at the bottom of your sidebar.
    Bonetz
    Bonetz
    New Member


    Male Posts : 18
    Reputation : 2
    Language : C++ , Visual Basics , PHP , Java
    Location : Cavite , Philippines

    Solved Re: Staff online widget always offline

    Post by Bonetz 13/6/2013, 22:29

    LGforum wrote:The code you're using is for a phpbb2 forum. Try this HTML widget:
    Code:
    <div id="onlinestaff">
     Â   <span>Staff username 1</span>
     Â   <span>staff username 2</span>
     Â   <span>staff username 3</span>
    </div>
    <script>
    jQuery(function() {
     Â   var stafflist = document.getElementById('onlinestaff').getElementsByTagName('span');
     Â   var online = jQuery('.module:last', document.getElementById('left'))[0].innerHTML;
     Â   for(var i = 0, s; (s = stafflist[i++]); ) {
     Â       if(online.indexOf('>' + s.innerHTML + '</') > 0) {
     Â           s.innerHTML += ' <img src="'+'http://imageshack.us/a/img198/4198/onlinebg.png'+'">';
     Â       }
     Â       else {
     Â           s.innerHTML += ' <img src="'+'http://imageshack.us/a/img812/4033/offlinezn.png'+'">';
           }
     Â   }
    });
    </script>





    That should work on your forum as long as you keep the 'Who is online' widget at the bottom of your sidebar.

    Sir its still not working
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: Staff online widget always offline

    Post by LGforum 13/6/2013, 22:36

    I edited my post above and it seems like you've coped the code before I made the edit. Try it again.
    Bonetz
    Bonetz
    New Member


    Male Posts : 18
    Reputation : 2
    Language : C++ , Visual Basics , PHP , Java
    Location : Cavite , Philippines

    Solved Re: Staff online widget always offline

    Post by Bonetz 13/6/2013, 22:43

    LGforum wrote:I edited my post above and it seems like you've coped the code before I made the edit. Try it again.


    Sir the problem now is .. even though the staff is offline the status of his name in the staff online widget is always online..
    Staff online widget always offline QebVeKt
    Bonetz
    Bonetz
    New Member


    Male Posts : 18
    Reputation : 2
    Language : C++ , Visual Basics , PHP , Java
    Location : Cavite , Philippines

    Solved Re: Staff online widget always offline

    Post by Bonetz 13/6/2013, 22:46

    Sir i think i got a typo error in your code .. give me 10 mins to fix it ..
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: Staff online widget always offline

    Post by LGforum 13/6/2013, 22:56

    Just visited your forum and seems to be working. The only staff member online is Bonetz.
    Bonetz
    Bonetz
    New Member


    Male Posts : 18
    Reputation : 2
    Language : C++ , Visual Basics , PHP , Java
    Location : Cavite , Philippines

    Solved Re: Staff online widget always offline

    Post by Bonetz 13/6/2013, 23:03

    Sir its working now thx for the code and for the help .. Solved~
    Thanks again~
    Sanket
    Sanket
    ForumGuru


    Male Posts : 48766
    Reputation : 2830
    Language : English
    Location : Mumbai

    Solved Re: Staff online widget always offline

    Post by Sanket 13/6/2013, 23:08

    Topic Solved & Archived

      Current date/time is 23/9/2024, 04:17