I try to interface with phpbb3 forum phpFreeChat, I integrated the header and footer of my forum but I can not get admin rights for Administrators and Moderators, this is my code, thank you for your answers
- Code: Select all
<?php
/**
* @ignore
*/
define('IN_PHPBB', true);
//$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('memberlist', 'groups'));
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN']);
}
//
// Whatever Parameters you need to set, goes here
//
$username = $user->data['username'];
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "ASR17.NET";
$params["nick"] = ereg_replace("[[:space:]]", "_", $username);
$params["nick"] = iconv("iso-8859-1", "UTF-8", $params["nick"]);
if ($user->data['user_id'] == ADMIN || $user->data['user_id'] == MOD) $params['isadmin'] = true;
//$params['admins'] = array('admin' => 'admin');
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params['max_displayed_lines'] = 50;
$params["theme"] = "default";
$params['timeout'] = 1000000;
$params['language'] = 'fr_FR';
//$params["debug"] = true;
$chat = new phpFreeChat( $params );
// Create the Chat HTML
$chat_html = $chat->printChat(true);
// Store the HTML in the template variables
$template->assign_vars(array('CHAT_HTML' => $chat_html));
// Lets build a page ...
page_header('Chat');
$template->set_filenames(array(
'body' => 'phpChat.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>