Chatbox No-Kick
4 posters
Page 1 of 1
Chatbox No-Kick
Hi
Well as most of you probably know already the chatbox is pretty bad. It automatically logs you off or sets you afk, which makes it really complicated to use. Of course there is no way to change the settings in it nor forumotion seems to do anything about it (despite it has been requested years ago)
I am looking for a way to solve this using javascript. I want to disable the 'away' mode as well as the auto-kick.
Well as most of you probably know already the chatbox is pretty bad. It automatically logs you off or sets you afk, which makes it really complicated to use. Of course there is no way to change the settings in it nor forumotion seems to do anything about it (despite it has been requested years ago)
I am looking for a way to solve this using javascript. I want to disable the 'away' mode as well as the auto-kick.
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
So the JavaScript you're looking for will keep you online at all times, until you log out?
Re: Chatbox No-Kick
Alright well, I just asked that to clarify it for the one who could provide the JavaScript, since I don't really code JavaScript.
Re: Chatbox No-Kick
Or maybe you're just trying to boost your post count, since I made it pretty clear from the start
Now you can post again! wohoo!
Now you can post again! wohoo!
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
Actually that's not the point. A post count is really nothing, just a number. And that's off topic.
On Topic: I'm not sure if this sort of JavaScript could work as I've googled around a bit, but still there is a possibility.
EDIT: After some forumotion searching, I found this: http://chat.avacweb.net/features It's supposed to work on forumotion, I'm not sure if it still does though.
On Topic: I'm not sure if this sort of JavaScript could work as I've googled around a bit, but still there is a possibility.
EDIT: After some forumotion searching, I found this: http://chat.avacweb.net/features It's supposed to work on forumotion, I'm not sure if it still does though.
Re: Chatbox No-Kick
So you don't know a lot of javascript, but you googled for 5 minutes and came to the conclusion that it's "probably not possible" but you're not sure and you think there's actually a possibility. Thanks for your useful reply! Why aren't you in the staff yet?
Edit: that clearly doesn't have anything to do with the standard forumotion chatbox. I don't see how it helps, but thank you I guess.
Edit: that clearly doesn't have anything to do with the standard forumotion chatbox. I don't see how it helps, but thank you I guess.
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
Hello MacroNecroX,
Everyone helps in their own way, there is no need to be disrespectful..
Try this :
Administration Panel > Modules > Javascript codes management > Create a new script
Title : Your choice
Placement : In the homepage
Everyone helps in their own way, there is no need to be disrespectful..
Try this :
Administration Panel > Modules > Javascript codes management > Create a new script
Title : Your choice
Placement : In the homepage
- Code:
setInterval(function(){ $.post('/chatbox/chatbox_actions.forum?archives','mode=send&sent='); }, 5000);
Re: Chatbox No-Kick
Thanks for your reply. And I didn't mean to be disrespectful, it's just that there are a lot of people who just provide useless replies here.
I am now trying to remove the "loged off / logged in" chatbox messages using jQuery. I've put this global script, and it doesn't seem to be working:
Any idea?
Thanks
I am now trying to remove the "loged off / logged in" chatbox messages using jQuery. I've put this global script, and it doesn't seem to be working:
- Code:
<script type="text/javascript">
$(function(){
$('p.chatbox:contains("has been disconnected on")').css( "display" , "none" );
});
</script>
Any idea?
Thanks
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
The chatbox is set in a frame, or <object>. You'll need to access that frame to modify its contents. However, it's a bit tricky, since the data is refreshed when a message is submitted. You can set an interval and determine when a new message is posted by comparing a global and local variable. See if this works for you :
Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
This variable determines how often the interval compares the messages from then and now. If there is a difference between the two, it will execute the function to hide the logs. The higher the refresh_rate the longer it will take for the comparison and vise versa.
Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
- Code:
$(function() {
var refresh_rate = 1000, fa_chat = document.getElementById('frame_chatbox'), frame;
fa_chat.onload = function() {
if (fa_chat.contentDocument) { frame = fa_chat.contentDocument }
else if (fa_chat.contentWindow) { frame = fa_chat.contentWindow.document }
_chatdata_msg_thn = frame.getElementById('chatbox').getElementsByTagName('p').length;
hideLogs();
setInterval(function() {
var msg_now = frame.getElementById('chatbox').getElementsByTagName('p').length;
if (msg_now > _chatdata_msg_thn || msg_now < _chatdata_msg_thn) {
hideLogs();
_chatdata_msg_thn = msg_now;
}
},refresh_rate);
function hideLogs() {var s = frame.getElementsByTagName('SPAN');for (i=0; i<s.length; i++) {if (s[i].style.color == 'green' || s[i].style.color == 'red') {var p = s[i].parentNode.parentNode;if (p.style.display != 'none') p.style.display = 'none'}}}
}
});
This variable determines how often the interval compares the messages from then and now. If there is a difference between the two, it will execute the function to hide the logs. The higher the refresh_rate the longer it will take for the comparison and vise versa.
- Code:
refresh_rate = 1000
Re: Chatbox No-Kick
Thanks for your help so far.
While that works somewhat, it's really not the most optimal way to achieve this. Wouldn't it be possible to simply disable users from going into the away status by modifying the AJAX request? This would solve all issues. Because right now, users getting re-logged by the script spam these log in/off messages constantly, and also automatically joins everyone into the chatroom.
While that works somewhat, it's really not the most optimal way to achieve this. Wouldn't it be possible to simply disable users from going into the away status by modifying the AJAX request? This would solve all issues. Because right now, users getting re-logged by the script spam these log in/off messages constantly, and also automatically joins everyone into the chatroom.
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
I see what you mean. You could make it post to the cb only while the user is logged into the chat. You can remove the last two scripts I gave you, if you want. Choose the one you want :
Post to cb only while logged in + remove message logs :
or post to cb only while logged in :
Like before they can be applied in JavaScript management and in the homepage.
Post to cb only while logged in + remove message logs :
- Code:
$(function() {
var refresh_rate = 1000, fa_chat = document.getElementById('frame_chatbox'), frame;
fa_chat.onload = function() {
if (fa_chat.contentDocument) { frame = fa_chat.contentDocument }
else if (fa_chat.contentWindow) { frame = fa_chat.contentWindow.document }
_chatdata_msg_thn = frame.getElementById('chatbox').getElementsByTagName('p').length;
hideLogs();
setInterval(function(){
if (frame.getElementById('chatbox_option_co').style.display != 'none') return;
$.post('/chatbox/chatbox_actions.forum?archives','mode=send&sent=');
}, 5000);
setInterval(function() {
var msg_now = frame.getElementById('chatbox').getElementsByTagName('p').length;
if (msg_now > _chatdata_msg_thn || msg_now < _chatdata_msg_thn) {
hideLogs();
_chatdata_msg_thn = msg_now;
}
},refresh_rate);
function hideLogs() {
var s = frame.getElementsByTagName('SPAN');
for (i=0; i<s.length; i++) {
if (s[i].style.color == 'green' || s[i].style.color == 'red') {
var p = s[i].parentNode.parentNode;
if (p.style.display != 'none') p.style.display = 'none';
}
}
}
}
});
or post to cb only while logged in :
- Code:
$(function() {
var fa_chat = document.getElementById('frame_chatbox'), frame;
fa_chat.onload = function() {
if (fa_chat.contentDocument) { frame = fa_chat.contentDocument }
else if (fa_chat.contentWindow) { frame = fa_chat.contentWindow.document }
setInterval(function(){
if (frame.getElementById('chatbox_option_co').style.display != 'none') return;
$.post('/chatbox/chatbox_actions.forum?archives','mode=send&sent=');
}, 5000);
}
});
Like before they can be applied in JavaScript management and in the homepage.
Re: Chatbox No-Kick
Thanks
So it's not possible to modify the script to prevent users becoming AFK after 10 minutes?
So it's not possible to modify the script to prevent users becoming AFK after 10 minutes?
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
You're welcome.
I can see a portion of the functions in the chatbox script, but as far as the timeout goes I didn't see anything of interest. It looked like basic functions; formatting, message sending, refreshing.. It might be server side.
I can see a portion of the functions in the chatbox script, but as far as the timeout goes I didn't see anything of interest. It looked like basic functions; formatting, message sending, refreshing.. It might be server side.
Re: Chatbox No-Kick
i think it sets a exasperation time for your cb cookies everytime you post a msg so you would have to find away to edit that cookie or over write it
this what i seen in the js
this what i seen in the js
- Code:
function SetCookie(name,value){var expire='';var path="/";var domain='';document.cookie=name+"="+value+"; path="+path+expire+domain+';'}function copy_user_name(user_name){if(document.post.message)
Re: Chatbox No-Kick
Ange Tuteur wrote:You're welcome.
I can see a portion of the functions in the chatbox script, but as far as the timeout goes I didn't see anything of interest. It looked like basic functions; formatting, message sending, refreshing.. It might be server side.
Hey,
how about making "view archives" option to be set by default? That way the log in/out messages are removed, which would be an optimal solution on top of the auto-login, then I can remove the "without archives" option with css
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Re: Chatbox No-Kick
I didn't think about that ! You should be able to change the object data so it will automatically be on the archives URL. See if this works :
* Like always, add in the homepage
* Like always, add in the homepage
- Code:
$(function() {
var fa_chat = document.getElementById('frame_chatbox');
fa_chat.data = '/chatbox/index.forum?archives=1';
});
Re: Chatbox No-Kick
thank you, it worked
MarcoNecroX- Forumember
- Posts : 95
Reputation : 3
Language : English
Similar topics
» Pop up chatbox?
» Chatbox Scripting: Editing the Ban and Kick messages.
» Chatbox
» Chat change for Kick
» My Chatbox Will Not Appear
» Chatbox Scripting: Editing the Ban and Kick messages.
» Chatbox
» Chat change for Kick
» My Chatbox Will Not Appear
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum