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
Total Time Online Hack v1.0 Details »»
Total Time Online Hack v1.0
Version: 1.00, by g-force2k2 g-force2k2 is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-27-2002 Last Update: Never Installs: 99
 
No support by the author.

[ Click Here ] to download the latest update!

Nifty Addon by TECK:

[View TECK's Modification]

Yeah my first hack for vb2.2.7 but then again its compatible with vb2.2.6 as well tested on both

What does this hack do? Just as the title states it calculates the total time online for each user

Configurable::
The time limit before a user is considered inactive is configurable and is included in the install txt file... so if you want a user to be defined as inactive after 3 minutes then there'll be a variable in the script to limit that configure that

Also Configurable is the amount of users to show per page on the leader time online board That is also configurable in the timeonline.php included with the zip...

Features ::
Includes both viewable on the postbit and getinfo templates...
Includes a leader board for the top users time online

What to do? ::
Queries to Run (1)
File Modification (5)
Template Modificatiion (2)
Templates to Add (3)
Files to Upload (1) :: [ timeonline.php ] (forum directory)

It's an easy hack to install (took me a little time to configure) but it looks great imo... probably a hack that will use and that i can see every forum having... why not right Enjoy yet another release... And if you like this hack i would be greatful if you could click install thanks...

Edit ::
Viewable Demo [ Here ]

Note ::
If for some odd reason you get a division by zero error

find:

PHP Code:
$daysreg floor((time() - $lead[2]) / 86400); 
          
$daysreg iif($daysreg == 0,'1','$daysreg'); // checking to see if not registered for more then a day to prevent division by zero
        
$dotimeperday floor($lead[3] / $daysreg); 
replace with:

PHP Code:
$daysregs floor((time() - $lead[2]) / 86400); 
          if(
$daysregs == 0) { // checking to see if not registered for more then a day to prevent division by zero
            
$daysreg 1;
          } else {
            
$daysreg $daysregs;
          }
        
$dotimeperday floor($lead[3] / $daysreg); 
g-force2k2

Show Your Support

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

Comments
  #32  
Old 08-28-2002, 09:50 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool hack g-force, I'll think about installing this later.
Reply With Quote
  #33  
Old 08-28-2002, 10:06 PM
bommelchen's Avatar
bommelchen bommelchen is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can i display the user with the most online time on Forumhome ?

The Hack is nice

THX Bommelchen
Reply With Quote
  #34  
Old 08-28-2002, 10:16 PM
PsYc PsYc is offline
 
Join Date: Mar 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack


works like a charm

good work, very good


[high]* PsYc clicks *install*[/high]
Reply With Quote
  #35  
Old 08-28-2002, 10:22 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by bommelchen
How can i display the user with the most online time on Forumhome ?

The Hack is nice

THX Bommelchen
open index.php (root folder)

find:

PHP Code:
// get total posts 
before it add:

PHP Code:
$tuser $DB_site->query_first("SELECT username,userid,timeonline FROM user ORDER BY timeonline DESC LIMIT 1");
$ttime dotime($tuser[timeonline]);
$bestonline "<b>User Most Online:</b> <a href='member.php?s=&action=getinfo&userid=$tuser[userid]>$tuser[username]</a> - $ttime"
then in the forumhome template where you want to appear place the variable ::

PHP Code:
$bestonline 
i think that should work haven't tested yet... but regards

g-force2k2
Reply With Quote
  #36  
Old 08-28-2002, 10:37 PM
bommelchen's Avatar
bommelchen bommelchen is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry this is not working ! i get a blank page.
Any idears ?

bommelchen
Reply With Quote
  #37  
Old 08-28-2002, 10:44 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$ttime dotime($tuser[timeonline]); 
Should be:

PHP Code:
$ttime dotimeonline($tuser[timeonline]); 
Reply With Quote
  #38  
Old 08-28-2002, 10:49 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks NTLDR i said i didn't test it didn't even remember my own function name thanks for backing me up as usual regards...

g-force2k2
Reply With Quote
  #39  
Old 08-28-2002, 10:54 PM
bommelchen's Avatar
bommelchen bommelchen is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Big thanks work perfect !!

bommelchen
Reply With Quote
  #40  
Old 08-29-2002, 01:14 AM
[D]Vincent's Avatar
[D]Vincent [D]Vincent is offline
 
Join Date: Jun 2002
Location: In my own little world?
Posts: 411
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, I will install it soon.
Reply With Quote
  #41  
Old 08-29-2002, 01:19 AM
Gohan's Avatar
Gohan Gohan is offline
 
Join Date: Nov 2001
Location: The Netherlands
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Hack, g-force2k2!

I'll install it tommorrow
Reply With Quote
  #42  
Old 08-29-2002, 02:31 AM
Souly Souly is offline
 
Join Date: Jul 2002
Location: Germany
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on a 2.2.5 Version without any Problems! Great Hack!

My Demoscreens:[GERMAN]

[1] ID-Card (ausgefahren)
-----------------------------------


[2] Profil-Card
-----------------------------------


[3] ?bersicht aller Zeiten
-----------------------------------



thx!
Reply With Quote
  #43  
Old 08-29-2002, 02:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I couldn't get it to work on the forumhome even with this change. It kept messing up my "Member of the Day" hack. Neither one would show right if I have them both going. Any other way to get it to show on forumhome?

And how is the Time online per day calculated?

And one last thing Sorry ). Is there a way I can get it to NOT show any users times that are all at zero until they are online?

Quote:
Originally posted by NTLDR
PHP Code:
$ttime dotime($tuser[timeonline]); 
Should be:

PHP Code:
$ttime dotimeonline($tuser[timeonline]); 
Reply With Quote
  #44  
Old 08-29-2002, 03:03 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo the code should work... if it doesn't just change some variables around and see what happens...

As for the time online per day calculated? the total time online divided by the days registered... maybe this hack should be included in vb3 so that the members who registered way before hand don't lose their time :P

As for selecting the users with no time... just change this query ::

PHP Code:
  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user"
); 
to this ::

PHP Code:
  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline != 0"
); 
regards... hope that helps somewhat

g-force2k2
Reply With Quote
  #45  
Old 08-29-2002, 03:11 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That didn't quite work. The list is smaller but I still have about 10 users who show up on the listing that have no time online. Also, the forumhome thing doesn't work no matter what I change around.

Is there a way, after we figure the list out, to not have the template show up in the profile if there is no time either?
Reply With Quote
  #46  
Old 08-29-2002, 03:22 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

open member.php

find:

PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
  eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 
replace with:

PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$userinfo[onlinetime] > 0) {
      eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    } else {
      
$getinfo_template "";
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 
regards... will look into forumhome issue for you now... can you give me the coding for FireFlys member of the day and the code you're using for mine? regards...

g-force2k2
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 08:35 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05351 seconds
  • Memory Usage 2,384KB
  • Queries Executed 30 (?)
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
  • (13)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
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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