The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Staff online widget always offline

View previous topic View next topic Go down

Solved Staff online widget always offline

Post by Bonetz on June 13th 2013, 3:57 pm

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 June 13th 2013, 6:05 pm; edited 1 time in total

Bonetz
New Member

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

Back to top Go down

Solved Re: Staff online widget always offline

Post by E-Mark on June 13th 2013, 4:07 pm

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

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: Staff online widget always offline

Post by LGforum on June 13th 2013, 5:15 pm

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.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Staff online widget always offline

Post by Bonetz on June 13th 2013, 5:29 pm

@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

Bonetz
New Member

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

Back to top Go down

Solved Re: Staff online widget always offline

Post by LGforum on June 13th 2013, 5:36 pm

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

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Staff online widget always offline

Post by Bonetz on June 13th 2013, 5:43 pm

@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..

Bonetz
New Member

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

Back to top Go down

Solved Re: Staff online widget always offline

Post by Bonetz on June 13th 2013, 5:46 pm

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

Bonetz
New Member

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

Back to top Go down

Solved Re: Staff online widget always offline

Post by LGforum on June 13th 2013, 5:56 pm

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

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Staff online widget always offline

Post by Bonetz on June 13th 2013, 6:03 pm

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

Bonetz
New Member

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

Back to top Go down

Solved Re: Staff online widget always offline

Post by Sanket on June 13th 2013, 6:08 pm

Topic Solved & Archived

Sanket
ForumGuru

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

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum