Auto login Chatbox
Posted October 25th 2011, 2:09pm
First, Go to /chatbox/index.forum?, then Ctrl + U and copy all. Paste it in the new HTML page (Modules >> HTML pages management)
Second, find the tag and add in it
onload="if(!connected){CB_disconnect();}ajax_refresh_chatbox('?archives=100', 1);"

Third, at the very bottom, you will find something likes this
'&tid=b8b16b36400e4345333bea3bd76ac621'
(This is my tid, every chatboxs has a different tid number.)
Then, change it into
my_getcookie('mytid').substr(my_getcookie('mytid').indexOf('&tid='),37)

Save your html page and get its url.
For phpbb3, create 2 new javascripts and tick in homepage or in all the pages whatever you want. (one for the chatbox iframe, one for the cookies :) )
$(function(){
$('<iframe src="your-chatbox-url" scrolling="no" width="100%" height="340" style="border-width:0" marginwidth="0" marginheight="0"></iframe>').insertBefore('#page-body');});

jQuery(document).ready(function(){my_setcookie('mytid',jQuery("#logout").attr("href"),1,0);});

For Punbb and Phpbb2, go to Display >> Templates >> Index_body >> Find {CHATBOX_TOP} or {CHATBOX_BOTTOM} and paste the code this code below it.
<script type="text/javascript">
jQuery(document).ready(function(){my_setcookie('mytid',jQuery("#logout").attr("href"),1,0);});
</script>
<iframe src="your-chatbox-url" scrolling="no" width="100%" height="340" style="border-width:0" marginwidth="0" marginheight="0"></iframe>


[align=right]Source: http://diendan.chinhphuc.info/t18103-topic
Translate by Zero[/align]
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 25th 2011, 2:21pm
I could not find {CHATBOX_TOP} or the bottom one for my PunBB forum :|
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Auto login Chatbox
Posted October 25th 2011, 2:36pm
Oh, sr it's in index_body Image
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 25th 2011, 3:31pm
nice .. but can u make the code for invision to please ?
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted October 25th 2011, 4:08pm
I have never used invision before >.< So if someone can help me on it, it will be great Image
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 25th 2011, 4:14pm
emm okay then but can anyone help ?
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted October 25th 2011, 7:02pm
another chatbox appear, does this chatbox is auto log in?
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted October 25th 2011, 7:15pm
still i get disconnected from the chatbox
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted October 25th 2011, 9:33pm
@sentinel: Oh i forgot to tell you guys that you must active the chatbox (in modules) and then choose the "do not display" option :)
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 25th 2011, 10:03pm
i already do that but still i get disconnected from the chatbox
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted October 26th 2011, 12:08pm
@sentinel: All you have to do is adding this code
    onload="if(!connected){CB_disconnect();}ajax_refresh_chatbox('?archives=100', 1);"
into the <body> tag. It will work but the main problem is the notification messages will show everytime you reload the page. To fix that problem I used the cookie
my_getcookie('mytid').substr(my_getcookie('mytid').indexOf('&tid='),37)

but i don't why it doesn't work for phpbb3 >.<
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 26th 2011, 1:08pm
Why exactly is the tid needed for this?
What you need is a chatbox in an iframe that when loads calls function. That function will check if the user is logged in and if not perform CB_disconnect.

The tid isn't needed I don't believe.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Auto login Chatbox
Posted October 26th 2011, 1:30pm
@LGforum: The tid need to be changed because when you reload the page, the chatbox will re-login again that means there will be many notification messages in your chatbox. So you should use the cookie to stop that problem. Image
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Auto login Chatbox
Posted October 26th 2011, 1:32pm
The session ID is needed because the entire chatbox is being put into an HTML file. It's actually a good way to solve most of the chatbox issues, though this example doesn't go very far in that direction.

(Example...why load the full CSS when all you need is the chatbox CSS?)
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Auto login Chatbox
Posted October 26th 2011, 5:58pm
where can i say the body tag?
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted November 12th 2011, 8:41am
someone make it for invision to ?
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted November 12th 2011, 1:18pm
For IPB2/Invision boards, instead of this:

$('<iframe src="your-chatbox-url" scrolling="no" width="100%" height="340" style="border-width:0" marginwidth="0" marginheight="0"></iframe>').insertBefore('#page-body');});

use this:

$('<iframe src="your-chatbox-url" scrolling="no" width="100%" height="340" style="border-width:0" marginwidth="0" marginheight="0"></iframe>').insertBefore('#main-content');});
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Auto login Chatbox
Posted November 12th 2011, 2:11pm
on my forum I have been able to popout chatbox via iframe, but the significance of this is that iframe ONLY loads onclick, rather load at every page (thereby increasing loading time) drastically. Problem is that I cant use this, as well as number counter chatbox tut :o
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Auto login Chatbox
Posted November 15th 2011, 7:11am
sir how about for phpbb3 , i still get disconnected from the cbox
φ
Posts:
Avatar
Guest
Auto login Chatbox
Posted November 15th 2011, 10:43am
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8

Who is online

Users browsing this forum: No registered users and 1 guest