• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

phpbb3 Integration

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

Post a reply
28 posts • Page 1 of 2 • 1, 2

Postby Larry » Sat Jun 09, 2007 3:39 pm

I am just a begginer but I thought I would take a shot at integrating phpbb3. I actually made some progress but there is a conflict with the following two files.

utf8_substr.php
utf8_strlen.php

It seems that phpbb and phpFreeChat both use the same functions.

Any ideas?
Larry
New member
 
Posts: 5
Joined: Sat Jun 09, 2007 3:30 pm
Top

Postby phpfreechat » Sun Jun 10, 2007 11:07 am

Coud you try this patch (in lib/utf8/) ?
If it works for your I will integrate it in the next release.
Code: Select all
Index: utf8_char2byte_pos.php
===================================================================
--- utf8_char2byte_pos.php      (révision 1033)
+++ utf8_char2byte_pos.php      (copie de travail)
@@ -10,6 +10,7 @@
  * @return    integer        Byte position
  * @author    Martin Kutschker <martin.t.kutschker@blackbox.net>
  */
+if (!function_exists('utf8_char2byte_pos')) {
 function utf8_char2byte_pos($str,$pos)    {
   $n = 0;                // number of characters found
   $p = abs($pos);        // number of characters wanted
@@ -41,5 +42,6 @@

   return $i;
 }
+}

 ?>
 Pas de fin de ligne à la fin du fichier
Index: utf8_strlen.php
===================================================================
--- utf8_strlen.php     (révision 1033)
+++ utf8_strlen.php     (copie de travail)
@@ -9,6 +9,7 @@
  * @see strlen()
  * @author    Martin Kutschker <martin.t.kutschker@blackbox.net>
  */
+if (!function_exists('utf8_strlen')) {
 function utf8_strlen($str)    {
   $n=0;
   for($i=0; isset($str{$i}) && strlen($str{$i})>0; $i++)    {
@@ -20,5 +21,6 @@
   }
   return $n;
 }
+}

 ?>
 Pas de fin de ligne à la fin du fichier
Index: utf8_substr.php
===================================================================
--- utf8_substr.php     (révision 1033)
+++ utf8_substr.php     (copie de travail)
@@ -14,6 +14,7 @@
  * @see substr()
  * @author    Martin Kutschker <martin.t.kutschker@blackbox.net>
  */
+if (!function_exists('utf8_substr')) {
 function utf8_substr($str,$start,$len=null)    {
   if (!strcmp($len,'0'))    return '';

@@ -37,5 +38,6 @@
   }
   else    return $str;
 }
+}

 ?>
 Pas de fin de ligne à la fin du fichier
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Larry » Mon Jun 11, 2007 2:57 am

The patch seems to work. I can now start a session and retrieve the current username with this code.

Code: Select all
<?php

define('IN_PHPBB', true);
$phpbb_root_path = 'path'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.
// Start session management
$user->session_begin();
$auth->acl($user->data);

 get_username_string ;
echo $user->data [username];

?>

I then changed the nick parameter to this:

Code: Select all
$params["nick"]              = $user->data [username];

But something is still not working.
Larry
New member
 
Posts: 5
Joined: Sat Jun 09, 2007 3:30 pm
Top

Postby Larry » Mon Jun 11, 2007 3:26 am

Oops. Forgot to clear the cache. Its working now.

Thanks a lot for the help!
Larry
New member
 
Posts: 5
Joined: Sat Jun 09, 2007 3:30 pm
Top

Postby phpfreechat » Mon Jun 11, 2007 9:20 am

You are welcomed.
The patch is integrated in 1034 revision and will be available in next release.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Larry » Mon Jun 11, 2007 3:48 pm

Here is the finished file in case someone else wants t use it or correct my errors. Just change the site specific information.

Code: Select all
<?php

define('IN_PHPBB', true);
$phpbb_root_path = '/home/renegad6/public_html/bb/'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

 get_username_string ;
$oog = $user->data [username];

 // redirect to phpBB logon page if the user is not logged in
if ($oog == "Anonymous")
   {
      header("Location: http://renegade-cruisers.net/bb/ucp.php?mode=login");
   }
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Renegades";

$params["nick"]              = $user->data [username];
$params["frozen_nick"]    = true;     // do not allow to change the nickname
$params["isadmin"] = false; // just for debug ;)
$params["serverid"] = md5(renegades); // calculate a unique id for this chat
//$params["debug"] = true;
$params["theme_path"]    = dirname(__FILE__)."/themes";
$params["theme"]         = "blune";
$params["channels"] = array("Main Chat");
$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Renegades</title>
 
 </head>
 <body>

<div class="header">
      <h1>Renegades</h1>
     
</div>



<div class="content">
  <?php $chat->printChat(); ?>
</div>

</body></html>

The only problem I have had is that chat crashes if the user logs out of phpbb while in chat, but that is no biggie.
Last edited by Larry on Mon Jun 11, 2007 3:49 pm, edited 1 time in total.
Larry
New member
 
Posts: 5
Joined: Sat Jun 09, 2007 3:30 pm
Top

Postby xota » Sun Jul 29, 2007 4:06 am

