Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by Mystics Mystics is offline
Developer Last Online: Jun 2015 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-10-2002 Last Update: Never Installs: 339
 
No support by the author.

Hack Name: Who was online today
Hack Version: 1.0.2
For vB Version:: 2.x
Originally Created by: genial @ Skats Board (Contact)
Documentation, Translation, a few changes and posted by: Mystics

Description:
This Hack adds something like the "Currently Active Users:"-Feature of vBulletin.
The difference is, instead of showing the users, who are currently online, it shows
all Users, who were online on a day and it also displays "Most users ever online on a day".

Summary of the Features:
  • Shows "Number of Active Users Today"
  • Shows "Most users ever online on a day"
  • Shows last online time for each User while pointing the Mouse Cursor on it's name (=mouseover) in the list
Important: The Hack only works 100% correct, when each member is in the same time zone as the Server!

Files to edit: index.php
Templates to edit: forumhome
New Templates: forumhome_todayloggedinusers, forumhome_todayloggedinuser

I have attached the Install Instructions in a Text File.
The Instruction is in English and in German.

I will attach a Screenshot in a Reply to this Thread!

Post any Questions into this Thread!

Updates in 1.0.1: Inserted the two new templates into the template precaching (first step)

Updates in 1.0.2: Fixed a little Bug with the "Most users ever online on a day"-Count
(Replace '$maxusers[2] = $todayonline;' with '$maxusers[2] = $numbertodayonline;' in index.php)

Info: You can find an other version of this Hack here. In this other version the usernames of the members, who were already online today, are not shown on the Forum-Mainpage; the names are shown in an extra File (like online.php), onlinetoday.php (Screenshot).

So, depending on which version of the Hack you prefer, you have to download this:
Version with usernames on the main Site of the Forum

or this:
Version with usernames on extra site (onlinetoday.php)

Regards,
Mystics

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #332  
Old 03-12-2003, 04:29 AM
xcel xcel is offline
 
Join Date: Dec 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got this wierd thing that happened and i cant explain why it happened. Soooo I am turning to you.

I installed this hack with no problem. It worked for about 30 minutes and then I get nothing!


No users online, not even me.
No guests.........no nothing.

Help Please!!


I even attempted to check my work twice, everything turned out fine. I just dont understand i am using 2.3.0 the new one.
Reply With Quote
  #333  
Old 03-14-2003, 01:23 PM
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
Location: NY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyway to get the whos online to show up on my vbportal home page in a center box?

i get this

Parse error: parse error, unexpected $ in /home/weatherf/public_html/includes/center/php.php(21) : eval()'d code on line 1
Reply With Quote
  #334  
Old 03-14-2003, 04:21 PM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, i changed the query a bit. I was wondering why the TZ made a diff, and I said screw it, the server is in EST, that is what I will use. Not gonna make it so it is a day from where the person is located, doesn't relly make sense to me. Anyway, here is my new query.
PHP Code:
// first get the current date 
$startdate mktime(0,0,0,date("m"),date("d"),date("Y")); 
$enddate time(); 
  
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user 
                WHERE lastactivity BETWEEN 
$startdate AND $enddate 
                ORDER BY username"
); 
Reply With Quote
  #335  
Old 03-20-2003, 03:24 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am trying to solve the timezone problem. How about this approach:

PHP Code:
$enddate time();
$localdate $enddate-(($timeoffset-$bbuserinfo['timezoneoffset'])*3600);
$timepassed $localdate - ($localdate - ($localdate 86400));
$startdate $enddate $timepassed;
  
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user 
                WHERE lastactivity BETWEEN 
$startdate AND $enddate 
                ORDER BY username"
); 
The idea:
1) Get the local time adjusted for the TZ == $localdate
2) Calculate the time that has passed between now locally ($localdate) and midnight locally (($localdate - ($localdate % 86400)) == $timepassed
3) Subtract the time that has passed locally since midnight from the servers time now == $startdate
4) Query user activity in the time between server time now ($enddate) and the time when it was midnight locally.

