PDA

View Full Version : Adding Currently Active Users to your own vB page


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) (http://www.vbulletin.org/forum/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (http://www.vbulletin.org/forum/showthread.php?t=98009) 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!):

// get special data templates from the datastore
$specialtemplates = array(
'maxloggedin',
);
ADD the forumhome_loggedinuser template to the globaltemplates array so it looks like this:

// pre-cache templates used by all actions
$globaltemplates = array(
'TEST',
'forumhome_loggedinuser',
);
Then ADD the functions_bigthree.php to the required files list so it looks like this:

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');
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:

// ######################### REQUIRE BACK-END ############################
chdir ('/path/to/your/forums');
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');
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:

// ### LOGGED IN USERS #################################################
$activeusers = '';
if (($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 2 OR ($vbulletin->options['displayloggedin'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine'])
{
END with:

$show['loggedinusers'] = true;
}
else
{
$show['loggedinusers'] = false;
}
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.

<!-- 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 -->
Also, very important if you want your page to validate correctly!, change the other columns to span 2 columns. ie.

<tr>
<td class="tcat" colspan="2">Title</td>
</tr>
<tr>
<td class="alt1" colspan="2">Text</td>
</tr>
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

<?php
eval('print_output("' . fetch_template('TEST') . '");');
?>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
Yup, but haven't you missed the latest step when the user need to call the template into the external page? :p

<?php
eval('print_output("' . fetch_template('TEST') . '");');
?>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) (http://www.vbulletin.org/forum/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (http://www.vbulletin.org/forum/showthread.php?t=98009)
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
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
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..

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'here I call my custom template name where I've put the who's online html code',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

eval('print_output("' . fetch_template('here I call my custom template name where I've put the who's online html 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. (http://www.vbulletin.org/forum/showthread.php?t=98009) 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
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:


<!-- 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>:&nbsp;<?php
echo $totalonline;
?>
<div><?php
echo $activeusers;
?></div>
<!-- end logged-in users -->

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?

Lynne
05 Sep 2008, 00:38
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.

TheInsaneManiac
05 Sep 2008, 18:57
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.
I have a test board you can use if you wish.

However I like the A option better. However I tried adding all of your code to the member.php and it did not work.

Lynne
05 Sep 2008, 21:48
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.

TheInsaneManiac
06 Sep 2008, 19:57
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.
There should not be any changes? The template and php files are already there. I just don't understand why your tutorial is not working.

Lynne
06 Sep 2008, 22:57
There should not be any changes? The template and php files are already there. I just don't understand why your tutorial is not working.
This article was made to use existing templates. If you didn't put your information into a template, then it's not going to work.

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:
<!-- 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 -->Create a plugin at hook location "member_build_blocks_start" with this:
eval('$template_hook[profile_right_first] .= "' . fetch_template('memberinfo_block_curactive') . '";');
I have NOT tested it on a live site. Use at your own risk!!!!!

mokujin
31 Oct 2008, 00:57
Hi Lynne, How can I add Who is Online in THIS_SCRIPT ? Thanks

Lynne
31 Oct 2008, 01:48
Hi Lynne, How can I add Who is Online in THIS_SCRIPT ? Thanks
I'm not sure what you mean. If you make a vB page and then add this code to the page and template, it will only be shown on this page.

mokujin
31 Oct 2008, 19:06
I'm not sure what you mean. If you make a vB page and then add this code to the page and template, it will only be shown on this page.
I mean how to make it shows users currently viewing this Page, not who is online global.

Something like:
Currently Active Users Viewing This Thread: 1 (1 members and 0 guests)
mokujin

Thanks :)

Lynne
31 Oct 2008, 19:30
I mean how to make it shows users currently viewing this Page, not who is online global.

Something like:
Currently Active Users Viewing This Thread: 1 (1 members and 0 guests)
mokujin

Thanks :)
You want to add a list to the bottom of your vB page that lists all the users currently viewing this particular page? I do not know. That would be the subject for another article, I imagine. (I'm guessing it would be very similar to how this is done only you copy the code from the showthread page instead of the index page.)

mokujin
31 Oct 2008, 21:38
I have it, just add this code for your custom page.
After WHERE session.lastactivity > $datecut
Add:
AND session.location LIKE '%your_script_name.php%'

Thank you Lynne :)

Lynne
31 Oct 2008, 22:13
Great! Thanks for sharing!

Forum Lover
15 Nov 2008, 02:52
Can I have something like this in my every header? I just photoshopped the attachment. :)

Lynne
15 Nov 2008, 03:52
Can I have something like this in my every header? I just photoshopped the attachment. :)
I suppose you could, but this article won't do it for you. It will only make the information available to your template, not your header. I think you'd have to plugin to a hook location like global_start in order to do the query to have the numbers spit out in the header.

Forum Lover
15 Nov 2008, 05:53
Ah, sorry. I misunderstand it. Can u help me with the plugin code please? Do u want to me open a thread here (http://www.vbulletin.org/forum/forumdisplay.php?f=111)?

Lynne
15 Nov 2008, 05:57
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.

Forum Lover
15 Nov 2008, 05:59
Roger that. :)

djxcee
16 Nov 2008, 13:05
I have it, just add this code for your custom page.
After
Add:
AND session.location LIKE '%your_script_name.php%'

Thank you Lynne :)
How do I add more than one file?

Also, will this work on existing vBulletin files? Let's say I want to add it to Social Groups.

Lynne
16 Nov 2008, 17:27
How do I add more than one file?

Also, will this work on existing vBulletin files? Let's say I want to add it to Social Groups.
The code in this tutorial is for a single page. So, if you want it on Social Groups, you add the code to that page and then add that line to the query with the social groups php page in there.

eh9 daddy
21 Nov 2008, 09:35
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


<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');


// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array(
'maxloggedin',
);

// pre-cache templates used by all actions
$globaltemplates = array(
'Test',
'forumhome_loggedinuser',
);



// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

($hook = vBulletinHook::fetch_hook('startseite_main')) ? eval($hook) : false;


$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('Test') . '");');

// ### LOGGED IN USERS #################################################
$activeusers = '';
if (($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 2 OR ($vbulletin->options['displayloggedin'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine'])
{
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$numbervisible = 0;
$numberregistered = 0;
$numberguest = 0;

$hook_query_fields = $hook_query_joins = $hook_query_where = '';
($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser_query')) ? eval($hook) : false;

$forumusers = $db->query_read_slave("
SELECT
user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity, session.badlocation,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
$hook_query_fields
FROM " . TABLE_PREFIX . "session AS session
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
$hook_query_joins
WHERE session.lastactivity > $datecut
$hook_query_where
" . iif($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 3, "ORDER BY username ASC") . "
");

if ($vbulletin->userinfo['userid'])
{
// fakes the user being online for an initial page view of index.php
$vbulletin->userinfo['joingroupid'] = iif($vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['usergroupid']);
$userinfos = array
(
$vbulletin->userinfo['userid'] => array
(
'userid' =>& $vbulletin->userinfo['userid'],
'username' =>& $vbulletin->userinfo['username'],
'invisible' =>& $vbulletin->userinfo['invisible'],
'inforum' => 0,
'lastactivity' => TIMENOW,
'usergroupid' =>& $vbulletin->userinfo['usergroupid'],
'displaygroupid' =>& $vbulletin->userinfo['displaygroupid'],
'infractiongroupid' =>& $vbulletin->userinfo['infractiongroupid'],
)
);
}
else
{
$userinfos = array();
}
$inforum = array();

while ($loggedin = $db->fetch_array($forumusers))
{
if ($loggedin['badlocation'])
{
continue;
}

$userid = $loggedin['userid'];
if (!$userid)
{ // Guest
$numberguest++;
$inforum["$loggedin[inforum]"]++;
}
else if (empty($userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
{
$userinfos["$userid"] = $loggedin;
}
}

if (!$vbulletin->userinfo['userid'] AND $numberguest == 0)
{
$numberguest++;
}

foreach ($userinfos AS $userid => $loggedin)
{
$numberregistered++;
if ($userid != $vbulletin->userinfo['userid'])
{
$inforum["$loggedin[inforum]"]++;
}
fetch_musername($loggedin);

($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser')) ? eval($hook) : false;

if (fetch_online_status($loggedin))
{
$numbervisible++;
$show['comma_leader'] = ($activeusers != '');
eval('$activeusers .= "' . fetch_template('forumhome_loggedinuser') . '";');
}
}

// memory saving
unset($userinfos, $loggedin);

$db->free_result($forumusers);

$totalonline = $numberregistered + $numberguest;
$numberinvisible = $numberregistered - $numbervisible;

// ### MAX LOGGEDIN USERS ################################
if (intval($vbulletin->maxloggedin['maxonline']) <= $totalonline)
{
$vbulletin->maxloggedin['maxonline'] = $totalonline;
$vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
build_datastore('maxloggedin', serialize($vbulletin->maxloggedin), 1);
}

$recordusers = vb_number_format($vbulletin->maxloggedin['maxonline']);
$recorddate = vbdate($vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxonlinedate'], true);
$recordtime = vbdate($vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxonlinedate']);

$show['loggedinusers'] = true;
}
else
{
$show['loggedinusers'] = false;
}

?>


and my code from the template


<!-- logged-in users -->
<table>
<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]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
</td>
</tr>
</table>
<table id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
<tr>
<td class="alt2"><a href="online.php$session[sessionurl_q]"><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>
</table>
<!-- end logged-in users -->

Lynne
21 Nov 2008, 17:02
This was written to be used in conjunction with How to create your own vBulletin-powered page! (uses vB templates) (http://www.vbulletin.org/forum/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (http://www.vbulletin.org/forum/showthread.php?t=98009) 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.

eh9 daddy
21 Nov 2008, 17:29
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.

Lynne
21 Nov 2008, 17:55
Paste these lines into the main part of your page.
You pasted it at the end of your script. You need to put it before you eval your templates - right under "START MAIN SCRIPT", before the $navbits stuff.

eh9 daddy
21 Nov 2008, 18:03
thanks alot, this was the error :)

shoolace
27 Dec 2008, 21:19
Thank you for this article. It explains everything perfectly. Installed in no time.

Voted 5 stars. :up:

Shoolace

Submerge
20 Feb 2009, 19:47
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?

// ######################### REQUIRE BACK-END ############################
chdir ('/path/to/your/forums');
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');


That way Ill know how many vBulletin members are on at a certain time throughout my entire website, not just the forums? (Since I have that code in the header.php file that all non-VB pages use)

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

<?php
//vBulletin Member Recognition
$curdir = getcwd ();
chdir('forums/');
require_once('forums/global.php');
require_once(DIR . '/includes/functions_bigthree.php'); //Fetch current active users?
chdir ($curdir);

Lynne
20 Feb 2009, 21:43
Your path to global.php does not look right. I posted the correct code in the first post:

chdir ('/path/to/your/forums');
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');

Submerge
24 Feb 2009, 03:03
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:

//vBulletin Member Recognition
$curdir = getcwd ();
chdir ('/home/ps3t/public_html/forums');
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');
chdir ($curdir);


My site's forum is in the /forums/ directory. You can view my site in my signature if you'd like to take a quick look. Am I still incorrectly doing the path? Or does it seem to check out in your mind of how I have it set up? Since the homepage can recognize user's being logged in, I'd think I'd have the path correct, but I'm not an expert at vB programming (but I'm trying!).

TNCclubman
24 Feb 2009, 05:06
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!!

Lynne
24 Feb 2009, 05:37
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:

//vBulletin Member Recognition
$curdir = getcwd ();
chdir ('/home/ps3t/public_html/forums');
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');
chdir ($curdir);
My site's forum is in the /forums/ directory. You can view my site in my signature if you'd like to take a quick look. Am I still incorrectly doing the path? Or does it seem to check out in your mind of how I have it set up? Since the homepage can recognize user's being logged in, I'd think I'd have the path correct, but I'm not an expert at vB programming (but I'm trying!).
It's really hard to tell why it isn't working without seeing all the code and your template. Maybe you should post in one of the Community Discussions forums and post the code for the page there.
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!!
I doubt I will be doing that since I don't need either of those things on my forum.

externalaw.com
17 Apr 2009, 10:38
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?

Floris
17 Apr 2009, 11:16
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 :)

khuhner
14 Feb 2010, 17:38
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 1266169882 at 1266169882 ---------------

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!

Well I kept searching and found your article on doin this exact thing!
http://www.vbulletin.org/forum/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

Tyran1
04 Apr 2012, 04:39
Works with 3.8.7

Statistik ??