auto update chat users without page refresh
2 posters
Page 1 of 1
auto update chat users without page refresh
where it says
There are currently ### user(s) on the ChatBox�
is there anyway to write a script or something to make this update without a page refresh?
There are currently ### user(s) on the ChatBox�
is there anyway to write a script or something to make this update without a page refresh?
Re: auto update chat users without page refresh
Hi! It's AWC you're using, right? I'm an AWC user as well. I've seen you on AvacWeb b4. Hey, Ange wrote a script for refreshing chat every whatever you like for a period. You may wanna search for that in the topics around here. Just saying. It may help you. And since you're a good scripter, you might find yourself the answer in just that one small but very important post of her! If you can't find the answer here, please consult LG first I'd advise!
Guest- Guest
Re: auto update chat users without page refresh
no im not talking about the chat box but on the forum itself under
Who is online?
Who is online?
Re: auto update chat users without page refresh
Like I said b4, you're a good scripter, and I think together with what Ange wrote b4 you might strike lucky. Else, please consult Ange on this. She's the greatest on this. Sorry for interrupting in this topic of yours, I thought I could help you out and get you in the right direction...
Guest- Guest
Re: auto update chat users without page refresh
yea i looked around and tried to change up some other script but had no luck.. im still a script kiddy im just starting to learn javascript
Re: auto update chat users without page refresh
<< NVM the n00b. I'm ok. You should really get in touch with Ange! She's an angel. Please, be very kind to her. I'm sure she can help you!
Guest- Guest
Re: auto update chat users without page refresh
Hi _Twisted_Mods_,
Is your chatbox on the homepage where those texts are ? If so, we can access the frame to get the length of the chat members. Otherwise, we could probably use some AJAX to load the chatbox. ( never tried that )
Is your chatbox on the homepage where those texts are ? If so, we can access the frame to get the length of the chat members. Otherwise, we could probably use some AJAX to load the chatbox. ( never tried that )
Re: auto update chat users without page refresh
yea the chatbox is on the forum page so you can get the iframe .. and i dont know crap about ajax other then i think its some kinda cleaner lmao
Re: auto update chat users without page refresh
Yeah, you should keep far off of that AJAX stuff I know. Ange's wearing special toxic waste gloves for that. We better stand back while Ange's on it.
Guest- Guest
Re: auto update chat users without page refresh
Try this :
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
Paste the code below :
It should update the count whenever someone signs in or out.
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
Paste the code below :
- Code:
$(function() {
var fa_chat = document.getElementById('frame_chatbox'), frame;
if (!fa_chat) return;
fa_chat.onload = function() {
if (fa_chat.contentDocument) frame = fa_chat.contentDocument;
else if (fa_chat.contentWindow) frame = fa_chat.contentWindow.document;
var mem_thn = frame.getElementById('chatbox_members').getElementsByTagName('LI').length, mem_now;
var a = frame.getElementsByTagName('A');
for (var i=0; i<a.length; i++) if (/archives/.test(a[i].href)) a[i].onclick = function() { window.clearInterval(_chat_refresh) };
_chat_refresh = window.setInterval(function() {
mem_now = frame.getElementById('chatbox_members').getElementsByTagName('LI').length;
if (mem_now > mem_thn || mem_now < mem_thn) {
var s = document.getElementsByTagName('SPAN'),i;
for (i=0; i<s.length; i++) if (/gensmall/.test(s[i].className) && /ChatBox/.test(s[i].innerHTML)) s[i].innerHTML = s[i].innerHTML.replace(/<strong>\d+<\/strong>/,'<strong>'+mem_now+'</strong>');
mem_thn = mem_now;
}
},1);
}
});
It should update the count whenever someone signs in or out.
Re: auto update chat users without page refresh
unfortunately it didn't work .. idk if it would effect it but our names r styled like i have a image for my name some people have shadows and some people have icons b4 there name
Re: auto update chat users without page refresh
I'm sorry I thought you were talking about the member count :
I'll have to write something else for the usernames..
I'll have to write something else for the usernames..
Re: auto update chat users without page refresh
sorry i didnt specify b4 i was wanting to update both the # of online and the name list
Similar topics
» Chat will not auto refresh
» [ONLY TOPIC]Chat box - refresh, Auto logout, Cant log in Problems
» auto refresh
» Chatbox auto refresh not working.
» Chat box fails to refresh
» [ONLY TOPIC]Chat box - refresh, Auto logout, Cant log in Problems
» auto refresh
» Chatbox auto refresh not working.
» Chat box fails to refresh
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum