Staff online widget always offline
4 posters
Page 1 of 1
Staff online widget always offline
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 ..
here is the code that I use ..
This code was provided by P-Robs
Source of the Link : Click Here
I hope you help me about this one ..
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
- Posts : 18
Reputation : 2
Language : C++ , Visual Basics , PHP , Java
Location : Cavite , Philippines
Re: Staff online widget always offline
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.
Re: Staff online widget always offline
The code you're using is for a phpbb2 forum. Try this HTML widget:
That should work on your forum as long as you keep the 'Who is online' widget at the bottom of your sidebar.
- 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
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Staff online widget always offline
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
- Posts : 18
Reputation : 2
Language : C++ , Visual Basics , PHP , Java
Location : Cavite , Philippines
Re: Staff online widget always offline
I edited my post above and it seems like you've coped the code before I made the edit. Try it again.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Staff online widget always offline
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
- Posts : 18
Reputation : 2
Language : C++ , Visual Basics , PHP , Java
Location : Cavite , Philippines
Re: Staff online widget always offline
Sir i think i got a typo error in your code .. give me 10 mins to fix it ..
Bonetz- New Member
- Posts : 18
Reputation : 2
Language : C++ , Visual Basics , PHP , Java
Location : Cavite , Philippines
Re: Staff online widget always offline
Just visited your forum and seems to be working. The only staff member online is Bonetz.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Staff online widget always offline
Sir its working now thx for the code and for the help .. Solved~
Thanks again~
Thanks again~
Bonetz- New Member
- Posts : 18
Reputation : 2
Language : C++ , Visual Basics , PHP , Java
Location : Cavite , Philippines
Re: Staff online widget always offline
Topic Solved & Archived
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Similar topics
» Staff Online Widget Problem
» Staff online widget
» View online Staff in a widget?
» Modify Staff Online Widget
» How can I make a staff online widget?
» Staff online widget
» View online Staff in a widget?
» Modify Staff Online Widget
» How can I make a staff online widget?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum