I have set up pfc and want to auto connect my joomla with their joomla username.
I use pfc 1.6 and Joomla 1.5.23
I have tried to use the same code found in this topic (viewtopic.php?f=8&t=5396) but...
- The user check is working fine, I get the username.
- pfc keeps asking me for a nickname with an invite
- I can't get a username to be admin
What do you think can cause this ?
Here is my code:
- Code: Select all
<?php
require_once "../phpfreechat-1.6/src/phpfreechat.class.php";
$params = array();
$params["title"] = "mysite.com";
$params["channels"] = array("my room");
$params = array();
$params["title"] = "my title ";
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );
//$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname
// --- start of the user check
define( "_JEXEC", 1 );
define( "DS", "/" );
define("JPATH_BASE", "..");
require_once ( JPATH_BASE.DS."includes".DS."defines.php" );
require_once ( JPATH_BASE.DS."includes".DS."framework.php" );
$uc_maifra =& JFactory::getApplication("site");
$uc_maifra->initialise();
$uc_user = JFactory::getUser();
ECHO "username:".$uc_usenam = $uc_user->get("username");
echo "param:".$params["nick"] = $uc_usenam;
// --- end of the user check
$params['firstisadmin'] = true;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$params["shownotice"] = 4;
$params["max_msg"] = 1000;
$params["max_displayed_lines"] = 1000;
$params['admins'] = array('admin'=>'nimda');
$params["refresh_delay"] = 2000; // 2000ms = 2s
$params["refresh_delay_steps"] = array(3000,20000,4000,60000,5000,120000);
$params["theme"] = "phoenity";
$params["language"] = "fr_FR";
$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>TChat</title>
<link rel="stylesheet" title="classic" type="text/css" href="style/content.css" />
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<img src="../images/logo.png">
<div style="float:left; width:70%">
<div class="content">
<?php $chat->printChat(); ?>
<?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>
<p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
<?php } ?>
</div>