Location: PHPKode > scripts > IPB Chat Module > Includes/functions_chat.php
<?php
/***************************************************************************
 *                            functions_chat.php
 *                            -------------------
 *   begin                : Friday, Apr 30, 2004
 *   copyright            : (C) 2003 TopCMM Software
 *   email                : hide@address.com
 *   version		  	  : 6.7.0
 *   
 *   123 Flash Chat Server - phpBB integrated mod
 *
 ***************************************************************************/


/**
 * if unix, and your 123 flash chat server installed in /usr/local/123flashchat,
 * please do the command "chmod 755 /usr/local/123flashchat/data/online.txt"
 * and set the below parameter
 *
 * $chat_data_path = "/usr/local/123flashchat/data/";  
 * 
 */

$chat_data_path = "C:/Program Files/123FlashChatServer6.8/server/data/default";


function getChatters()
{
	global $chat_data_path;

	$room = array();

	$room['connections'] = 0;
	$room['logon_users'] = 0;
	$room['room_numbers'] = 0;

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

	if (!file_exists($online_file))
	{
		return $room;
	}

	if (!$row = file($online_file))
	{
		return $room;
	}

	$room_data = explode("|", $row[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]);
	}

	return $room;
}
function getChatterList()
{
	global $chat_data_path, $lang;

	$userListStr = "";

	$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 == "") ? $lang['None'] : $userListStr;
	return $userListStr;
}


?>
Return current item: IPB Chat Module