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
  #132  
Old 09-02-2002, 12:08 PM
Rock Rock is offline
 
Join Date: Nov 2001
Location: uk
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Help plz ?
Reply With Quote
  #133  
Old 09-02-2002, 01:11 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by g-force2k2
Nakkid(TECK) i don't mean template changes and looks... feel free to make it look they way you'd like... as for the top20 there's an option to configure for the amount per page you want to view... regards...

Edit:: there besides i just granted you permission to edit what you'd like enjoy... And just so you know it does come with a page navigation feature hope all that helps somewhat...

g-force2k2
thanks.
you got me scared with the permission thing...
Reply With Quote
  #134  
Old 09-02-2002, 01:35 PM
Kmaster Kmaster is offline
 
Join Date: Mar 2002
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hacks~~thanks a lot

g-force2k2
is that possible hide admin online time to another group? keep admin info. secret~~
Reply With Quote
  #135  
Old 09-02-2002, 03:33 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kmaster for the postbit try this ::

open admin/functions.php

find:

PHP Code:
$post[onlinetime] = dotimeonline($post[timeonline]); 
replace it with:

PHP Code:
if($post[usergroupid] == 6) {
  
$post[onlinetime] = "";
} else {
  
$post[onlinetime] = dotimeonline($post[timeonline]);

open member.php

find:

PHP Code:
  eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";"); 
replace it with:

PHP Code:
  if($userinfo[usergroupid] == 6) {
    
$getinfo_timeonline "";
  } else {
    eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
  } 
finally

open timeonline.php

find:

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

PHP Code:
if($bbuserinfo[usergroupid] != 6) {
  
$totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE usergroupid != 6"
);
} else {
  
$totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user"
);

then find:

PHP Code:
    $leadtime $DB_site->query("
        SELECT userid, username, joindate, timeonline 
        FROM user 
       ORDER by timeonline DESC LIMIT 
$startat,$perpage"); 
replace with:

PHP Code:
      if($bbuserinfo[usergroupid] != 6) {
    
$leadtime $DB_site->query("
        SELECT userid, username, joindate, timeonline 
        FROM user 
        WHERE usergroupid != 6
        ORDER by timeonline DESC LIMIT 
$startat,$perpage");
              } else {
    
$leadtime $DB_site->query("
        SELECT userid, username, joindate, timeonline 
        FROM user 
        ORDER by timeonline DESC LIMIT 
$startat,$perpage");
               } 
Haven't tested it yet Kmaster.... but give it a shot regards...

g-force2k2
Reply With Quote
  #136  
Old 09-02-2002, 03:56 PM
eXtremeTim eXtremeTim is offline
 
Join Date: Jun 2002
Location: eXtremewebtech.com
Posts: 1,201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yet another good hack. I will install this one soon.
Reply With Quote
  #137  
Old 09-02-2002, 04:44 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

g-force2k2, do these 2 pieces of code look right to you? They work the way they are but I'm not sure if they will interfere with anything else. This also includes the code you gave me to NOT display users with zero time in the list. I would also like to be able to NOT display the Total Online Time in the posts for users who have zero time or Admins. Any way to do that?

Code:
 if($bbuserinfo[usergroupid] != 6) {
  $totalusers = $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE usergroupid != 6 AND timeonline > 0");
    } else {
    $totalusers = $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline > 0");
    }
And:

Code:
if($bbuserinfo[usergroupid] != 6) {
    $leadtime = $DB_site->query("
        SELECT userid, username, joindate, timeonline, posts 
        FROM user 
        WHERE timeonline > 0
        ORDER by timeonline DESC LIMIT $startat,$perpage");
              } else {
    $leadtime = $DB_site->query("
        SELECT userid, username, joindate, timeonline, posts 
        FROM user
        WHERE usergroupid != 6 AND timeonline > 0
        ORDER by timeonline DESC LIMIT $startat,$perpage");
               }
Reply With Quote
  #138  
Old 09-02-2002, 04:52 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks right to me Boofo...

open admin/functions.php

find:

PHP Code:
$post[onlinetime] = dotimeonline($post[timeonline]); 
replace it with:

PHP Code:
if($post[usergroupid] == OR $post[timeonline] == 0) {
  
$post[onlinetime] = "";
} else {
  
$post[onlinetime] = dotimeonline($post[timeonline]);

open member.php

find:

PHP Code:
  eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";"); 
replace it with:

PHP Code:
  if($userinfo[usergroupid] == OR $userinfo[timeonline] == 0) {
    
$getinfo_timeonline "";
  } else {
    eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
  } 

That should do the trick Boofo... but a quick thing about user time online being zero... this actually should not take effect anymore... because all new registers will have a timeonline from the point that you installled... only reason some users hack a timeonline that is zero is because the fact that you installed it after your forum has been up for quite some time this really has nothing to do with this addition just explaining why users shouldn't havea timeonline of zero anymore... regards...

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

Thanks for the help, g-force2k2. The only reason I want it to not show zero time online users is because I have a few members that haven't been on for a while and probably won't be again and it just looks a little cleaner this way. One last thing. I need to make it so the Total Time Online link doesn't show up in the posts where there is no time after it (for like Admins and zero time-users). Can you help me with that final thing, sir?

Also, does this code look right to you? This is from the member.php. It doesn't need that last else statement does it?

Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  $userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if($userinfo[usergroupid] == 6 OR $userinfo[timeonline] == 0) {
    $getinfo_timeonline = "";
    } else {
    eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    }
    }
    } else {
    $getinfo_template = "";
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
Reply With Quote
  #140  
Old 09-02-2002, 05:29 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change this:

PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$userinfo[usergroupid] == OR $userinfo[timeonline] == 0) {
    
$getinfo_timeonline "";
    } else {
    eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    }
    }
    } else {
    
$getinfo_template "";
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 
to this:

PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$userinfo[usergroupid] == OR $userinfo[timeonline] == 0) {
      
$getinfo_timeonline "";
    } else {
      eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 
As for the postbit idea... just make a new template called

postbit_timeonline

in it place the coding that was inserted into the postbit template

open showthread.php

and add the postbit_timeonline to the $templatesused

then in admin/functions.php

find:

PHP Code:
$post[onlinetime] = dotimeonline($post[timeonline]); 
replace it with:

PHP Code:
  $post[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$post[usergroupid] == OR $post[timeonline] == 0) {
      
$postbit_timeonline "";
    } else {
      eval(
"\$postbit_timeonline = \"".gettemplate('postbit_timeonline')."\";");
    } 
then back in the postbit template but the $postbit_timeonline in the position of the inserted code you removed to put in the postbit_timeonline template... regards...

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

Thank you. I should be able to use $postbit_timeonline for the private messages too, right? If so, I am all set now. Thanks again.
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 03:56 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.07358 seconds
  • Memory Usage 2,377KB
  • 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
  • (3)bbcode_code
  • (18)bbcode_php
  • (1)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_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