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> |
#12
|
||||
|
||||
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.
|
#13
|
||||
|
||||
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 |
#14
|
||||
|
||||
Quote:
HTML Code:
<!-- logged-in users --> <h1>Logged in Users</h1> <a href="online.php<?php echo $session[sessionurl_q]; ?>" rel="nofollow"><?php echo $vbphrase[currently_active_users]; ?></a>: <?php echo $totalonline; ?> <div><?php echo $activeusers; ?></div> <!-- end logged-in users --> |
#15
|
||||
|
||||
Thanks for your replies, Lynne. That works correctly.
|
#16
|
|||
|
|||
I've tried this tutorial and only want $activeusers to show up in the mini profile block, however it is not working. Help?
|
#17
|
||||
|
||||
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.
|
#18
|
|||
|
|||
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. |
#19
|
||||
|
||||
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.
|
#20
|
|||
|
|||
Quote:
|
#21
|
||||
|
||||
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 --> <div id="users_mini" class="tborder content_block"> <h4 class="thead block_title"> <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('users_mini')"><img id="collapseimg_users_mini" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_users_mini']}.gif" alt="" border="0" /></a> <a name="users_mini"></a> <span class="block_name">Currently Active Users</span> </h4> <div class="block_content" id="collapseobj_users_mini" style="{$vbcollapse['collapseobj_users_mini']}"><span class="alt1 smallfont block_row"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase><br>$activeusers</span></div> </div> <!-- / Currently Active Users --> PHP Code:
I have NOT tested it on a live site. Use at your own risk!!!!! |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|