I am using version 1.3 and this also occurs in version 1.2 ...
I have the chat with wordpress latest version 2.92, Works fine given the user its Id from the wp database, the Issue is that I have also put in the code an if statement that if the user in not logged in the chat will give a random guest# name, this in order to avoid any use to take admin control of the chat... but when I also enable $params["frozen_nick"] the chat start to loop the random name its gives to the users if I disable the frozen_nick it starts working fine again..... just want to report that..
here is the code
- Code: Select all
<?php
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
require_once('/docs/root/blog/wp-config.php');
$current_user = wp_get_current_user();
$user_name = addslashes($current_user->display_name);
$params = array();
$params["title"] = "my chat";
// code start here , costumer logged in will get name ,no name will get guest name
$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname
if (!empty($user_name)) {
$params["nick"] = $user_name;
}//end of code
//$params["frozen_nick"] = true;//disabled because chat start a loop with the random nick..
$params["max_channels"] = 3;
// code to get wordpress moderator powers to specific users
$params["isadmin"] = false;
if ( current_user_can('publish_posts') ) $params['isadmin'] = true;//end code
$params['admins'] = array('admin' => 'admin','moderatos' => 'same');
//$params["data_private_path"] = "/dev/shm/catrachas";
$params["quit_on_closedwindow"] = true;// I was told that this dont work with firefox and IE8
$params["channels"] = array("Generall");
$params["language"] = "es_ES";
$params["height"] = "250px";
//$params["timeout"] = 10000;//disabled IE start getting time out
$params["max_nick_len"] = 10;
$params["max_msg"] = 12;
$params["max_displayed_lines"] = 50;
$params["short_url"] = true;
$params["short_url_width"] = 25;
$params["theme"] = "msn";
$params["serverid"] = md5(chatting); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );
?>