I read what's on the documentation and did as it states. However, I'm having trouble setting the automatic administrator rights up. The usernames, however, work. Any help is appreciated.
Also, I have no chat.php. If anyone knows how I could make taht happen, that would be great.
Here's my index.php
- Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../forums/';
$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']);
}
if ($user->data['group_id'] == 4 OR $user->data['group_id'] == 5) // Admins and Moderators
{
$params["isadmin"] = true; // Do what you want cause a pirate is free, you are a pirate ;)
}
?>
<?php
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Quick chat";
$params["nick"] = $user->data['username']; // setup the intitial nickname
$params['firstisadmin'] = false;
$params['frozen_nick'] = 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;
$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>phpFreeChat- Sources Index</title>
<link rel="stylesheet" title="classic" type="text/css" href="style/generic.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/header.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/footer.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/menu.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/content.css" />
</head>
<body>
<div class="header">
<img alt="phpFreeChat" src="style/logo.gif" class="logo2" />
</div>
<div class="menu">
<ul>
<li class="sub title">General</li>
<li>
<ul class="sub">
<li class="item">
<a href="demo/">Demos</a>
</li>
<?php if (file_exists(dirname(__FILE__)."/checkmd5.php")) { ?>
<li>
<a href="checkmd5.php">Check md5</a>
</li>
<?php } ?>
<!--
<li class="item">
<a href="admin/">Administration</a>
</li>
-->
</ul>
</li>
<li class="sub title">Documentation</li>
<li>
<ul>
<li class="item">
<a href="http://www.phpfreechat.net/overview">Overview</a>
</li>
<li class="item">
<a href="http://www.phpfreechat.net/quickstart">Quickstart</a>
</li>
<li class="item">
<a href="http://www.phpfreechat.net/parameters">Parameters list</a>
</li>
<li class="item">
<a href="http://www.phpfreechat.net/faq">FAQ</a>
</li>
<li class="item">
<a href="http://www.phpfreechat.net/advanced-configuration">Advanced configuration</a>
</li>
<li class="item">
<a href="http://www.phpfreechat.net/customize">Customize</a>
</li>
</ul>
</li>
</ul>
<p class="partner">
<a href="http://www.phpfreechat.net"><img alt="phpfreechat.net" src="style/logo_88x31.gif" /></a><br/>
</p>
</div>
<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>
<div class="footer">
<span class="partners">phpFreeChat partners:</span>
<a href="http://www.jeu-gratuit.net">jeux gratuits</a> |
<a href="http://jeux-flash.jeu-gratuit.net">jeux flash</a> |
<a href="http://www.pronofun.com">pronofun</a> |
<a href="http://areno.jeu-gratuit.net">areno</a> |
<a href="http://www.micropolia.com">micropolia</a> |
<a href="http://www.zeitoun.net">zeitoun</a> |
<a href="http://federation.jeu-gratuit.net">federation</a>
</div>
</body></html>