I hope that I expressed myself somewhat clearly. I am an absolute PHP beginner, so I am not sure if what I did above is correct. However, the idea per se should be right.

Would be glad for comments and possible corrections.

Alexander
Reply With Quote
  #336  
Old 03-20-2003, 03:55 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, I changed the way to calculate local midnight in the snippet below. I think now everything is correct.

PHP Code:
$enddate time();
$localdate $enddate-(($timeoffset-$bbuserinfo['timezoneoffset'])*3600);
$date getdate($localdate);
$day   $date['mday'];
$month $date['mon'];
$year  $date['year'];
$midnight mktime(0,0,0,$month$day$year);
$timepassed $localdate $midnight;
$startdate $enddate $timepassed;
  
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user 
                WHERE lastactivity BETWEEN 
$startdate AND $enddate 
                ORDER BY username"
); 
With this code, 'Number of Active Users Today' should display the correct number of active users since local midnight of the current user logged in.

What is still not taken care of different TZs is the 'Most users ever online on a day' part. With the current implementation of the hack, I don't think this is possible. Why? --

Imagine that in the timezone of your user, until 23:59pm you had 100 visitors on your board. Further imagine that all these 100 visitors visited at 23:50pm (your time). Finally imagine that this is the greatest number of visitors your board has ever seen in one day. So for you, that is for your user and all other users in your timezone, 'Most users ever online on a day' is 100.

So far so good. Now imagine that at 00:10am your time 10 more users logged in. For you, 'Most users ever online on a day' should be still 100, namely from the day before. However, for another user whose timezone is e.g. -1, 'Most users ever online on a day' is now 110, since he still hasn't reached midnight (it is 23:10pm) for him. As a result, the variable holding the Most users contains 110 now. And that means also for you, who is already in the next day, 'Most users ever online on a day' is suddenly 110. You see the problem?!

Greets
Alexander
Reply With Quote
  #337  
Old 03-22-2003, 04:44 PM
Elmoe Elmoe is offline
 
Join Date: Nov 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very strange.. i applied this hack and it didnt display the new modifications at all
Reply With Quote
  #338  
Old 03-22-2003, 05:27 PM
Elmoe Elmoe is offline
 
Join Date: Nov 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok.. i just tried it on another forum and it worked fine. strange.
Reply With Quote
  #339  
Old 03-23-2003, 05:51 AM
laycomp laycomp is offline
 
Join Date: Mar 2003
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
01-11-02 at 02:06 PM Mystics said this in Post #1
Hack Name: Who was online today
Hack Version: 1.0.2
For vB Version:: 2.x

Version type: with usernames on the main Site of the Forum
I am using vb2.3

The hack does not seem to be calculating correct "MOST users ever online..." (I've attached an image capture).

In the top line that reads: "most users ever online was X..." this just keeps a total of how many online users at the moment.

In the bottom line that reads: "Most users ever online on a day was X..." this is just giving me a total for users connected that day.

Seems to me they're both doing similar jobs? first one is telling me how many online users there are, the second line is giving me a total connected users for the day, but none is giving "Most users every online"

Please can someone asssit in correcting this?
Reply With Quote
  #340  
Old 03-26-2003, 08:38 AM
magna magna is offline
 
Join Date: Aug 2002
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have read all 338 posts and cannot find how to make "Currently active users" only visable to admins. There was reference to it by someone.

Could someone please post how to do that. (make Currently Active users" only visable to admins) Thanks

Great hack by the way.
Reply With Quote
  #341  
Old 03-26-2003, 09:09 AM
alain4ever's Avatar
alain4ever alain4ever is offline
 
Join Date: Apr 2002
Location: U.A.E
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
03-12-03 at 10:29 AM xcel said this in Post #331
I got this wierd thing that happened and i cant explain why it happened. Soooo I am turning to you.

I installed this hack with no problem. It worked for about 30 minutes and then I get nothing!


No users online, not even me.
No guests.........no nothing.

Help Please!!


I even attempted to check my work twice, everything turned out fine. I just dont understand i am using 2.3.0 the new one.
i have same problem....
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05056 seconds
  • Memory Usage 2,341KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete