• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

display users online

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
3 posts • Page 1 of 1

Postby xgamer224 » Sat Mar 10, 2012 1:05 pm

i know this has been posted before but i cant get it to work......
heres what i know:

how to get the server ID:
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>';
?>

^^this works gor me^^

i dont know there to put the next one:

waiheke wrote:Got it working, thanks to another thread here

require_once dirname(__FILE__)."/src/pfcinfo.class.php";

// the next line you MUST EDIT FOR YOUR OWN SERVER ...........
$serverId = "xxxxe0c89fxxxxxxxxbf618b4608xxxx";


$chatinfo= new pfcInfo($serverId );
$users = $chatinfo->getOnlineNick(NULL);

sort($users);
$nd_users = count($users);
$info = "";
if ($nd_users==0) {
echo "There are no users online";
} else {
echo "$nd_users users online";
foreach($users as $u)
{
echo "<li>".$u."</li>";
}}
echo "</ul>";

what worked for me was to look at the unique number generated in the private/log/folder on my server (as shown above) using a standard FTP programme - just substitute your folder string

where do i put the above code?
xgamer224
Member
 
Posts: 13
Joined: Sun Mar 04, 2012 7:01 am
Location: Austin Texas
Top

Postby re*s.t.a.r.s.*2 » Sat Mar 10, 2012 3:26 pm

Hi,

That second code goes in a separated php document somewhere in your chat folder or outside (make sure the require path is correct), then just call it somewhere in your site
front page as example..

If you wanna get dynamic updates from the user connected then you will need to have an Ajax call to this document and show it with HTML markup..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby DaveHass » Thu May 10, 2012 5:39 pm

re*s.t.a.r.s.*2- thanks for your help;) Your advice greatly useful to me!
DaveHass
New member
 
Posts: 2
Joined: Thu May 10, 2012 5:27 pm
Top


Post a reply
3 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 27 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub