The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
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 --> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a> <a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>) </td> </tr> </tbody> <tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]"> <tr> <td class="alt2"><a href="online.php$session[sessionurl_q]" rel="nofollow"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td> <td class="alt1" width="100%"> <div class="smallfont"> <div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div> <div>$activeusers</div> </div> </td> </tr> </tbody> <!-- end logged-in users --> HTML Code:
<tr> <td class="tcat" colspan="2">Title</td> </tr> <tr> <td class="alt1" colspan="2">Text</td> </tr> |
#42
|
||||
|
||||
Your path to global.php does not look right. I posted the correct code in the first post:
PHP Code:
|
#43
|
|||
|
|||
Lynne;
Thank you for your help thus far. I replaced the code as best as I could understand, but it doesn't seem to recognize users on my site's homepage as being Currently Active Users (even though they are logged in and their account info is being displayed correctly on the homepage). Here is what I have: PHP Code:
|
#44
|
||||
|
||||
awesome, can you make a couple more tutorials...
1. How to add Todays Events to your custom vB page. 2. How to add Recently Added Albums (from just my user account) to your custom vB page. Please? That would be awesome, Im stuck!! |
#45
|
||||
|
||||
Quote:
I doubt I will be doing that since I don't need either of those things on my forum. |
#46
|
|||
|
|||
Lynne,
I just want to display current online users at the top of each page, so I guess in the header, How can I do this? |
#47
|
|||
|
|||
You can use the first post as a guide to see how it is done, and re-apply it to the other sections where you need it. It is not too hard to figure out. Good luck tweaking your site
|
#48
|
|||
|
|||
Lynne:
I just found this article and would like to install it. However I'm still new to vb. I have a local site running 4.0.1 and would like to have a widget on the home page of the site (not forums) that I can include Active Users. However this article says you have to create a new page. I have no programming experience in vb so any help getting this into a vb 4.0* widget would be appreciated! Kurt --------------- Added [DATE]1266169882[/DATE] at [TIME]1266169882[/TIME] --------------- Quote:
https://vborg.vbsupport.ru/showthread.php?t=230428 It would be nice to see a lot more "widget" choices like this to allow end users to pick and choose which to include, rather than having to add the code manually. Hopefully vB 4.02+ will support more widgets available by default Thanks so much for the mod! I marked as installed. Kurt |
#49
|
|||
|
|||
Works with 3.8.7
Statistik ?? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|