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
  #152  
Old 09-04-2002, 09:34 AM
D. Hollingworth D. Hollingworth is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Minifreunde
Hello G-Force!!
First Thankx for this great Hack. But theres a Problem with it.
Everytime i try to use the "next" Link in the Navigation of the "timeonline" i get a blank page. When i use the reload-Button the site is there. After this it works for 2-3 Klicks and then i get a white page. The same if i use the backlink in the "Forum-Navigation"....
I promised i make all youre Instruction says and i don?t see any error in my installation. Ok, i get that "zero-error" and make youre fix from Post #2. It works, but the Nav-Problem is a Problem...
Please help!
Heh, and I thought it was just me. Yep, same thing is happening here. At random times, you click on something and it returns a blank page- refresh, and you can see the page again G-Force, have you had time to look into this yet? Although this hack has provided its share of challenges, (probably the most I?ve had to deal with yet), it?s still one of the best ones I?ve seen. Any solutions to this strange anomaly would be appreciated.

Great work!

Dave H
Reply With Quote
  #153  
Old 09-04-2002, 10:52 AM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i get that with VBB 2.2.4 i think its a HTML Timeout thats not supposed to be there
Reply With Quote
  #154  
Old 09-04-2002, 10:59 AM
D. Hollingworth D. Hollingworth is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I?m running 2.2.7. It?s weird. I checked the page source, and squat! No partial headers, no nothing. It?s almost like it?s not even retrieving the page from the db. It only happens every so often, and yes? It?s most likely to happen when you try to link from anything in the display list. It?s no emergency, but it would be nice to correct the error just the same

Dave H
Reply With Quote
  #155  
Old 09-04-2002, 11:08 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

okay D. Hollingworth i'll look further into the situation just have college and then i will do my part and do alittle research regards... glad that you like it...

g-force2k2
Reply With Quote
  #156  
Old 09-04-2002, 11:19 AM
D. Hollingworth D. Hollingworth is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks-o-many.

Incase it helps at all, I just tried to 'update counters' in the Admin Panel, and I got a blank page when I clicked “update.’ I guess it might not be limited to just the main forums.

Dave H
Reply With Quote
  #157  
Old 09-04-2002, 11:35 AM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok here is my design

In functions.php

Repalce

PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
// do time online function
  
function dotimeonline($timeonline) {

    
$days floor($timeonline 86400);
      if(
$days == 0) {
      
$ftime "";
    } elseif(
$days == 1) {
      
$ftime "$days Day, ";
     } else {
      
$ftime "$days Days, ";
    }
  
    
$tothours $days 86400;
    
$newhours $timeonline $tothours;
    
$hours floor($newhours 3600);
    
$ftime.= "$hours Hours, ";

    
$totmin = (($hours 3600) + ($days 86400));
    
$newmin $timeonline $totmin;
    
$minutes floor($newmin 60);
    
$ftime.= "$minutes Minutes, ";

    
$totsec = (($hours 3600) + ($minutes 60) + ($days 86400));
    
$seconds $timeonline $totsec;
    
$ftime.= "$seconds Seconds Online";

    return 
$ftime;

}
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

with


PHP Code:
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
// do time online function
  
function dotimeonline($timeonline) {

    if(
$days == 0) {
      
$ftime "";
    } elseif(
$days == 1) {
      
$ftime "$days Day, ";
     } else {
      
$ftime "$days Days, ";
    }

    
$totdays $days 86400;
    
$newdays $timeonline $tothours;
    
$days floor($newdays 86400);
    
$ftime.= "<b>$days</b> Days, ";  

    
$tothours $days 86400;
    
$newhours $timeonline $tothours;
    
$hours floor($newhours 3600);
    
$ftime.= "<b>$hours</b> Hrs, ";

    
$totmin = (($hours 3600) + ($days 86400));
    
$newmin $timeonline $totmin;
    
$minutes floor($newmin 60);
    
$ftime.= "<b>$minutes</b> Mins, ";

    return 
$ftime;

}
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

to get it to look like this with out having a day on it
Reply With Quote
  #158  
Old 09-04-2002, 11:39 AM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and to put it in your postbit template

under avatar.

Find

PHP Code:
$post[avatar]<p

and replace it with


PHP Code:
<br><br>
$post[avatar]<br><br><smallfont><a href='timeonline.php?s=$session[sessionhash]&action=view_leader'><b>Time Spent On This Board:</b></a><br$post[onlinetime] </smallfont><br><br
enjoy
Reply With Quote
  #159  
Old 09-04-2002, 12:18 PM
D. Hollingworth D. Hollingworth is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... I don't have
Quote:
$post[avatar]<p>
in my functions.php. I have all sorts of $post[avatar]=""; occurances instead. Maybe cause it's 2.27. This is getting stranger. My users in the "non-moderated" group are racking up the correct time. The users in the "moderated" section can be hanging around for 30-minutes or more, yet they remain at zero, or at 1-second.

Infact, the only user that 'was' displaying 1-second has now reverted back to 0.0.0. ): Oh well, at least my non-moderated members are displaying correctly

Dave H
Reply With Quote
  #160  
Old 09-04-2002, 12:21 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no d00d the Avatr but is in your postbit template sorry
Reply With Quote
  #161  
Old 09-04-2002, 12:25 PM
D. Hollingworth D. Hollingworth is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*Snicker*

Gotta stop these all nighters.

Thanks man.
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 02:07 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.05416 seconds
  • Memory Usage 2,354KB
  • 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
  • (6)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_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