Can anyone help me with the libs i have no ideia where i have to replace those things :s:S
xota
New member
 
Posts: 2
Joined: Sun Jul 29, 2007 4:04 am
Top

Postby Larry » Sun Jul 29, 2007 8:53 pm

The patch has been integrated into the latest release.
Larry
New member
 
Posts: 5
Joined: Sat Jun 09, 2007 3:30 pm
Top

Postby TouTou » Fri Aug 17, 2007 9:03 am

Hi,

I have integrated phpBB3 using the code proposed by Larry.
The inetgaration was done with succes but I have got a display problem :

[phpBB Debug] PHP Notice: in file C:/Inetpub/wwwroot/mahdia.org/v1/includes/frontend.php on line 94: Invalid argument supplied for foreach()

I don't know haw to resolve this problem :'(
for information i'm using joomla 1.0.13.
Thank you in advance for your help.
TouTou
New member
 
Posts: 1
Joined: Fri Aug 17, 2007 8:42 am
Top

Postby Yautja_cetanu » Mon Aug 27, 2007 2:15 pm

Sorry if this is a stupid question. But where are you supposed to put this code?
Yautja_cetanu
Member
 
Posts: 18
Joined: Sat Feb 25, 2006 1:47 am
Top

Postby Arcanjo » Thu Sep 13, 2007 7:54 pm

Hi!

Im using this script and works great..I only have one problem...how can I retrieve my Admin previleges from phpbb3?? or where to set it in isadmin?

my knowledges of php are almost nothing..some help please

Arcanjo
Arcanjo
New member
 
Posts: 3
Joined: Fri Jan 12, 2007 12:14 am
Top

Postby Ozzapoo » Sat Nov 24, 2007 2:40 am

Arcanjo wrote:Hi!

Im using this script and works great..I only have one problem...how can I retrieve my Admin previleges from phpbb3?? or where to set it in isadmin?

my knowledges of php are almost nothing..some help please

Arcanjo

Same here :( I'm currently doing

Code: Select all
if ( $params["nick"] == Admin ) { $params["isadmin"] = true; } else { $params["isadmin"] = false; };

which I'm not sure if it actually even works or not! :(
Last edited by Ozzapoo on Sat Nov 24, 2007 2:45 am, edited 1 time in total.
Ozzapoo
New member
 
Posts: 1
Joined: Sat Nov 24, 2007 2:28 am
Top

Postby Sonya* » Sat Dec 29, 2007 2:13 pm

You have to figure out what group_id you have in phpbb3 (I have 15) and then add this to you index.php in chat somewhere AFTER phpbb3 integration is made and before the line $chat = new phpFreeChat( $params );

if ($user->data['group_id'] == 15 ) {
$params["isadmin"] = true;
}

With this line all users belong to administrator group in forum will be administrator in chat as well.
New Chat on Herzlink
Sonya*
New member
 
Posts: 8
Joined: Wed Dec 26, 2007 6:58 pm
Top

Postby remmy » Sat Dec 29, 2007 9:02 pm

I'm no expert, and not a total dummy either.....but....
I can't get ANY integration script to work at all.

I've tried using most of the scripts here, with the necessary changes to adapt it to my site - but the chat page won't display at all. It works fine when the integration script is taken back out.

I thought it was a simple matter of the paths of the BB and Chat site locations, but I tried every single combination I could think of. The BB and Chat sites are at a peer level:

http://www.webweview.com/vmf2/
http://www.webweview.com/vchat/

It looks like it should be very simple, but like I said, the chat page doesn't even display.

I've tried at least 5 or 6 different scripts, but here's the chat script as it stands now:

<?php

define('IN_PHPBB', true);
$phpbb_root_path = '/vmf2/'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

get_username_string ;
$oog = $user->data [username];

// redirect to phpBB logon page if the user is not logged in
if ($oog == "Anonymous")
{
header("Location: http://www.webweview.com/vmf2/index.php?mode=login");
}

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["title"] = "vmfCHAT";
$params["nick"] = $user->data [username]; // setup the intitial nickname
$params["theme"] = "zilveer";
$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>vmfCHAT</title>

<?php $chat->printJavascript(); ?>
<?php $chat->printStyle(); ?>

</head>

<body>
<?php $chat->printChat(); ?>

</body>
</html>


Is there something very fundamental that I'm screwing up?
Thanks.
remmy
New member
 
Posts: 3
Joined: Sat Dec 29, 2007 8:45 pm
Top

Postby remmy » Mon Dec 31, 2007 11:25 pm

I still can't get the integration script to work at all.

I copied it exactly as provided on the FAQ page, and renamed the paths, and nick parameter. The chat page will not display at all. Remove the integration script, and voila, I have a chat site again.

At first I thought that maybe the zilveer theme was somehow causing a problem - but it doesn't work when using the default theme either. Any thoughts from anyone?
I won't use the chat if I can't get the integration to work.

Thank you and Happy New Year!
remmy
New member
 
Posts: 3
Joined: Sat Dec 29, 2007 8:45 pm
Top

Next

Post a reply
28 posts • Page 1 of 2 • 1, 2

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 2 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