users disconnected unexpectedly, idont know why..
this is the complete phpbb3 code:
<?php
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
page_header('Chat Room');
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
//$params["theme_path"] = dirname(__FILE__)."/themes";
$params["theme_path"] = $phpbb_root_path ."chat/themes";
$params["theme"] = "phpbb2";
$params = array();
$params["title"] = "Welcome to Rakista Chat";
$params["serverid"] = md5("rakista"); // calculate a unique id for this chat
$params["channels"] = array("Love", "RAKISTA");
$params["start_minimized"] = false;
$params['skip_proxies'] = array('noflood');
$params["frozen_nick"] = true; //dont allow change nick
$params["shownotice"] = 2;
$params["isadmin"] = $auth->acl_get('a_') ? true : false; //set admins
$params["nick"] = $user->data['is_registered'] ? $user->data['username'] : "guest".rand(1,1000);
$params["nickmeta_private"] = array('ip'); // additional values
if ($user->data['is_registered'])
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$sql = "SELECT u.user_id, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.username, u.user_rank, u.user_colour
FROM " . USERS_TABLE . ' AS u
WHERE u.user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql,300);
$row = $db->sql_fetchrow($result);
$avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height'], '',true);
$avatar_img = (empty($avatar_img))? $phpbb_root_path ."images/clan.gif" : $avatar_img;
$username_trim = (strlen($row['username']) > 9) ? substr($row['username'],0,9) . ".." : $row['username'];
$u_profile = get_username_string('full', $row['user_id'], $username_trim, $row['user_colour']);
$params["nickmeta"] = array(
'avatar'=> '<img src="' . $avatar_img .'">',
'profile'=> $u_profile,
); // additional values
$db->sql_freeresult($result);
}
$chat = new phpFreeChat( $params );
$x = $chat->printChat(true);
$template->assign_vars(array(
'CHAT' => $x,
));
$template->set_filenames(array(
'body' => 'chat_view.html')
);
page_footer();
?>
----------
you can see it in action by going to this link: http://www.rakista.com/chat/
-- the site is using dedicated server.
one more question, how to refresh the chat cache? when i /rehash are all the cache folders deleted?
Thanks in advance!