Jump to content

Recommended Posts

I can load whole code if you want to so you will have better understanding... Ima do it any ways..

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Web Chat";
$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
$params['firstisadmin'] = false;
//$params["isadmin"] = false; // makes everybody admin: do not use it on production servers 
$params['admins'] = array('Kevo'  => 'Test',
                            'boby' => 'bobypw');
$params["theme"]       = "zilveer";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$params["channels"] = array("HTML");
$params["frozen_channels"] = array("HTML","room1","room2","HTML5", "PHP", "Java", "CSS", "Flash");
$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" />  
  <?php $chat->printJavascript(); ?>
  <?php $chat->printStyle(); ?>
<style type="text/css">
body {
background-color: #333;
}
</style>
</head>
<body>

<div class="header">
      Web Information Chat <br /><font color="#FFCC33" size="2">// Bare with me, I am still woking on the site, please enjoy and read rules //</font>
</div>

<div class="menu">
      <ul>
        <li class="sub title">General</li>
        <li>
          <ul class="sub">
            <li class="item">
              <a href="#">Rules</a> <font color="#FFCC33" size="2">//Coming Soon//</font>
            </li>
           
            <!--
            <li class="item">
              <a href="admin/">Administration</a>
            </li>
            -->
          </ul>
        </li>
       
            <li class="sub title">Rooms</li>
            <li><a href="#" onclick="pfc.sendRequest('/join HTML');">HTML</a></li>    <li><a href="#" onclick="pfc.sendRequest('/join HTML5');">HTML5</a></li>
            <li><a href="#" onclick="pfc.sendRequest('/join PHP');">PHP</a></li>    <li><a href="#" onclick="pfc.sendRequest('/join Java');">Java</a></li>
            <li><a href="#" onclick="pfc.sendRequest('/join CSS');">CSS</a></li>    <li><a href="#" onclick="pfc.sendRequest('/join Flash');">Flash</a></li>
  </ul>
        </li>
</ul>
      <p class="partner">
        
  </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 } ?>
<?php if (isset($params['admins'])) { 
?>
<p style="color:red;font-weight:bold;">Testing</p>
  
<?php } ?>
</div>

<div class="footer">
  <span class="partners">Web Information Chat</span>
  
</div>
    
</body></html>

Ok.. so what i have at the top are paramaters... $params['admins'] = array('Kevo'  => 'Test', 'boby' => 'bobypw'); this is for when the admin comes into chat and he can change is status form guest/member to admin. Now down below i have <?php if (isset($params['admins'])) { ?> <p style="color:red;font-weight:bold;">Testing</p><?php } ?> , this for adding a list of commands for admins to see when they change their status to admins, the others cannot view the command list... this what i am trying to do. I hope this make sense and thanks for all the help. I have also tried using echo as well but was showing all the time... maybe i might have something wrong.

Link to comment
https://forums.phpfreaks.com/topic/264339-need-help/#findComment-1354672
Share on other sites

The documentation for that package isn't very good. Have you tried uncommenting this line and see if that changes anything?

 

//$params["isadmin"] = false; // makes everybody admin: do not use it on production servers 

Link to comment
https://forums.phpfreaks.com/topic/264339-need-help/#findComment-1354675
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.