Knowledgebase
Knowledgebase
phpBB v2.x Integration
Posted by Anthony B. on 03 January 2012 09:58 AM

These instructions assist you with the integration of the AddonChat software into the polular phpBB forum software.

phpBB can be obtained from www.phpbb.com/downloads.php
AddonChat can be obtained from www.addonchat.com/products.html

The following instructions apply to the Professional / Professional Plus or Enterprise editions:

  1. Open up Notepad or a similar text editing piece of software
  2. Copy and paste the following code into Notepad or similar ensuring that XXXXX is replaced with your room number (the numeric portion of your account number beginning with SC-) and the servername is identical with that of your own which you may look up from the Home -> Chat Room Link Code section of your AddonChat control panel. A typical server name might be "client4.addonchat.com" or similar.
<?php
// standard hack prevent 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx);
// standard session management 
$userdata = session_pagestart($user_ip, PAGE_INDEX );
init_userprefs($userdata);
// set page title 
$page_title = 'AddOnChat';
// redirect to login if not logged in
if ( empty($userdata['user_id']) || $userdata['user_id'] == ANONYMOUS )
{
       redirect(append_sid("login.$phpEx?redirect=chat.$phpEx", true));
}
// standard page header 
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$naam = $userdata['username'];
?>
<applet code="Client.class" 
   codebase="http://clientX.addonchat.com/current/
   archive="scclient_en_uk.zip" width="600" height="425"
   alt="Java Chat Software - AddonChat" MAYSCRIPT>
   <param name="room" value="XXXXX">    
   <a href="Java" _mce_href="http://www.addonchat.com/">Java">http://www.addonchat.com/">Java Chat Software</a>
<param name="username" value="<?php echo $naam?>" />
<param name="autologin" value="yes">
</applet>
<?php 
// standard page footer 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
  1. Save the file as chat.txt
  2.  Change the extension of the file to chat.php
  3.  Upload the file to your server ensuring that it is placed in the same directory where the phpBB index.php file is located
  4.  Grab a copy of index_body.tpl in the templates/subSilver folder from your server and open it with Wordpad or similar
  5. Find the following set of lines:

 

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
       <td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>

After these lines add the following code ensuring that XXXXX is your room number, the green URL matches that in your Admin Control Panel and if the blue value is set to 1 for the rooms the users are in to be shown:

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
<tr>
<td HEIGHT="10" BGCOLOR="#FFF5C2" align=center><b><font color="#3333FF" font size="1"><i><a href="chat.php" target="_blank">The Following Users Are In The Chat Room.</a></i></font></b></td>
</tr>
<tr>
<td><iframe
name="scwho"
src="http://clientX.addonchat.com/scwho.pl?id=XXXXX&subroom=0&boldadmin=0&comma=1&countonly=0&chatbg=FFF5C2&chatusr=3333FF&subroomcolor=000000&chatadmusr=3333FF&nousermsg=There are currently no users in the Chat Room"
width=100%
height=50
frameborder=0
scrolling="auto"></iframe></td>
</tr>
</table></center>
</td></tr>

Save the file and upload it to your server ensuring it is placed in the templates/subSilver directory

** Important:  Room Security **

These final steps ensure that your chat room is secure. It disallows the room to be accessed from other websites.

  1. Save the file and upload it to your server ensuring it is placed in the templates/subSilver directory
  2. Login to your AddonChat Admin Control Panel and select -> settings -> Site integration -> Securtiy URL, then set the 'enable security url' option to yes. and the 'secure by url domain only' option to yes. Then enter the full url of the domain on which the AddonChat will be running from and finally click save
  3. Finally ensure that your username and password to the AddonChat Admin Control Panel is different to your phpBB administrator username and password. This adds additional security to both your phpBB and AddonChat installations and is good practice in any case.
(0 vote(s))
This article was helpful
This article was not helpful

Comments (0)