Store
Community Documentation

v3 Knowledgebase

How to get Prochatrooms working with the footerbar IM enabled

Hi All.If you use Prochatrooms, you will know there has been a user session problem when the footerbar IM is enabled. Since the RC builds of phpfox, Prochatrooms has been trying to get phpfox to fix this. It is an issue that could cause problems for other integrations, how ever i am pleased to announce that Jeff and I have finally got a working solution and here is how to get prochatrooms working with phpfox when the IM chat is on:## Solution for phpFOX version 2.0.4 (with footerbar chat enabled) and Pro Chat Rooms version 5.0.0EDIT: Works with Pro Chat Rooms version 6.x.x too.
1) Create a new folder called 'sessions', upload to 'prochatrooms/sessions' and CHMOD to 7772) Open the file 'cms.php', and remove all the code from within the file (so the file is blank, no content)3) Copy and paste the following code into the 'cms.php' file and save the file.
PHP:
<?php#############################################
# Author: Pro Chatrooms
# Software: Pro Chatrooms
# Url: http://www.prochatrooms.com
# Support: support@prochatrooms.com
# Copyright 2007-2009 All Rights Reserved
session_start();
include(
"globals.php");
############################################# // phpfox v2 integration (Pro Chat Rooms version 5.0.0)// define phpfoxDB details
define('C_HOST','localhost');// MySQL host name (usually:localhost)
define('C_USER','phpfoxDB_username');// MySQL username
define('C_PASS','phpfoxDB_password');// MySQL password
define('C_BASE','phpfoxDB_database');// MySQL database
define('C_PATH','/document/path/to/prochatrooms');// Document Path// define phpfox MySQL table prefix
define("PHPFOX_PREFIX","phpfox2_");    // include the prochatrooms/inc.db.php file
    
include("inc.db.php");    // get the phpfox users name and id
    
$getData=mysql_query("SELECT user_id FROM ".PHPFOX_PREFIX."log_session WHERE session_hash = '".$_SESSION['phpfox1']['session']."' LIMIT 1"); 
    while(
$gotData mysql_fetch_array($getData)) 
    {
        
$tmp=mysql_query("SELECT user_name, user_id FROM ".PHPFOX_PREFIX."user WHERE user_id = '".$gotData['user_id']."' LIMIT 1"); 
        while(
$i mysql_fetch_array($tmp)) 
        {
            
$gotUserName $i['user_name'];
            
$gotUserID $i['user_id'];
        }    }
// destroy this session
session_destroy();// create a new session path for storing sessions - why do we need to do this?
// phpFOX version 2 destroys all sessions in the PHP default sessions folder
// by creating a different sessions folder for prochatrooms, phpFOX v2 wont be able to delete these <img src="http://50.57.108.11/file/pic/emoticon/default/wink.png" alt="Wink" title="Wink" class="v_middle" />
session_save_path("/document/path/to/prochatrooms/sessions");// start session
session_start();// create session details
$_SESSION['pro_chatrooms'] = $gotUserName;
$_SESSION['uid'] = $gotUserID;// redirect to prochatrooms/index.php
header("Location: index.php");// return (end)
return;?>
4) Open the file 'prochatrooms/db.php' and before this line,
PHP:
session_start(); 
Copy and paste this code,
PHP:
session_save_path("/document/path/to/prochatrooms/sessions"); 
5) Open the file 'prochatrooms/index.php' and below this line,
PHP:
include("avatars/avatars.php"); 
Copy and paste this code,
PHP:
if(!$_SESSION['pro_chatrooms'])
{
    
header("Location: cms.php");
}
else
{
    
$uname $_SESSION['pro_chatrooms'];
    
$uid $_SESSION['uid'];
6) Scroll down the file until you come to line 155 which looks like,
PHP:
include("cms.php"); 
And replace with,
PHP:
// include("cms.php"); END__PHPFOX__CODE__SNIPPET ?>
7)Create a product:
Go to extensions/produck/createproduct
1. Enter Product id Prochatrooms
2. Title is Prochatrooms
3. Description is Prochatrooms
4. Version 1.0 (this is the version of the integration not script)
5. Product url and url check is http://www.prochatrooms.com
6. Active yes
Submit8)Create a module:
Go to your phpfox admincp and do the following:
1. go to extensions/module/create module
2. Select Prochatroom as product
3. enter Prochatrooms as Module is
4. Select no to add menu
5. enter prochatrooms integration to info9) Now go to admincp, then cms, then add menu. Select phpfox as product.
Select prochatrooms as module.
Select main as connection, add prochatrooms/ for url and add Chat to Language Package Details and click submit.