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
  #262  
Old 02-12-2003, 01:19 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Love the idea of the hack but i dont want it to display the amount of time online anywhere except when i rollover a users name in the whos online box on the main forum page or on the whosonline page. How would i go about doing this? Thanks.
Reply With Quote
  #263  
Old 02-23-2003, 05:47 AM
Silenced Soul's Avatar
Silenced Soul Silenced Soul is offline
 
Join Date: Apr 2002
Location: holdin' it down for tha 303
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

S1R1US, make a file called:
totalquery.php and put the following code in it:
PHP Code:
<?php
error_reporting
(7);
require(
"./global.php");

cpheader("<title>Run a Query</title>");

$totalquery "ALTER TABLE user ADD timeonline int(10) NOT NULL DEFAULT '0'";
$DB_site->query($totalquery);

echo 
"Query successful.<br>";
echo 
"<font face='Courier New' size='1'>$totalquery</font><br><br>";
echo 
"Do not forget to delete this file...";

cpfooter();
?>
Upload it to your admincp, run the file, and then delete it. This will run the query directly through the admin cp, therefore bypassing any need for phpMyadmin or any other query running program, although, I highly recommend getting phpMyadmin or one of the several Query DB hacks floating around.
Reply With Quote
  #264  
Old 03-13-2003, 06:17 AM
LangTuDaTinh LangTuDaTinh is offline
 
Join Date: Dec 2001
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by N9ne
How could I make it so if you're in usergroupid=X and you are invisible, the time is not added on?
have not do this yet but i added an option in usercp edit option where user can choose whether to display their total time online or not


the default is on but if they select no, total time online will be disappear in all (include in their profile(or getinfo), time learder, and their posts) and only usergroupid ==6 can view all user's timeonline even if they disable it in their usercp.

even if they disable timeonline in their usercp, their time still adding.
Reply With Quote
  #265  
Old 03-16-2003, 12:20 PM
pattox pattox is offline
 
Join Date: Jan 2003
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What if I dont want to show the days? How would I need to modify the code? I just want it to continue counting the hours. and if possible to stop counting seconds when it reaches 24 hours.
Reply With Quote
  #266  
Old 04-13-2003, 05:27 PM
Airs's Avatar
Airs Airs is offline
 
Join Date: Oct 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi i was installing the hack and all and got this error

Error
SQL-query : [Edit]

ALTER TABLE user ADD timeonline int
(10) NOT NULL DEFAULT \'0\'

MySQL said:

You have an error in your SQL syntax near '\'0\'' at line 2

in phpmyadmin can anyone please help? and great hack!.
Reply With Quote
  #267  
Old 04-13-2003, 06:12 PM
Craigr's Avatar
Craigr Craigr is offline
 
Join Date: May 2002
Location: Ayr, Scotland
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
08-30-02 at 01:12 AM Souly said this in Post #69
I have do the follow to calculate a correct "Time Online Per Day".

First you need the Timestamp (LINUX) before you start to install my changes! ! !

in timeonline.php find:
PHP Code:
        $daysregs floor((time() - $lead[2]) / 86400); 
change it to: [installtimestamp=yourtimestampyou must change it manually]
PHP Code:
          $daysregs floor((time() - installtimestamp) / 86400); 
I have Start the Tool now, an now is Linuxtime=1030666140 - also my Code is
PHP Code:
          $daysregs floor((time() - 1030666140) / 86400); 
And don?t look on my bad english - first learn german :lick:
Thanks, this works well on my forum. The 'time online per day' was starting from when my forum first opened so the values were very low, but this sorted it out.

Thanks
Craig
Reply With Quote
  #268  
Old 04-22-2003, 02:14 AM
kdog316's Avatar
kdog316 kdog316 is offline
 
Join Date: Apr 2003
Location: AZ
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when i try to go to my profile i get this erorr

Database error in vBulletin 2.3.0:

Invalid SQL: SELECT * FROM storeextra WHERE action='midi' AND userid='1'
mysql error: Table 'kdog316_vb.storeextra' doesn't exist

mysql error number: 1146

Date: Monday 21st of April 2003 07:12:03 PM
Script: http://www.allaroundsite.com/forums/...tinfo&userid=1
Referer: http://www.allaroundsite.com/forums/
Reply With Quote
  #269  
Old 04-27-2003, 06:05 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack g-force2k2. Worked great running 2.2.6 with the zero.php instructions to fix the divide by zero problem.

/me clicks install.
Reply With Quote
  #270  
Old 04-27-2003, 06:09 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure but it doesn't look like this hack caused that particular problem. I remember there was a hack that allowed you to play a midi file in your profile. It looks like, from the SQL statement, that this table is missing.

Perhaps you were installing this hack at the same time or didn't include the query from that hack and have never been to the profile since its installation?


Quote:
04-22-03 at 04:14 AM kdog316 said this in Post #267
when i try to go to my profile i get this erorr

Database error in vBulletin 2.3.0:

Invalid SQL: SELECT * FROM storeextra WHERE action='midi' AND userid='1'
mysql error: Table 'kdog316_vb.storeextra' doesn't exist

mysql error number: 1146

Date: Monday 21st of April 2003 07:12:03 PM
Script: http://www.allaroundsite.com/forums/...tinfo&userid=1
Referer: http://www.allaroundsite.com/forums/
Reply With Quote
  #271  
Old 04-27-2003, 11:07 PM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I realy dont want to install this hack for 2 reasons....

1) I dont want my members to suddenly leave the site if they realise they have been there for some time.
2) My wife will fill me cos she will know exactly how much time is spend working on the site

Might install at a later date
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 11:36 PM.


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.08186 seconds
  • Memory Usage 2,339KB
  • 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
  • (3)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