Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > 123 Flash Chat Server Software > 123 Flash Chat Support

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2008, 11:55 PM
Junior Member
 
Join Date: Dec 2005
Posts: 23
Default online php block - remove admins from listing

Hi:

I get online user data with this php code:

Code:
///CHAT BLOCK///
define("_CHAT_USERLIST","Personas en el video-chat: ");
define("_CHAT_NONE_USER","Nadie");
define("_CHAT_THEREARE","Hay...");
define("_CHAT_CONNECTIONS","personas conectadas al chat server");
define("_CHAT_ROOMS","Salas");
define("_CHAT_LOGON_USERS","Logeados");

$chat_data_path="/usr/local/123flashchat/data/default/";

$content = "";
$userListStr = "";
$room_id = "";

$room = array();

$online_file = $chat_data_path."online.txt";

if (!file_exists($online_file))
{
  echo "Can't find $online_file";
  
}
else if (!$trow = file($online_file))
{
  echo "Read $online_file error";
  
}
else
{
  $room_data = explode("|", $trow[0]);
  
  
  if (count($room_data) == 3)
  {
   $room['connections'] =  intval($room_data[0]);
   $room['logon_users'] =  intval($room_data[1]);
   $room['room_numbers'] =  intval($room_data[2]);
  }
  
  $d = dir($chat_data_path);
  
  while (false !== ($entry = $d->read())) 
  {
   $rest = substr($entry, 0, 5);
   if ($rest == "room_")
   {
   
   if (file_exists($chat_data_path.$entry))
   {
     
     $f_users = file($chat_data_path.$entry);
     
     for ($i = 0; $i < count($f_users); $i ++)
     {
      $f_line = trim($f_users[$i]);
      
      if ($f_line != "")
      {
        $userListStr = ($userListStr == "") ? $f_line : $userListStr. ", " . $f_line;
      }
     }
     
   }    
   }
  
  }
  $d->close();
  
  $userListStr = ($userListStr == "") ? _CHAT_NONE_USER : $userListStr;

}

$c_connections = $room['connections'];
$c_rooms = $room['room_numbers'];
$c_logon_users = $room['logon_users'];  
   
$content .= _CHAT_THEREARE . " <b>" . $c_connections . "</b> "._CHAT_CONNECTIONS;
$content .= "<br><br>". _CHAT_THEREARE . " <b>" . $c_rooms. "</b> ". _CHAT_ROOMS;
$content .= "<br><br>". _CHAT_THEREARE . " <b>" . $c_logon_users . "</b> "._CHAT_LOGON_USERS;
$content .= "<br><br>". _CHAT_USERLIST . " <b>" . $userListStr . "</b>";
$chateoactivo = $content;
Soo.. data file for a room for example room_1007.txt displays connected users:

bill
david
julie
jose
maria
TheCat

My question is how I can specify some names to be excluded from getting listed. For example if maria and TheCat are chat moderators, I dont want to show them as connected... Maybe a while $f_user != bla bla bla could work but I need the code!!! that will do the trick!

I hope what I want in understood. I use Linux, PHP 5.2.5 and Apache 2.

TIA

Latino
  #2 (permalink)  
Old 02-28-2008, 05:57 AM
Member
 
Join Date: Feb 2008
Posts: 85
Default Re: online php block - remove admins from listing

You could define an array in php and put the names that you want to be excluded from showing in it.
Then just make a judgement at
$userListStr = ($userListStr == "") ? _CHAT_NONE_USER : $userListStr;
when you generate userlist here.
Closed Thread

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:30 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.