Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Adding Currently Active Users to your own vB page
Lynne
Join Date: Sep 2004
Posts: 41,180

California/Idaho
by Lynne Lynne is offline 06 Aug 2008
Rating: (3 votes - 5.00 average)

Adding Currently Active Users to your own vB page


I've seen a few users asking about how to add the list of Currently Active Users to their own vB page. Below I document the lines of code you must add after creating your own page using one of these articles - How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. This article only documents what to add to a working page in order to get your Currently Active Users. You should make sure your page is working first before adding this code. I'll refer to your working page as test.php and the template in your working page as 'TEST'.

Instructions

Open your working php page and ADD the maxloggedin template to the specialtemplates array (your maxloggedin users will get reset all the time if you don't add this - I learned that the hard way!):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

ADD the forumhome_loggedinuser template to the globaltemplates array so it looks like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then ADD the functions_bigthree.php to the required files list so it looks like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you are creating this page outside of your normal vb forums directory, you should change directories prior to requiring these files. It would then look like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then open your index.php page and COPY the code between the following START and
END lines. Paste these lines into the main part of your page. (You might want to copy this code from a default index.php if you have modified your index.php page.)

START with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

END with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Open your template that you made (TEST) and ADD the following code in the table. Make sure it is it's own new table row.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Also, very important if you want your page to validate correctly!, change the other columns to span 2 columns. ie.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That should do it! I tested this on my 3.6.8 board and on my 3.7.0 board.

Last edited by Lynne; 21 Aug 2008 at 19:36..
Views: 19375
Reply With Quote
Comments
  #2  
Old 07 Aug 2008, 17:08
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Real name: Joe Velez
excellent article

this question has been asked numerous times
__________________
Former vBulletin.org Staff Member

Latest Articles:
Liquid Layout = Less Ad Revenue?
How to Monetize Your Site
Improve Web Page Performance
How To Write For The Web


If it needs instructions, there's room for improvement.
Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them!
Reply With Quote
  #3  
Old 09 Aug 2008, 02:48
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Real name: Josh Arcadia
will do
__________________
. █│║▌│█│║▌║│█║▌│║║█║
Reply With Quote
  #4  
Old 20 Aug 2008, 17:38
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Yup, but haven't you missed the latest step when the user need to call the template into the external page?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

After this, I get this box:

http://img232.imageshack.us/img232/9209/immaginect9.jpg

It is without styles. Is this normal?
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #5  
Old 20 Aug 2008, 18:06
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Triky View Post
Yup, but haven't you missed the latest step when the user need to call the template into the external page?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

After this, I get this box:

http://img232.imageshack.us/img232/9209/immaginect9.jpg

It is without styles. Is this normal?
No, I didn't miss that. This is what I wrote in my description:
Below I document the lines of code you must add after creating your own page using one of these articles - How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
This is just the code you need to add to an already existing, working page.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #6  
Old 20 Aug 2008, 18:50
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Ok, excuse me. Then, if I output a template on a external .php page can't I output the style of it? I.e.: css, images, etc.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #7  
Old 20 Aug 2008, 20:43
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Triky View Post
Ok, excuse me. Then, if I output a template on a external .php page can't I output the style of it? I.e.: css, images, etc.
Yes, you can have a custom page that looks just like a vb page if you follow the instructions for making a custom page in either of those articles I linked to.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #8  
Old 21 Aug 2008, 09:10
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Are you talking to integrated vB pages (like mysite.com/forum/test.php) that includes header, navbar, footer.. or to external pages? That's becouse I want to make an external page (like mysite.com/test.php) where I include my 'who's online' table, with images and styles like it is on the forumhome. Using your method I can't figure it out, as you can see in my precedent image: there are no styles displayed.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #9  
Old 21 Aug 2008, 15:19
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Triky View Post
Are you talking to integrated vB pages (like mysite.com/forum/test.php) that includes header, navbar, footer.. or to external pages? That's becouse I want to make an external page (like mysite.com/test.php) where I include my 'who's online' table, with images and styles like it is on the forumhome. Using your method I can't figure it out, as you can see in my precedent image: there are no styles displayed.
You should only do what is in this article *after* you have a working page up and running. If mysite.com/test.php is up and running and has your style, navbar, etc, then you can add the code in this article to add a Currently Active Users block to your page. But, the key is that first you need to have an external page up and working (and you can use either of the two articles I linked to at the begining to set up your external page).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #10  
Old 21 Aug 2008, 18:42
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Then, if I want to add that custom block (who's online) to an external .php page that has not my vB style (header, navbar, etc), what do I need to call in my php code in order to let me show also its custom css that it have on my vB forum?
Should I use this code..


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

..? I have tried it, but it seems to doesn't work.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #11  
Old 21 Aug 2008, 18:54
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
What does your template look like? It needs to look something like the one shown in the first post in this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. Notice how it calls the $header and $navbar, etc. You need to have that template working in your page first. Then you add this code into that template.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #12  
Old 22 Aug 2008, 10:50
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Oh, ok, I understand. Then, what could be the best solution to do this:

My example.com/index.php page:

http://img398.imageshack.us/img398/5156/38181099fi1.jpg

What I would like to do:

http://img253.imageshack.us/img253/830/11540346fo9.jpg
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #13  
Old 22 Aug 2008, 18:44
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Triky View Post
Oh, ok, I understand. Then, what could be the best solution to do this:

My example.com/index.php page:

http://img398.imageshack.us/img398/5156/38181099fi1.jpg

What I would like to do:

http://img253.imageshack.us/img253/830/11540346fo9.jpg
The best solution would be to use a template for your page - to follow one of those articles I linked to. If you are going to just make a basic php page instead of using a template, then you need to do something like this in your php page when you use any vb variables:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #14  
Old 25 Aug 2008, 18:30
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Thanks for your replies, Lynne. That works correctly.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #15  
Old 04 Sep 2008, 19:01
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
I've tried this tutorial and only want $activeusers to show up in the mini profile block, however it is not working. Help?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:21.

Layout Options | Width: Wide Color: