![Confused :?](./images/smilies/icon_confused.gif)
My problem is this: I create three channels for all users. It works, but all end up in the third channel (last one in the array) and so they have to manually select the first channel by clicking on it.
How do I set the first channel to default?
Here's my index.php:
- Code: Select all
<?php
// die('Sorry, but the THT chatroom is closed for maintenance.');
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN']);
}
date_default_timezone_set('UTC');
$utz = $user->data['user_timezone']; // Get user's time zone information from phpBB3 account settings
// Output page
page_header('Chatroom');
$template->set_filenames(array(
'body' => 'chatroom_body.html',)
);
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["theme"] = "tht";
$params["title"] = " ";
$params["theme_path"] = "../chat/themes";
$params["nick"] = $user->data['username'];
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["frozen_nick"] = true;
$params["clock"] = false;
$params["startwithsound"] = false;
$params["btn_sh_whosonline"] = true;
$params["channels"] = array('Chat', 'Logo chat', 'War room');
// $params["userchan"] = array('Chat'); // This doesn't work ...
$params["time_offset"] = $utz*60*60; // Sets user's time_offset to their timezone
$params["displaytabclosebutton"] = false;
$params["display_ping"] = false;
$params["timeout"] = 60000;
$params["max_channels"] = 3; // limit the number of joined channels tab to 3
$params["max_privmsg"] = 1; // limit the number of private message tab to 1
$params["refresh_delay"] = 1000; // chat refresh speed is 10 secondes (10000ms)
$params["max_msg"] = 15; // max message in the history is 15 (message seen when reloading the chat)
$params["connect_at_startup"] = true;
$params["start_minimized"] = false;
$params["nickmarker"] = false;
$params["debug"] = false;
$params["isadmin"] = false;
$params["firstisadmin"] = false;
$params["bbcode_colorlist"] = array('#FFFFFF','#8DEEEE','#1E90FF','#00FFFF','#FA8072','#DAA520','#FF3030','#FF5500',
'#FFFF00','#00FF00','#98FB98','#F0E68C','#FF69B4','#BA55D3','#FFB5C5','#A3A9AD');
$params["nickname_colorlist"] = array('#FFFFFF','#8DEEEE','#1E90FF','#00FFFF','#FA8072','#DAA520','#FF3030','#FF5500',
'#FFFF00','#00FF00','#98FB98','#F0E68C','#FF69B4','#BA55D3','#FFB5C5','#A3A9AD');
// Guests / Anonumous, Bots, Newly registered users, and Ambassadors don't have access to chat
if ($user->data['group_id'] == 1 OR $user->data['group_id'] == 6 OR $user->data['group_id'] == 7 OR $user->data['group_id'] == 10)
{
die('Access denied');
}
// if ($user->data['group_id'] == 4 OR $user->data['group_id'] == 5) // Admins and Moderators
if ($user->data['group_id'] == 9) // Founder
{
$params["isadmin"] = true;
}
$chat = new phpFreeChat($params);
// Send data to template
$template->assign_vars(array(
'S_CHATROOM' => $chat->printChat(true) . $warning)
);
page_footer();
?>