• 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

Number of users online on the other page

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

Post a reply
9 posts • Page 1 of 1

Postby Shonetow » Wed Jan 24, 2007 5:25 pm

How to add a number of users online on the other page.

etc.

I have forum, and I want to allways be a number beside CHAT link.

example (3)CHAT
Shonetow
New member
 
Posts: 5
Joined: Wed Jan 24, 2007 5:18 pm
Top

Postby thaughbaer » Wed Jan 24, 2007 8:18 pm

Hi,
look at demo 31... you can do a count of the array,

Regards,
Mike
thaughbaer
New member
 
Posts: 7
Joined: Tue Jan 23, 2007 11:54 pm
Top

Postby Shonetow » Thu Jan 25, 2007 2:05 pm

It doesnt work!!! It works only there, but I want to place on some specific place... if a try to copy the code and change a path - it doesnt work...
Where's the explanation? What is my mistakes?
Shonetow
New member
 
Posts: 5
Joined: Wed Jan 24, 2007 5:18 pm
Top

Postby Shonetow » Thu Jan 25, 2007 2:52 pm

it works... stupid path :)
Shonetow
New member
 
Posts: 5
Joined: Wed Jan 24, 2007 5:18 pm
Top

Postby Shonetow » Thu Jan 25, 2007 6:41 pm

Now I have problem with PhpBB forum. I can't just put this php code, couse he have a .tpl extension. Template. He works with {SOME_CODE}.
I'm not a php expert, so I can't solve the problem by myself...
Shonetow
New member
 
Posts: 5
Joined: Wed Jan 24, 2007 5:18 pm
Top

Postby shacknasty » Sun Feb 04, 2007 9:06 am

I just got this working with phpbb templates.

Find the follow lines in your includes/page_header.php file -

//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//

Then insert these 5 lines after that:

require_once dirname(__FILE__)."/../chat/src/pfcinfo.class.php";
$info = new pfcInfo ("CHANGE-THIS-TO-YOUR-CHAT-MD5") ;
$users = $info->getOnlineNick(NULL);
$nb_users = count($users);
$info = "(%d)";


then you should see

$template->assign_vars(array(

on the next line down. on the line underneath that, insert this:
'CHAT_USERS' => sprintf($info, $nb_users),


Now you will be able to use the variable {CHAT_USERS} in any of your template files.

See the header on http://forums.punkas.com for how I have used it...

Let us know how you get on. The important parts will be getting the chat name/md5 and paths right
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby kostassite » Thu Mar 15, 2007 10:07 pm

i have the chat in other folder than the page i want to add
chat in www.kostassite.gr/memchat
and the page i want to add the who is online in www.kostassite.gr/index/index.html
Last edited by kostassite on Fri Mar 16, 2007 6:21 pm, edited 1 time in total.
kostassite
New member
 
Posts: 2
Joined: Tue Mar 06, 2007 8:58 pm
Top

Postby shacknasty » Tue Mar 20, 2007 10:28 am

thats fine, just make the dirname path like

require_once dirname(__FILE__)."/../memchat/src/pfcinfo.class.php";
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby xavier40 » Tue Jul 24, 2007 9:25 pm

Hi everybody,

Sorry for this newbie's question, but I don't know what to put instead of "CHANGE-THIS-TO-YOUR-CHAT-MD5" ?
Could someone tell me more about it ?
What does MD5 stands for ?
Where can I find my chat MD5 ?

Thanks ;-)
http://www.mr2.fr/forum/
Last edited by xavier40 on Tue Jul 24, 2007 9:26 pm, edited 1 time in total.
xavier40
New member
 
Posts: 1
Joined: Fri Jan 05, 2007 2:29 pm
Top


Post a reply
9 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 26 guests

  • 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