function getChatters()
{
$chat_data_path = "/usr/local/123FlashChat/data/default/";
$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]);
}
$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;
$room['userlist'] = ($userListStr == "") ? $lang['None'] : $userListStr;
return $room;
}
Time to create page: 0.068 seconds