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

Hardcode wordpress \"who is online\" widget into a WP page.

Integration help for Joomla, Drupal, and Wordpress

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

Post a reply
2 posts • Page 1 of 1

Postby Monkfish » Fri Feb 24, 2012 1:16 pm

Hello everyone,

I am using PHPfreechat on my website, and so far all my users are enjoying it. It is used in conjunction with a community, so i would like to be able to display the "Who is online" widget at the top of the community.

Where will I find the code to allow me to hardcode that function into my community page ? and is it possible to do it ?

I have tried a work around, using the widgets on a page plugin for wordpress, but a conflict between that plugin and the forum plugin means it doesn't work, making hard coding the preferred option.

Does anyone have any ideas or can assist at all ?

Here is a link to my site - i would like the "Users Online" Information to sit in between the community and the header.

http://www.racecraftmag.co.uk/?page_id=133

With thanks

Monkfish
Last edited by Monkfish on Fri Feb 24, 2012 1:23 pm, edited 1 time in total.
Monkfish
New member
 
Posts: 2
Joined: Fri Feb 24, 2012 1:03 pm
Top

Postby Monkfish » Fri Feb 24, 2012 4:56 pm

•• Update ••

after more searching on this community - I found this thread and have successfully added the code to my site, so it looks for users in the chat room.

However, it always reads 0 users in the chat room.

This is the code I have added - can anyone tell me what is wrong ?

Code: Select all
<?php

require_once dirname(__FILENAME__)."/wp-content/plugins/phpfreechat/src/pfcinfo.class.php";
$info  = new pfcInfo( md5("FILENAME") );
// 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(general);


echo '<div class="user">';
$info = "";
$nb_users = count($users);
if ($nb_users <= 1)
  $info = "<strong>%d</strong> Members in the Chatroom!";
else
  $info = "<strong>%d</strong> Members are in deep philosophical debate in the Chatroom";
echo "<p>".sprintf($info, $nb_users)."</p>";

echo "<ul>";
foreach($users as $u)
{
  echo "<li>".$u."</li>";
}
echo "</ul>";
echo "</div>";

?>
Monkfish
New member
 
Posts: 2
Joined: Fri Feb 24, 2012 1:03 pm
Top


Post a reply
2 posts • Page 1 of 1

Return to Joomla, Drupal, and Wordpress (v1.x)

Who is online

Users browsing this forum: No registered users and 1 guest

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