Integrate PHP-Fusion with ajax_chat

PHP-Fusion is Content Management System,

deprecation , this code doesn’t work no more..
please check out this post instead

PHPFusion Integration with Ajax Chat


note: Since my folder path are not the same as others in the web, please find the real path for your installation otherwise you would think that the integration doesn't work which it does it.

This integration is for PHP-Fusion v7.01.04 and AJAX CHAT version 0.8.3 .
note: latest PHP-Fusion v7.02.01 also works with this integration.

A little of info from the official Website.

a light-weight open-source content management system (CMS). PHP-Fusion is written in PHP and MySQL and includes a simple, comprehensive administration system as well as Forum, Photogallery, Articles, FAQ and much more.

Unfortunately his founder and lead coder MR Nick Jones passed away and the users and community is mourning this lost, Descanse en Paz..

This integration has the following features,

  • Set user admin
  • Set user moderator
  • Set the regular chatters username
  • Check if guest login usernick is registered in the Fusion database.

Now SuperAdmin becomes Admin in ajax chat, userAdmin becomes Moderator in the ajax chat and regular user becomes regular users.
in order to have a moderator you need to set a regular user as admin, you can do that in the control panel of PHP-FUSION CMS , its up to you if you want this user have all the admin privileges, in my testing I lef the boxes to give all privileges blank so it could only have the admin flag but not all privileges..

So please be careful when setting this up.. this is in a default installation, and with the most uptodate PHP-FUSION CMS..

Please install ajax chat as described in the readme.txt .

PHP-FUSION is installed in its own folder and Ajax Chat is also in its own folder, so PHP-FUSION -> /Webroot/php-fusion/ and
Ajax Chat -> /Webroot/php-fusion/chat/.

Please make sure you know how you set up the chat and PHP-FUSION,
now let go to start editing:

open up “/chat/lib/custom.php” :
NOTE: I have made a few changes so people don’t have PHP error when they don’t set correctly the maincore.php path.
Again the maincore.php its the important piece in the integration if you set it incorrectly the integration will not work at all, and a bunch of PHP error will come up.
[php]
<?php
$maincore_path="/maincore.php"; // change your path here
if(file_exists($_SERVER{‘DOCUMENT_ROOT’} . $maincore_path )){
require_once(($_SERVER{‘DOCUMENT_ROOT’} . "/config.php"));
define(‘DB_HOST’, $db_host);define(‘DB_USER’, $db_user);define(‘DB_PASS’, $db_pass);define(‘DB_NAME’, $db_name);
require_once(($_SERVER{‘DOCUMENT_ROOT’} . $maincore_path));
}else{
exit("<span style=\"color:red;\">The maincore.php was not found.<br> Please make sure the path is correct in your installation.</span>");
}
// lets create our vars for login, username, userID
if(defined(‘iUSER’))
{
$fusionUserName=$userdata[‘user_name’];
$fusionUserId=$userdata[‘user_id’];
}
?>
[/php]

Now we got set up some variables that we will need, basically we put the username and user ID from PHP-FUSION in variables for easy accessing.

Next we need to open “/chat/lib/class/CustomAJAXCHAT.php”.
highlight line 11 to line 72 and paste the code below.
make sure you do correctly or else you will get a nasty error..

[php] // auto login PHP-fusion CMS
function initCustomRequestVars(){
if(!$this->getRequestVar(‘logout’) && (iUSER)) {
$this->setRequestVar(‘login’, true);
}
}
// Returns an associative array containing userName, userID and userRole
// Returns null if login is invalid
function getValidLoginUserData() {
// globalize the important variables from fusion cms
global $fusionUserName,$fusionUserId;
// Check if we have a valid registered user:
$customUsers = $this->getCustomUsers();
if(iUSER){
$userData = array();
$userData[‘userID’] =$fusionUserId;
$userData[‘userName’] =$fusionUserName;
$user_name=$this->trimUserName($userData[‘userName’]);
if(iSUPERADMIN){
$userData[‘userRole’] = AJAX_CHAT_ADMIN;
}elseif(iADMIN){
$userData[‘userRole’] = AJAX_CHAT_MODERATOR;
}elseif(iMEMBER){
$userData[‘userRole’] = AJAX_CHAT_USER;
}
return $userData;
}// Check if we have a valid registered user using the ajax chat form:
elseif($this->getRequestVar(‘password’)) {
$userName = $this->getRequestVar(‘userName’);
$userName = $this->convertEncoding($userName, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

$password = $this->getRequestVar(‘password’);
$password = $this->convertEncoding($password, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

foreach($customUsers as $key=>$value) {
if(($value[‘userName’] == $userName) && ($value[‘password’] == $password)) {
$userData = array();
$userData[‘userID’] = $key;
$userData[‘userName’] = $this->trimUserName($value[‘userName’]);

$userData[‘userRole’] = $value[‘userRole’];
return $userData;
}
}

return null;
}else{
// Guest users:
return $this->getGuestUser();
}

}

// Store the channels the current user has access to
// Make sure channel names don’t contain any whitespace
function &getChannels() {
if($this->_channels === null) {
$this->_channels = array();

$customUsers = $this->getCustomUsers();

// Get the channels, the user has access to:
if($this->getUserRole() == AJAX_CHAT_GUEST) {
$validChannels = $customUsers[0][‘channels’];
} else {
//$validChannels = $customUsers[$this->getUserID()][‘channels’];
$validChannels = $customUsers[0][‘channels’];
}

// Add the valid channels to the channel list (the defaultChannelID is always valid):
foreach($this->getAllChannels() as $key=>$value) {
// Check if we have to limit the available channels:
if($this->getConfig(‘limitChannelList’) && !in_array($value, $this->getConfig(‘limitChannelList’))) {
continue;
}

if(in_array($value, $validChannels) || $value == $this->getConfig(‘defaultChannelID’)) {
$this->_channels[$key] = $value;
}
}
}
return $this->_channels;
}[/php]

All good so far, now lets edit another PHP class document, important so we can check if user guest nick is a registered username, if used we get an error and the user wont be able to login in the chat..
Unless of course he changes for a different nickname.

Now Open “/chat/lib/class/AJAXChat.php”

Highlight from line 3179 to line 3207 paste the following code below:

[php]
function getGuestUser() {
if(!$this->getConfig(‘allowGuestLogins’))
return null;

if($this->getConfig(‘allowGuestUserName’)) {
$maxLength = $this->getConfig(‘userNameMaxLength’)
– $this->stringLength($this->getConfig(‘guestUserPrefix’))
– $this->stringLength($this->getConfig(‘guestUserSuffix’));

// Trim guest userName:
$userName=$this->getRequestVar(‘userName’);
if($this->IfUserExist($userName)){
return null;
}
$userName = $this->trimString($this->getRequestVar(‘userName’), null, $maxLength, true, true);

// If given userName is invalid, create one:
if(!$userName) {
$userName = $this->createGuestUserName();
} else {
// Add the guest users prefix and suffix to the given userName:
$userName = $this->getConfig(‘guestUserPrefix’).$userName.$this->getConfig(‘guestUserSuffix’);
}
} else {
$userName = $this->createGuestUserName();
}

$userData = array();
$userData[‘userID’] = $this->createGuestUserID();
$userData[‘userName’] = $userName;
$userData[‘userRole’] = AJAX_CHAT_GUEST;
return $userData;
}
/* lets create a custom function that will check if username exist in database.. PHP 4.0.3 , PHP 5*/

function IfUserExist($username){
$link = mysql_connect(DB_HOST,DB_USER, DB_PASS);
if($link)
{
$username=mysql_real_escape_string(stripslashes($username));
mysql_select_db(DB_NAME, $link);
$db_table=DB_PREFIX."users";
$query = "SELECT user_name FROM $db_table WHERE user_name=’$username’";
$result= mysql_query($query);
if(mysql_num_rows($result) > 0)
{
return true;
mysql_close($link);
}else{
return false;
}
}else{
die(‘There is an error in the custom function IfUserExist()’ . mysql_error());
}
}
[/php]

There is a new function called IfUserExist(); that will check if usernick that the guest user is trying to use is or not registered in the PHP-FUSION.. very important so we don’t have people impersonating other registered user in the chat..

So there it is, your chat its fully connected to PHP-FUSION CMS..
hope you like, please comment and forgive my English since is not my primary speaking language…

Please, comment the integration so I know is working for all thanks again for reading..

42 thoughts on “Integrate PHP-Fusion with ajax_chat

  1. Hi and tnx for the mod. But it don’t work. As I’ve told on SF, it give me a blank page when I try to open the chat.
    Also, I’ve to change require_once “../maincore.php”; with require_once “http://www.xxx.xx/maincore.php”; or it give me a bad XML interpretation

  2. It works, what happens is that you need to fix the require for the maincore.php, as I stated above in the post you need to check how its your path done and connect it..

    Like I have like this /webroot/PHP-FUSION

    then I have the chat like this /webroot/PHP-FUSION/chat
    then my require looks like this require_once “../maincore.php”;

    I should fix the above example because it don’t reflect my paths..

  3. The Master, you need to make sure you got everything done, this is for the latest PHP-FUSION, and there is also a new function that must be also copied or you will receive the kind of errors you have..

    thanks

  4. Parse error: syntax error, unexpected T_REQUIRE_ONCE in /member/p2pinside/chat/lib/custom.php on line 11

    is here:

    require_once “../maincore.php”;

    what’s the solution?

  5. you need to find the path of your “maincore.php” in your installation because in this tutorial I have used my installation and its different than yours..
    regards.

  6. Is this a similar way to integrate it with PHP-Nuke? I can’t seem to find an available tutorial for that CMS.

  7. Hum, If I get people to support the idea to make it happens I would install PHP-NUKE on my test bed…

    And make the integrations…
    thanks and regards.

  8. it seems that I am not able to get to maincore.php – pls help!

    I have files as following:
    http://www.simplenunique.com/maincore.php

    http://simplenunique.com/chat/install.php,

    the path for maincore, i tried /maincore.php; and then to avoid any mistakes put the whole path as http://www.simplenunique.com/maincore.php

    I still get message The maincore.php was not found.
    Please make sure the path is correct in your installation.

    The path I am changing is in custom.php.

    Any idea what’s happenign 🙁 I am not so good at this it seems

  9. Hi,

    can you please output this code for debugging at the top of the page after $maincore_path?

    [php]echo $_SERVER{‘DOCUMENT_ROOT’} . $maincore_path;
    exit();[/php]

    This way I can see your server vars and the whole require path..

    thanks a lot.

  10. I have installed ajax and followed all instructions in order to integrate it with phpfusion , but i got this message:

    Fatal error: Cannot redeclare CustomAJAXChat::getValidLoginUserData() in /web/htdocs/www.ftfansub.net/home/chat/lib/class/CustomAJAXChat.php on line 82

    Could u help me to fix it?

    Thank you very much!

  11. Hi,

    the error is clear, you have re-declared a function with the same name as one that already exist..

    What phpfusion version do you have?

    Can you post the whole code of CustomAJAXCHAT.php using the [ php ] tags?

    thanks..

  12. Hello again! ^.^
    I’m using phpfusion v7.01.05 and Ajax chat 0.8.5

    this is the code of CustomAJAXCHAT.php

    [php]
    <?php
    /*
    * @package AJAX_Chat
    * @author Sebastian Tschan
    * @copyright (c) Sebastian Tschan
    * @license GNU Affero General Public License
    * @link https://blueimp.net/ajax/
    */

    class CustomAJAXChat extends AJAXChat {

    // Returns an associative array containing userName, userID and userRole
    // Returns null if login is invalid
    function getValidLoginUserData() {

    $customUsers = $this->getCustomUsers();

    if($this->getRequestVar(‘password’)) {
    // Check if we have a valid registered user:

    $userName = $this->getRequestVar(‘userName’);
    $userName = $this->convertEncoding($userName, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

    $password = $this->getRequestVar(‘password’);
    $password = $this->convertEncoding($password, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

    foreach($customUsers as $key=>$value) {
    if(($value[‘userName’] == $userName) && ($value[‘password’] == $password)) {
    $userData = array();
    $userData[‘userID’] = $key;
    $userData[‘userName’] = $this->trimUserName($value[‘userName’]);
    $userData[‘userRole’] = $value[‘userRole’];
    return $userData;
    }
    }

    return null;
    } else {
    // Guest users:
    return $this->getGuestUser();
    }
    }

    // Store the channels the current user has access to
    // Make sure channel names don’t contain any whitespace
    function &getChannels() {
    if($this->_channels === null) {
    $this->_channels = array();

    $customUsers = $this->getCustomUsers();

    // Get the channels, the user has access to:
    if($this->getUserRole() == AJAX_CHAT_GUEST) {
    $validChannels = $customUsers[0][‘channels’];
    } else {
    $validChannels = $customUsers[$this->getUserID()][‘channels’];
    }

    // Add the valid channels to the channel list (the defaultChannelID is always valid):
    foreach($this->getAllChannels() as $key=>$value) {
    // Check if we have to limit the available channels:
    if($this->getConfig(‘limitChannelList’) && !in_array($value, $this->getConfig(‘limitChannelList’))) {
    continue;
    }

    if(in_array($value, $validChannels) || $value == $this->getConfig(‘defaultChannelID’)) {
    $this->_channels[$key] = $value;
    }
    }
    }
    return $this->_channels;
    }

    // auto login PHP-fusion CMS
    function initCustomRequestVars(){
    if(!$this->getRequestVar(‘logout’) && (iUSER)) {
    $this->setRequestVar(‘login’, true);
    }
    }
    // Returns an associative array containing userName, userID and userRole
    // Returns null if login is invalid
    function getValidLoginUserData() {
    // globalize the important variables from fusion cms
    global $fusionUserName,$fusionUserId;
    // Check if we have a valid registered user:
    $customUsers = $this->getCustomUsers();
    if(iUSER){
    $userData = array();
    $userData[‘userID’] =$fusionUserId;
    $userData[‘userName’] =$fusionUserName;
    $user_name=$this->trimUserName($userData[‘userName’]);
    if(iSUPERADMIN){
    $userData[‘userRole’] = AJAX_CHAT_ADMIN;
    }elseif(iADMIN){
    $userData[‘userRole’] = AJAX_CHAT_MODERATOR;
    }elseif(iMEMBER){
    $userData[‘userRole’] = AJAX_CHAT_USER;
    }
    return $userData;
    }// Check if we have a valid registered user using the ajax chat form:
    elseif($this->getRequestVar(‘password’)) {
    $userName = $this->getRequestVar(‘userName’);
    $userName = $this->convertEncoding($userName, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

    $password = $this->getRequestVar(‘password’);
    $password = $this->convertEncoding($password, $this->getConfig(‘contentEncoding’), $this->getConfig(‘sourceEncoding’));

    foreach($customUsers as $key=>$value) {
    if(($value[‘userName’] == $userName) && ($value[‘password’] == $password)) {
    $userData = array();
    $userData[‘userID’] = $key;
    $userData[‘userName’] = $this->trimUserName($value[‘userName’]);

    $userData[‘userRole’] = $value[‘userRole’];
    return $userData;
    }
    }

    return null;
    }else{
    // Guest users:
    return $this->getGuestUser();
    }

    }

    // Store the channels the current user has access to
    // Make sure channel names don’t contain any whitespace
    function &getChannels() {
    if($this->_channels === null) {
    $this->_channels = array();

    $customUsers = $this->getCustomUsers();

    // Get the channels, the user has access to:
    if($this->getUserRole() == AJAX_CHAT_GUEST) {
    $validChannels = $customUsers[0][‘channels’];
    } else {
    //$validChannels = $customUsers[$this->getUserID()][‘channels’];
    $validChannels = $customUsers[0][‘channels’];
    }

    // Add the valid channels to the channel list (the defaultChannelID is always valid):
    foreach($this->getAllChannels() as $key=>$value) {
    // Check if we have to limit the available channels:
    if($this->getConfig(‘limitChannelList’) && !in_array($value, $this->getConfig(‘limitChannelList’))) {
    continue;
    }

    if(in_array($value, $validChannels) || $value == $this->getConfig(‘defaultChannelID’)) {
    $this->_channels[$key] = $value;
    }
    }
    }
    return $this->_channels;
    }

    // Store all existing channels
    // Make sure channel names don’t contain any whitespace
    function &getAllChannels() {
    if($this->_allChannels === null) {
    // Get all existing channels:
    $customChannels = $this->getCustomChannels();

    $defaultChannelFound = false;

    foreach($customChannels as $key=>$value) {
    $forumName = $this->trimChannelName($value);

    $this->_allChannels[$forumName] = $key;

    if($key == $this->getConfig(‘defaultChannelID’)) {
    $defaultChannelFound = true;
    }
    }

    if(!$defaultChannelFound) {
    // Add the default channel as first array element to the channel list:
    $this->_allChannels = array_merge(
    array(
    $this->trimChannelName($this->getConfig(‘defaultChannelName’))=>$this->getConfig(‘defaultChannelID’)
    ),
    $this->_allChannels
    );
    }
    }
    return $this->_allChannels;
    }

    function &getCustomUsers() {
    // List containing the registered chat users:
    $users = null;
    require(AJAX_CHAT_PATH.’lib/data/users.php’);
    return $users;
    }

    function &getCustomChannels() {
    // List containing the custom channels:
    $channels = null;
    require(AJAX_CHAT_PATH.’lib/data/channels.php’);
    return $channels;
    }

    }
    ?>
    [/php]

    Thank you again!

  13. There, you are pasting the tutorial in a different place.. that function is at the beginning of the document..
    I suggest you to start from scratch the tutorial…
    If you get stuck let me know again..

    I am kind of busy.

    regards

  14. Hello, Good work on the tut. But I run into a problem, I get nothing but a white screen….. Is their any one to get this fix?

  15. Hi,

    Whats your phpfusion version?

    Is there any error in your server logs?

    please as much information you can provide..

    thanks.

  16. Hi i used

    echo $_SERVER{‘DOCUMENT_ROOT’} . $maincore_path;
    exit();

    but still giving following error

    The maincore.php was not found.
    Please make sure the path is correct in your installation.

    my version 7.02.04

  17. Hi mike,

    You shouldnt have that error if you put this code after
    $maincore_path

    [php]echo $_SERVER{‘DOCUMENT_ROOT’} . $maincore_path;
    exit();[/php]

    The exit function should have stopped execution.

    Please try once more and write the output of that echo.

    regards

  18. Hello! Can’t understand where is the problem:

    Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in [path]/chat/lib/class/AJAXChat.php on line 3234

    [code] function IfUserExist($username){
    $link = mysql_connect(DB_HOST,DB_USER, DB_PASS);
    if($link)
    {
    $username=mysql_real_escape_string(stripslashes($username));
    mysql_select_db(DB_NAME, $link);
    $db_table=DB_PREFIX."users";
    $query = "SELECT user_name FROM $db_table WHERE user_name=’$username’";
    $result= mysql_query($query);
    if(mysql_num_rows($result) > 0)
    {
    return true;
    mysql_close($link);
    }else{
    return false;
    }
    }else{
    die(‘There is an error in the custom function IfUserExist()’ . mysql_error());
    }
    }
    $userData = array();
    $userData[‘userID’] = $this->createGuestUserID();
    $userData[‘userName’] = $userName;
    $userData[‘userRole’] = AJAX_CHAT_GUEST;
    return $userData;
    }

    function getCustomVar($key) {
    if(!isset($this->_customVars))
    $this->_customVars = array();
    if(!isset($this->_customVars[$key]))
    return null;
    return $this->_customVars[$key];
    }
    [/code]

    Error points to this line: $userData = array();

  19. You have paste it wrong, I I suggest you to try again just
    delete getGestUser function and copy paste the code again..

    [php]function getGuestUser() {
    if(!$this->getConfig(‘allowGuestLogins’))
    return null;

    if($this->getConfig(‘allowGuestUserName’)) {
    $maxLength = $this->getConfig(‘userNameMaxLength’)
    – $this->stringLength($this->getConfig(‘guestUserPrefix’))
    – $this->stringLength($this->getConfig(‘guestUserSuffix’));

    // Trim guest userName:
    $userName=$this->getRequestVar(‘userName’);
    if($this->IfUserExist($userName)){
    return null;
    }
    $userName = $this->trimString($this->getRequestVar(‘userName’), null, $maxLength, true, true);

    // If given userName is invalid, create one:
    if(!$userName) {
    $userName = $this->createGuestUserName();
    } else {
    // Add the guest users prefix and suffix to the given userName:
    $userName = $this->getConfig(‘guestUserPrefix’).$userName.$this->getConfig(‘guestUserSuffix’);
    }
    } else {
    $userName = $this->createGuestUserName();
    }

    $userData = array();
    $userData[‘userID’] = $this->createGuestUserID();
    $userData[‘userName’] = $userName;
    $userData[‘userRole’] = AJAX_CHAT_GUEST;
    return $userData;
    }
    /* lets create a custom function that will check if username exist in database.. PHP 4.0.3 , PHP 5*/

    function IfUserExist($username){
    $link = mysql_connect(DB_HOST,DB_USER, DB_PASS);
    if($link)
    {
    $username=mysql_real_escape_string(stripslashes($username));
    mysql_select_db(DB_NAME, $link);
    $db_table=DB_PREFIX."users";
    $query = "SELECT user_name FROM $db_table WHERE user_name=’$username’";
    $result= mysql_query($query);
    if(mysql_num_rows($result) > 0)
    {
    return true;
    mysql_close($link);
    }else{
    return false;
    }
    }else{
    die(‘There is an error in the custom function IfUserExist()’ . mysql_error());
    }
    }[/php]

  20. I get this error

    [quote]Default – no theme found.

    We are really sorry but this page cannot be displayed. Due to some circumstances no site theme can be found. If you are a Site Administrator, please use your FTP client to upload any theme designed for PHP-Fusion v7 to the themes/ folder. After upload check in Main Settings to see if the selected theme was correctly uploaded to your themes/ directory. Please note that the uploaded theme folder has to have the exact same name (including character case, which is important on Unix based servers) as chosen in Main Settings page.[/quote]

  21. the error tells you everything,

    you need to upload a theme to your phpfusion site, Ajax-chat has its on internal themes and the integration script doesn’t require any theme..

    something you must have misconfiguration.

    appreciate your comment.

  22. I get it,

    But the integration doesn’t require any theme, it uses its own. so I cant really help if that got nothing to do with the integration…

  23. Hey there! I found this page after googling for a way to get Ajax Chat working on PHP Fusion. Thanks so much for this, your work is much appreciated and I’m sure my sites members would say the same!

    I’ve successfully got it working, but have a couple of questions:

    1) Is it possible to make a panel for PHP Fusion to show how many users are online in chat? I used to have this when I used flashchat but I’m not sure how to pull the information from Ajaxchat. I don’t know much in the way of coding so I’m a little stuck 🙂

    2) If you go directly to http://www.neogeoforlife.com/ajaxchat without having logged in at the site first, it shows a login page… entering your login details from the main site doesn’t work though. Is there a way to fix this?

    Thanks for any help you can give and once again thanks so much for your work! 🙂

    Kaz

  24. Hi,

    Appreciate you comments, as of now I don’t remember if this version would work with the new versions of php-fusion since when I coded this integration worked for auto login and would also work when supplying your user info at ajaxchat login page
    Nope, I’ve skimmed tru the tutorial again, and there isn’t call to mysql to get info of php-fusion system.. so it should only work with session login, which means you need to be logged in to access the chat..

    For getting the amount of users in a nice php-fusion implementation I’ve never thought about making something..

    I will check the code whenever I have some free spare time..
    regards.

  25. No problem, To be honest I think it will be ok, I’ll make it so that the chat link only shows for already logged in users. It would be good if there was a way to list “users online in chat” in a small panel on the main site though. Ideally it would list the names of the users in there but even if it just listed the amount of users online that would be ok 🙂

    Once again many thanks! 🙂

  26. Hey,

    Sorry to bug you, I don’t suppose you have had a chance to look into the code for online users yet have you? Sorry I know you’re probably very busy! 🙂

    Kaz

  27. hi,

    Maybe the version you are using is no longer compatible with this integration..

    But you can login in any page in your website and go to the chat a be logged in right?

    the only thing that doesn’t work is if you want to login using the form of flashchat, am i on the same page?
    Wrong tutorial, what’s the problem on hand?

    regards

  28. Thanks for the tutorial. I implemented the Ajax Chat in the PHP-Fusion v. 7.02.05 with login by facebook or by proper PHP-Fusion. If anyone wants to see how it looks, can access http://mmorais.com . The chat will only be available to members of the site.
    Once again, thanks.

  29. Hi,

    This integration is old, I don’t know if still works, what version are you using?,

    Also check the presence of maincore.php and try to require tru that path, and see if work..

    regards

  30. Hi,

    I’m using php fusion 7.00.xx
    AjaxChat 0.8.3

    I’m still not 100% understanding what a should be putting in for the path, could you give me an example?

  31. Hi,

    [php]<?php
    $maincore_path="/maincore.php"; // change your path here

    if(file_exists($_SERVER{‘DOCUMENT_ROOT’} . $maincore_path )){

    require_once(($_SERVER{‘DOCUMENT_ROOT’} . "/config.php"));
    define(‘DB_HOST’, $db_host);define(‘DB_USER’, $db_user);define(‘DB_PASS’, $db_pass);define(‘DB_NAME’, $db_name);
    require_once(($_SERVER{‘DOCUMENT_ROOT’} . $maincore_path));

    }else{
    exit("<span style=\"color:red;\">The maincore.php was not found.<br> Please make sure the path is correct in your installation.</span>");
    }
    // lets create our vars for login, username, userID
    if(defined(‘iUSER’))
    {
    $fusionUserName=$userdata[‘user_name’];

    $fusionUserId=$userdata[‘user_id’];
    }
    ?>[/php]
    You need to find your maincore document and require..

    the variable that hold this must be changed with the relative path to your file:
    $maincore_path = “/maincore.php”

    This tell the script to look for the file in your server root.. hope this helps.

  32. Pingback: du lich ben tre
  33. Pingback: thoi trang
  34. Pingback: Anonymous

Comments are closed.