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
  #42  
Old 01-13-2002, 05:40 AM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i double checked and the

Active users today figure is resetting itself based on my server time ?

it's 5 pm where I am and it was reset to zero just now.. i checked and my server time is 12 am....

probably no way to fix that since every member would then see a different figure from different time zones ?

or can you define in the script the reset time or allow vB admins to define that time ?

i.e. based on the vB admin's GMT offset time..
Reply With Quote
  #43  
Old 01-13-2002, 09:11 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Eva is absolutely right, the same thing happens to me, so I figure it must be set to the server's time.
Reply With Quote
  #44  
Old 01-13-2002, 01:39 PM
genial's Avatar
genial genial is offline
 
Join Date: Nov 2001
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by eva2000
Active users today figure is resetting itself based on my server time ?
yes so it is. the active users today figure will be reseted on 0:00 am servertime.

our server is in the same timezone as the members and so that was not importend for me and i didn't consider that.

i will see to fix it, so that showing to the members the active today figure according to there members-timezone and the todayrecord to the selected timezone in the vbb-options.
Reply With Quote
  #45  
Old 01-13-2002, 01:56 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, I love the concept.

One thing, you might want to consider indexing the lastactivity column in the user table, otherwise the query scans a HUGE table (several thousands sometimes! )
Reply With Quote
  #46  
Old 01-13-2002, 02:14 PM
genial's Avatar
genial genial is offline
 
Join Date: Nov 2001
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
One thing, you might want to consider indexing the lastactivity column in the user table, otherwise the query scans a HUGE table
it's a good idea.

i will consider this in the next release of this hack, because the next release needs changes in the database for count guests.
Reply With Quote
  #47  
Old 01-13-2002, 02:39 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just installed this here btw, works great.
Reply With Quote
  #48  
Old 01-13-2002, 03:22 PM
genial's Avatar
genial genial is offline
 
Join Date: Nov 2001
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@all with the timezoneproblem of this hack:

i am not sure if this changes fix the problem, because our server is in the same timezone as the members and so i can't test it.

please test the changes for me.

find:
PHP Code:
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user 
                WHERE lastactivity > " 
mktime(0,0,0,date("m"),date("d"),date("Y")) . 
                ORDER BY username"
); 
and replace with:
PHP Code:
$unixtoday mktime(0,0,0,date("m"),date("d"),date("Y"));
$unixtoday $timeoffset 3600 $unixtoday;
$numbertodayonlinerecord $DB_site->query("SELECT COUNT(*) AS count FROM user 
                                  WHERE lastactivity > " 
$unixtoday 
                                  ORDER BY username"
);
$numbertodayonlinerecord $numbertodayonlinerecord[count];
$unixtoday $bbuserinfo[timeoffset] * 3600 $unixtoday;
$todayusers=$DB_site->query("SELECT userid,username,usergroupid,lastactivity,invisible,lastpost FROM user 
                                  WHERE lastactivity > " 
$unixtoday 
                                  ORDER BY username"
); 
and find:
PHP Code:
if ((int)$maxusers[2] <= $numbertodayonline) {
    
$time time();
    
$maxloggedin $maxusers[0] . " " $maxusers[1] . $numbertodayonline " $time;
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[2] = $numbertodayonline;
    
$maxusers[3] = $time;

replace with:
PHP Code:
if ((int)$maxusers[2] <= $numbertodayonlinerecord) {
    
$time time();
    
$maxloggedin $maxusers[0] . " " $maxusers[1] . $numbertodayonlinerecord " $time;
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[2] = $numbertodayonlinerecord;
    
$maxusers[3] = $time;
  } 
Reply With Quote
  #49  
Old 01-13-2002, 04:00 PM
genial's Avatar
genial genial is offline
 
Join Date: Nov 2001
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font size="3">important: please notice</font>

the fix for the timezone problem has changed at this moment, please check your code if you have this fix installed before.
Reply With Quote
  #50  
Old 01-13-2002, 04:21 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this only count members or can it count guests too?
Reply With Quote
  #51  
Old 01-13-2002, 04:29 PM
TELEK's Avatar
TELEK TELEK is offline
 
Join Date: Jan 2002
Location: Lancaster, CA
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I did everything in the instructions, and nothing happened. I did the one on the seperate page. Anyways, nothing changed on the main page, and if I go to onlinetoday.php, it is just a blank white page.
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:28 PM.


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.04925 seconds
  • Memory Usage 2,337KB
  • Queries Executed 25 (?)
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
  • (4)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
  • (1)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_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