PhpFreeChat

From FUDforum Wiki
Jump to: navigation, search

This article describes how phpFreeChat can be integrated into a FUDforum site. The code below will automatically set the phpFreeChat nickname to your FUDforum userid.

phpFreeChat changes

You have to put this piece of code at beginning of your phpFreeChat chat script (index.php):

require_once("../forum/GLOBALS.php");
fud_use('db.inc');
fud_use('cookies.inc');
$fuduser = ses_get();
if ($fuduser->alias == $ANON_NICK)
      $fuduser->alias = 'guest'.rand(1,1000); // generate random nick for guest

Then you can replace the classic phpFreeChat parameter list (same file, top) using $fuduser->alias as the phpfreechat nickname. For example:

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"]             = md5(__FILE__);
$params["title"]                = "FUDforum chat";
$params["channels"]             = array("FUDforum support", "General chitchat");
$params["language"]             = "en_US";
$params["nick"]                 = $fuduser->alias;
$params["start_minimized"]      = true;
$chat = new phpFreeChat( $params );

FUDforum changes

Add the phpFreeChat code to your FUDforum template (either header.tmpl or footer.tmpl) and rebuild your theme when done.

External links

Languages
Personal tools
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Can't contact the database server: Cannot return last error, no db connection)


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.