• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Feature Requests (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Phpbb Integration

This forum is now locked as we will no longer be developing the v1.x branch

Moderators: OldWolf, re*s.t.a.r.s.*2

Topic locked
18 posts • Page 1 of 2 • 1, 2

Postby Yautja_cetanu » Sat Feb 25, 2006 2:00 am

This is looking really good!

However, how easy would phpbb integration be. Currently I use PJIRC, for the chatroom that integrates with the forum. However it uses Java, which uses up so many resources!

When I say integration, this is what I'm looking for (I know that some features of integration require some of the freatures in the roadmap to be completed first).

1) Users register and automatically log in via the phpbb inteface
2) A list of users chatting can be displayed in the "who is online" section
3) User rights and admin levels are handled via the phpbb ACP
4) Future updates by phpbb shouldn't effect it, so as little phpbb code changes as possible. (Obviously template changes will be required).

The second one being the most important.

What do you think? (Btw, as this is entirely opensource and in php... if you could turn this into a proper mod for phpbb, and get it validated. It would bring in LOADS of publicity. I know quite a few other people who are in my position, want a simple chatroom for phpbb, can't stand flash, java, or complicated IRC servers).

Edit: Found that you have a solution to the 1st problem (not as secure, but still good)
Last edited by Yautja_cetanu on Sat Feb 25, 2006 2:19 am, edited 1 time in total.
Yautja_cetanu
Member
 
Posts: 18
Joined: Sat Feb 25, 2006 1:47 am
Top

Postby fishy » Fri Aug 18, 2006 6:57 pm

Edit: Found that you have a solution to the 1st problem (not as secure, but still good)

where??!?!??
fishy
New member
 
Posts: 3
Joined: Fri Aug 18, 2006 6:31 pm
Top

Postby Valerie » Tue Oct 24, 2006 5:37 am

fishy wrote:
Edit: Found that you have a solution to the 1st problem (not as secure, but still good)

where??!?!??

Ditto. Where can we find more (solid) info on phpBB integration?
Valerie
New member
 
Posts: 5
Joined: Mon Oct 23, 2006 11:17 pm
Top

Postby andrewbelcher » Tue Oct 24, 2006 9:15 pm

This is a massively cut down version, as I'm still developing the full working version which has all the configuration done through the admin panel. However, this will work with the regular phpFreeChat functionality, with hard-coded param values:

File: <forum directory>/chat.php
Code: Select all
<?php
/***************************************************************************
 *                             AJAX CHATROOM MOD chatroom.php
 *                            -------------------
 *   begin                : 01/03/06
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//

$params = array();

// SET YOUR PARAMS HERE

if ( $userdata['session_logged_in'] == TRUE)
{
   require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php"; // Set to the correct directory for your install. Relative to the forum directory.
   $params['nick']          = $userdata['username'];  // setup the intitial nickname

   $chat = new phpFreeChat( $params );

   $chat_header = $chat->printJavascript('true');
   $chat_header .= $chat->printStyle('true');
   $chatroom = $chat->printChat('true');
}
else
{
   $chatroom = "Please <a href="login.php">login</a> to access the Chatroom.";
}

$page_title = $lang['Chat_Room'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
   'body' => 'chatroom.tpl')
);

$template->assign_vars(array(
     'CHATROOM_CODE' => $chatroom));

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>

That will currently only allow people in if they are logged in. If you want people to be able to use it without being logged in, do the following:
Code: Select all
Replace:

if ( $userdata['session_logged_in'] == TRUE)
{
   require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php"; // Set to the correct directory for your install. Relative to the forum directory.
   $params['nick']          = $userdata['username'];  // setup the intitial nickname

   $chat = new phpFreeChat( $params );

   $chat_header = $chat->printJavascript('true');
   $chat_header .= $chat->printStyle('true');
   $chatroom = $chat->printChat('true');
}
else
{
   $chatroom = "Please <a href="login.php">login</a> to access the Chatroom.";
}


With:

require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php"; // Set to the correct directory for your install. Relative to the forum directory.
$params['nick']          = $userdata['username'];  // setup the intitial nickname

$chat = new phpFreeChat( $params );

$chat_header = $chat->printJavascript('true');
$chat_header .= $chat->printStyle('true');
$chatroom = $chat->printChat('true');

File: <forum directory>/templates/subSilver/chatroom.tpl
Code: Select all
<table width="97%" cellspacing="1" cellpadding="1" border="0" align="center"><tr><td><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"><tr><th class="thTop" height="25">


Chatroom


</th></tr><tr><td class="row1" align="left"><span class="gensmall" style="line-height:150%">


{CHATROOM_CODE}

</span></td></tr></table></td></tr></table>

As I said - I'm still working on the fully functional phpBB integration, but don't hold your breath as I've just started uni and have loads of work, as well as a few other more important things to program for my church's website.

I imagine what will happen is that by the time I've got the time for this, phpBB3 will be out and I'll make the integration for that, which will be much better.
Last edited by andrewbelcher on Tue Oct 24, 2006 9:16 pm, edited 1 time in total.
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby sabreofsd » Wed Nov 08, 2006 8:47 pm

Hey Andrew,
Any luck finishing this? I tried the above, but receive this when trying it:
Error: the chat cannot be loaded! two possibilities: your browser doesn't support javascript or you didn't setup correctly the server directories rights

I saw some other code that will bring the chat into the bottom of the page. I might give that a try too :)
--------------
Sabre
sabreofsd
New member
 
Posts: 5
Joined: Wed Nov 08, 2006 5:14 pm
Location: Washington, DC area
  • Website
Top

Postby andrewbelcher » Thu Nov 09, 2006 4:06 pm

The JavaScript/directories error is nothing to do with the phpBB integration, but to do with the set-up of your phpFreeChat instance. Have you got all the permissions sorted correctly on the data (sub)directories?
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby sabreofsd » Thu Nov 09, 2006 5:37 pm

Hey Andrew,
Thanks for getting back to me. The permissions seem to be setup correctly since when I go directly to chat (using the included index.php in PFC), it works correctly. I have phpbb installed in my root web path and PFC installed under ./chat/ from there. I modified the line in chat.php so that it references the correct class file, but is there anything else that I needed to change?
Thanks again for all the help!
--------------
Sabre
sabreofsd
New member
 
Posts: 5
Joined: Wed Nov 08, 2006 5:14 pm
Location: Washington, DC area
  • Website
Top

Postby bgx » Fri Nov 10, 2006 10:05 am

Hi!

I have the same problem like sabreofsd.

What could I do?
bgx
New member
 
Posts: 8
Joined: Fri Nov 10, 2006 9:13 am
  • Website
Top

Postby EdB » Fri Nov 10, 2006 12:51 pm

I followed the steps in http://www.phpfreechat.net/forum/viewtopic.php?id=389 and had a beta-6 chat up and running as a phpbb forum (v2.0.21) without issue.
Last edited by EdB on Fri Nov 10, 2006 12:51 pm, edited 1 time in total.
EdB
New member
 
Posts: 5
Joined: Sat Oct 28, 2006 10:12 am
  • Website
Top

Postby bgx » Fri Nov 10, 2006 2:05 pm

When I write in my chatroom.php file:

$chat_header = $chat->printJavascript();
$chat_header .= $chat->printStyle();
$chatroom = $chat->printChat('true');

it works, but headers output before and I get a Headeroutput Error, because the JS-Code is before the HTML.
bgx
New member
 
Posts: 8
Joined: Fri Nov 10, 2006 9:13 am
  • Website
Top

Postby andrewbelcher » Fri Nov 10, 2006 6:12 pm

That's interesting bgx... I think you may be on to the problem. The 'true' in the $chat->printJavaScript is so that the code is returned rather than outputted, which is why you have the problems with it being outside the HTML when you take the true away. This might be something that has come in with v7, as I developed this using 6... What server do you run?


I don't have much time to look into this now, as I've a load of uni work - but if it is a problem since Beta 7, it might be something for Kerphi to look into... I've definitely got it working with that code exactly previously, but that could be something to do with set-up also...
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby bgx » Fri Nov 10, 2006 6:22 pm

Hi andrew!

Thx for looking at my problem!

I see you have tried to look at it onto my page.

Here the HTML from my site without the ('true').

Code: Select all
<script type="text/javascript">
var xajaxRequestUri="./chatroom.php";
var xajaxDebug=false;
var xajaxStatusMessages=false;
var xajaxWaitCursor=false;
var xajaxDefinedGet=0;
var xajaxDefinedPost=1;
var xajaxLoaded=false;
function pfc_handleRequest(){return xajax.call("handleRequest", arguments, 1);}
</script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=xajax_0.2.3/xajax_js/xajax.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/md5.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/cookie.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/image_preloader.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/myprototype.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/regex.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/utf8.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/sprintf2.js"></script>

<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/activity.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=javascript/mousepos.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=pfcclient.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=pfcgui.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=pfcresource.js"></script>
<script type="text/javascript" src="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=default/customize.js"></script>
<link rel="stylesheet" type="text/css" href="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=default/style.css" />
<link rel="stylesheet" type="text/css" href="phpfreechat-1.0-beta7/data/public/de36da0b9644441e6d216ed817133097/proxy.php?p=green/style.css" />
<style type="text/css">div#pfc_channels_content { height: 300px; }</style>
<br />

<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/w005fafa/sh/phpfreechat-1.0-beta7/src/phpfreechat.class.php:129) in <b>/www/htdocs/w005fafa/sh/includes/page_header.php</b> on line <b>978</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/w005fafa/sh/phpfreechat-1.0-beta7/src/phpfreechat.class.php:129) in <b>/www/htdocs/w005fafa/sh/includes/page_header.php</b> on line <b>980</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/w005fafa/sh/phpfreechat-1.0-beta7/src/phpfreechat.class.php:129) in <b>/www/htdocs/w005fafa/sh/includes/page_header.php</b> on line <b>981</b><br />

<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/w005fafa/sh/phpfreechat-1.0-beta7/src/phpfreechat.class.php:129) in <b>/www/htdocs/w005fafa/sh/includes/page_header.php</b> on line <b>984</b><br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>

<title></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Language" content="de">

<meta name="Content-Language" content="de">
<meta name="robots" content="index, follow">
<meta name="Copyright" content="Tobias Hau">

...and so...


You see the Javascript is before the <html>block, but the chat works (with the header error).

When I adding the ('true') to it I get the same error like sabreofsd!

My Server is one from Germany allinkl.

I'm at the moment at work and can't go onto my FTP to fill in the ('true').

Have tried a lot but don't know how to fix this.

I see other phpbb webmaster have integratet it. But what made I wrong?
Last edited by bgx on Fri Nov 10, 2006 6:26 pm, edited 1 time in total.
bgx
New member
 
Posts: 8
Joined: Fri Nov 10, 2006 9:13 am
  • Website
Top

Postby andrewbelcher » Fri Nov 10, 2006 6:42 pm

Ok... I currently have it working absolutely fine with phpFreeChat Beta 5... So that version definitely can work. If you can get it working with phpFreeChat Beta 5 also, using the above as I had it (so with the trues), then I'd need some input from Kerphi as to what has changed since Beta 5 that could be causing this problem.
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby bgx » Fri Nov 10, 2006 6:49 pm

ok thx a lot! I will try the beta5 later when I at home and let you know if it works.

I think that some JS is missed, because in the JS-Console I get the error that the pfc is not filled.
bgx
New member
 
Posts: 8
Joined: Fri Nov 10, 2006 9:13 am
  • Website
Top

Postby bgx » Sat Nov 11, 2006 11:14 am

hi andrew!

the same behavior with beta6.

Here the link to my chat with set ('true')

perhabs you can take a look on it?

http://www.springenderhund.de/chatroom.php

I have set it up that you can look without login!

Another Question!

Where is the var $chat_header included?

I can't find it in my script. It should include in the overall_header?

Perhabs the reason why it only go by you is that we don't have the var included?
Last edited by bgx on Tue Nov 28, 2006 5:40 pm, edited 1 time in total.
bgx
New member
 
Posts: 8
Joined: Fri Nov 10, 2006 9:13 am
  • Website
Top

Next

Topic locked
18 posts • Page 1 of 2 • 1, 2

Return to Feature Requests (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub