Who Is Online

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
Post Reply
Steve Angelis
Registered User
Posts: 6
Joined: Mon Jun 16, 2008 5:24 pm

Who Is Online

Post by Steve Angelis »

I am working on a website and integrating it with a phpbb3 forum. I am trying to add a small block that says how many guests are online and how many are logged in. Does anyone know where I can find the code for this and what the code is?
User avatar
Lumpy Burgertushie
Registered User
Posts: 67985
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Who Is Online

Post by Lumpy Burgertushie »

Steve Angelis wrote:I am working on a website and integrating it with a phpbb3 forum. I am trying to add a small block that says how many guests are online and how many are logged in. Does anyone know where I can find the code for this and what the code is?
the way to find this stuff is to see what page it shows up on in phpbb.

then check the code for that page.

in this case, the index page is where that is shown.
therefore it would be somewhere in the index_body.html file is where you would look ( for the style you are using )

In that file , you will find this:

Code: Select all

<!-- IF S_DISPLAY_ONLINE_LIST -->
	<!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
	<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
	<!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
<!-- ENDIF -->
Now, assuming that your custom pages are done correctly and you are using the phpbb code at the top of them, you should be able to simply paste that into one of the pages and it would show that info.

You will have to do some tweaks to layout, etc, etc but it should work.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
Steve Angelis
Registered User
Posts: 6
Joined: Mon Jun 16, 2008 5:24 pm

Re: Who Is Online

Post by Steve Angelis »

I was hoping to not have to use a template with it. I found that earlier when I was toying with those files.
User avatar
alleycat
Registered User
Posts: 6
Joined: Fri May 02, 2008 6:32 pm

Re: Who Is Online

Post by alleycat »

Steve Angelis wrote:I was hoping to not have to use a template with it.
They can be pretty confusing but, once you get to grips with them, they are very powerful :mrgreen:
If I know I'm going crazy, I must not be insane
User avatar
Lumpy Burgertushie
Registered User
Posts: 67985
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Who Is Online

Post by Lumpy Burgertushie »

Steve Angelis wrote:I was hoping to not have to use a template with it. I found that earlier when I was toying with those files.
you don't have to use a template. you simply have to put phpbb's sessions code at the top of any page that you want to include phpbb variables in and make that page a php file instead of a html file.
( you do that by giving it a php extension )..


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Who Is Online

Post by Eelke »

If you want to do this without the phpBB3 framework, just examine how the template variables from the above template snippet are being generated. You can call these functions yourself. It might take a little bit of experimenting.
Post Reply

Return to “phpBB Discussion”