![]() |
Adding Currently Active Users to your own vB page
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!): PHP Code:
PHP Code:
PHP Code:
PHP Code:
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: PHP Code:
PHP Code:
HTML Code:
<!-- logged-in users --> HTML Code:
<tr> |
excellent article :up:
this question has been asked numerous times |
will do :D
|
Yup, but haven't you missed the latest step when the user need to call the template into the external page? :p
PHP Code:
http://img232.imageshack.us/img232/9209/immaginect9.jpg It is without styles. Is this normal? |
Quote:
Quote:
|
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.
|
Quote:
|
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.
|
Quote:
|
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.. PHP Code:
|
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.
|
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 |
Quote:
HTML Code:
<!-- logged-in users --> |
Thanks for your replies, Lynne. That works correctly.
|
I've tried this tutorial and only want $activeusers to show up in the mini profile block, however it is not working. Help?
|
You want to show the whole list of active users on each person's profile page? I think you would have to either a) add this code to the member.php page and templates or b) write plugins to add it to the page. I'd opt for plugins, but it's not something I can help with since I don't run 3.7 on my board yet.
|
Quote:
However I like the A option better. However I tried adding all of your code to the member.php and it did not work. |
I just don't feel up to learning about the specifics of adding a mini-profile block which is the hard part with what you want to do (adding my own tabs and code was 'fun' enough!). Your best bet is to probably post in the appropriate forums for help doing this sort of modification. Make sure you post exactly what code you wrote to write to the template - that is going to be the challenge.
|
Quote:
|
Quote:
This is down and dirty so you will have to caress it to look how you want. Add all the stuff to the member.php page that it said in the article (make sure you add it *before* the "member_build_blocks_start" hook gets called or the information won't be available to be displayed!), then when you get to the part about adding to the template, do this: Create a new template called "memberinfo_block_curactive" with this: HTML Code:
<!-- Currently Active Users --> PHP Code:
I have NOT tested it on a live site. Use at your own risk!!!!! |
Hi Lynne, How can I add Who is Online in THIS_SCRIPT ? Thanks
|
Quote:
|
Quote:
Something like: Currently Active Users Viewing This Thread: 1 (1 members and 0 guests) mokujin Thanks :) |
Quote:
|
I have it, just add this code for your custom page.
After Quote:
PHP Code:
|
Great! Thanks for sharing!
|
1 Attachment(s)
Can I have something like this in my every header? I just photoshopped the attachment. :)
|
Quote:
|
Ah, sorry. I misunderstand it. Can u help me with the plugin code please? Do u want to me open a thread here?
|
You will need to start a thread about it. I'm not certain how well I can help you since it's something I've never really looked into, but hopefully someone can help.
|
Roger that. :)
|
Quote:
Also, will this work on existing vBulletin files? Let's say I want to add it to Social Groups. |
Quote:
|
1 Attachment(s)
I tryed to add it on vb 3.8 beta2, but it don't work. it don't show any numbers, look at the screenshot. sorry for my bad english
here is my code from my php file Code:
<?php Code:
<!-- logged-in users --> |
This was written to be used in conjunction with How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. You need to eval/fetch your templates after the code like in those articles. This article is NOT stand alone code. You MUST use it with an already working vb powered page.
|
i have an working vbulletin powered page. in this page i use for example the vbulletin login, recent forum threads, latest album pictures and so on. everything works in this page, only who's online works not.
|
Quote:
|
thanks alot, this was the error :)
|
Thank you for this article. It explains everything perfectly. Installed in no time.
Voted 5 stars. :up: Shoolace |
Question;
I have the ability to log in users on all my non-VB pages. If a user comes on a non-VB page, it'll fetch their cookies and automatically log them in if they are a member who selected the Remember Me option. Otherwise it'll act as if they are a Guest user. I don't want to display the Currently Active Users on my non-VB pages, but I'd like to know if there are users on my non-VB pages by looking at the Currently Active Users on the forumhome. Do all I need to add to do this then is this? Code:
// ######################### REQUIRE BACK-END ############################ [edit] I tried this out but it's not recognizing users on my site's index.php (which uses the header.php file I'm putting the code into. Here are the first lines that the header.php file is using to try and get this working: Code:
<?php |
All times are GMT. The time now is 09:32 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|