Is there any way to call into the PHP routine in order to output how many people are currently in the chat?
I'm trying to setup a page with a link into the chat that says how many people are already there. Please le t me know. Thanks!!
Moderators: OldWolf, re*s.t.a.r.s.*2
<?php
require_once dirname(__FILE__)."/chat/src/pfcinfo.class.php";
$info = new pfcInfo( md5("Whatever you Want") );
// NULL is used to get all the connected users, but you can specify
// a channel name to get only the connected user on a specific channel
$users = $info->getOnlineNick(NULL);
echo '<div align="center">';
$info = "";
$nb_users = count($users);
if ($nb_users <= 0)
$info = "<center>%d users in the Chat Room</center>";
echo "</div>";
echo "<div>";
echo "<p>".sprintf($info, $nb_users)."</p>";
echo "<ol>";
foreach($users as $u)
{
echo "<li>".$u."</li>";
}
echo "</ol>";
echo "</div>";
?>
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
Warning: require_once(D:xampphtdocsDirectory/chat/src/pfcinfo.class.php) [function.require-once]: failed to open stream: No such file or directory in D:xampphtdocsDirectorydirectory.php on line 36
Fatal error: require_once() [function.require]: Failed opening required 'D:xampphtdocsDirectory/chat/src/pfcinfo.class.php' (include_path='.;D:xamppphppear') in D:xampphtdocsDirectorydirectory.php on line 36
$params["serverid"] = md5(ForumChat); // calculate a unique id for this chat
<?php
require_once dirname(__FILE__)."/chat/src/pfcinfo.class.php";
$info = new pfcInfo( md5(ForumChat) );
// NULL is used to get all the connected users, but you can specify
// a channel name to get only the connected user on a specific channel
$users = $info->getOnlineNick(NULL);
Warning: require_once(/home/nzmotorh/public_html/directory/chat/src/pfcinfo.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/nzmotorh/public_html/directory/directory.php on line 36
Fatal error: require_once() [function.require]: Failed opening required '/home/nzmotorh/public_html/directory/chat/src/pfcinfo.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/nzmotorh/public_html/directory/directory.php on line 36
sandarminaye wrote:hi,
i also want to know the number of people in chat, so , how do i write in my page.
pls help me and tell me complete code.
i had try above coding but it can't.
thanks all.
waiheke wrote:Oh
I just found a post by Old Wolf, with much more elegant code
Copy this to the very bottom of your chat page and upload and run it to see the params
The 1st entry is the number string you want
<?php
echo '<h2>Debug</h2>';
echo '<pre>';
$c =& pfcGlobalConfig::Instance();
print_r($c);
print_r($_SERVER);
echo '</pre>';
?>
Fatal error: Class 'pfcGlobalConfig' not found in /hsphere/local[...]phpfreechat-0.9.3/index.php on line 27
Return to General Support (v1.x)
Users browsing this forum: No registered users and 5 guests