vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=187388

Adding Currently Active Users to your own vB page
by Lynne
06 Aug 2008 20:33

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.

Princeton 07 Aug 2008 17:08

excellent article :up:

this question has been asked numerous times

iogames 09 Aug 2008 02:48

will do :D

Triky 20 Aug 2008 17:38

Yup, but haven't you missed the latest step when the user need to call the template into the external page? :p


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?

Lynne 20 Aug 2008 18:06

Quote:

Originally Posted by Triky (Post 1603112)
Yup, but haven't you missed the latest step when the user need to call the template into the external page? :p


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:
Quote:

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.

Triky 20 Aug 2008 18:50

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.

Lynne 20 Aug 2008 20:43

Quote:

Originally Posted by Triky (Post 1603166)
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.

Triky 21 Aug 2008 09:10

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.

Lynne 21 Aug 2008 15:19

Quote:

Originally Posted by Triky (Post 1603600)
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).

Triky 21 Aug 2008 18:42

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.

Lynne 21 Aug 2008 18:54

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.

Triky 22 Aug 2008 10:50

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

Lynne 22 Aug 2008 18:44

Quote:

Originally Posted by Triky (Post 1604316)
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.


Triky 25 Aug 2008 18:30

Thanks for your replies, Lynne. That works correctly.

TheInsaneManiac 04 Sep 2008 19:01

I've tried this tutorial and only want $activeusers to show up in the mini profile block, however it is not working. Help?


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

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.