Author |
Message |
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Thu Mar 06, 2003 12:15 pm (21 years, 3 months ago) |
|
I read a few posts about your chat room but notice there wasn't what I would call a tutorial. Have you thought about doing a step by step tutorial on integrating a chat into phpBB?
(and when I say step by step I mean step by step, from first to last step, for us thickies ) |
________________________________ Phil.
My Musical Preferences
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Mar 06, 2003 12:55 pm (21 years, 3 months ago) |
|
the 4webhelp chat room isn't integrated into phpBB, it's IRC and runs on webchat.org...as far as I know, it doesn't have anything to do with the forums. |
________________________________ It's turtles all the way down... |
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Thu Mar 06, 2003 1:49 pm (21 years, 3 months ago) |
|
yeah, I realise that but it's easily linked from the forum where it pulls in your forum username to use when you enter, as I noticed this morning while playing around
And as someone who can only get onto IRC with full instructions (or by the way of clicking a link) it would be handy to know how to set it up 'from scratch' |
________________________________ Phil.
My Musical Preferences
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Thu Mar 06, 2003 4:56 pm (21 years, 3 months ago) |
|
As adam says, the forums aren't really linked to the chat room. All I have done is install a java interface from http://www.webmaster.com which access the webchat.org servers. In the code which calls the java applet, there is an option to set the username (although you won't be able to keep it if it is already registered on the IRC server). What I did was add a little PHP like this:
Code: | <param name="nick" value="<?php echo $username; ?>"> |
All that does it print out the username which is passed in the query string, like this: chat.php?username=Daniel. The applet then uses this to connect. |
________________________________
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Sun Mar 09, 2003 5:52 pm (21 years, 3 months ago) |
|
Quote: |
All that does it print out the username which is passed in the query string, like this: chat.php?username=Daniel. The applet then uses this to connect
|
ah, so how does that look in the links? What is the format of the link itself in the template?
Thanks. |
________________________________ Phil.
My Musical Preferences
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Mar 09, 2003 5:55 pm (21 years, 3 months ago) |
|
In the template:
Code: | <a href="{CHAT}">Chat Room</a> |
After:
Code: | 'T_SPAN_CLASS3' => $theme['span_class3'], |
In includes/page_header.php:
Code: | 'CHAT' => append_sid("chat.php?username=".$userdata['username']), |
|
________________________________
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Sun Mar 09, 2003 6:31 pm (21 years, 3 months ago) |
|
excellent thanks. I have a chat room on my site at the moment but it's actually running on my home PC at the moment until I can find another that I feel is satisfactory. I tried the Backpack one but for some reason it kept crashing my browser and twice locked up my PC so only a reboot would release it. (Although yours did neither when I looked in there)
I'll let you know how it goes |
________________________________ Phil.
My Musical Preferences
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Sun Mar 09, 2003 7:56 pm (21 years, 3 months ago) |
|
excellent! This also worked for my chat I just changed username to login as that's what the param name is.That should keep some users happy, save them having to click 2 links to join the chat
Now I just need to find out how to include the 'users online in chat' text file that I generate. |
________________________________ Phil.
My Musical Preferences
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Mar 09, 2003 8:39 pm (21 years, 3 months ago) |
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Sun Mar 09, 2003 8:52 pm (21 years, 3 months ago) |
|
Unfortunately not. My chat isn't IRC but I can access it with mIRC with a script and mIRC generates my usernames.txt file and logs the chat. I'm basicaly just trying to find somewhere to include the file that doesn't wreck everything on the forum. The problem at the moment is that I'd like to just <?php include.... the file but this doesn't work in the templates and even when I tried the "php in templates" mod it wouldn't work. And that's as far as I've progresssed so far but am still working on it |
________________________________ Phil.
My Musical Preferences
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Mar 10, 2003 7:04 am (21 years, 3 months ago) |
|
Try this in page_header.php:
Code: | ob_start();
include($DOCUMENT_ROOT.'/file.php');
$online = ob_get_contents();
ob_end_clean(); |
Then put this after the line I told you to insert in my second last post:
Code: | 'ONLINE' => $online, |
Then just put {ONLINE} in your template. That should work.. |
________________________________
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Mon Mar 10, 2003 8:02 am (21 years, 3 months ago) |
|
Thanks. I'll give that a try, I'll let you know how I get on |
________________________________ Phil.
My Musical Preferences
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Mon Mar 10, 2003 10:10 am (21 years, 3 months ago) |
|
Fantastic All sorted now, thanks for all your help.
if you want to take a look http://www.ashington-ne.co.uk/forum/index.php I have it set so only registered members can get into the chat this way as it tried to log all unregistered in as Anonymous, first one got in fine no others could get in (found when testing), so a temp account has been created with Username: test Password: test |
________________________________ Phil.
My Musical Preferences
|
|
|
|
thetribe
WebHelper
Joined: 10 Nov 2002
Posts: 62
Location: Ashington, Northumberland. UK
|
Posted:
Mon Mar 10, 2003 10:35 am (21 years, 3 months ago) |
|
Just had to make an amendment, had to change the include statement to be
Code: |
"include($phpbb_root_path . 'chatonline.php');"
|
as it threw up errors in posting.php
Code: |
<b>Warning</b>: open_basedir restriction in effect. File is in wrong directory in <b>/usr/local/psa/home/vhosts/ashington-ne.co.uk/httpdocs/forum/includes/page_header.php</b> on line <b>360</b><br>
<br>
<b>Warning</b>: Failed opening '/forum/chatonline.php' for inclusion (include_path='.:') in <b>/usr/local/psa/home/vhosts/ashington-ne.co.uk/httpdocs/forum/includes/page_header.php</b> on line <b>360</b><br>
|
|
________________________________ Phil.
My Musical Preferences
|
|
|
|
|