Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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

Quote:
Originally posted by g-force2k2
Minifreunde :: Attach your timeonline.php here and i will debug for you regards...

Rock :: what lines did you put in the admin/functions.php ?

KarateKid :: Goldknight is correct... the install_timeonline.php is the txt file... regards...

Goldknight :: thanks for the help

g-force2k2

Mate, i added the lines u said in the install file ...
Here they are:
Code:
File Modification (5)
// +++++++++++++++++++++
open admin/functions.php (2)

find: (1)

		$post[joindate]=vbdate($registereddateformat,$post[joindate]);

below it add:

// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
		$post[onlinetime] = dotimeonline($post[timeonline]);
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++

find: (2) (the second appeareance)

?> 

above it add:

// +++++++ 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 ] +++++++

Did exactly what u said on the install file...
Reply With Quote
  #113  
Old 09-01-2002, 02:11 PM
Rock Rock is offline
 
Join Date: Nov 2001
Location: uk
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Goldknight


Did you add the new templates?
dUhhhh ...
Of course ...
Reply With Quote
  #114  
Old 09-01-2002, 03:27 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

right i got a test for you

g-force2k2

is there anyway of adding a bit to the user.php file in the Admin CP so you can find users by time online and also mass delete them and mass email them by there time spent online this would be great if you can
Reply With Quote
  #115  
Old 09-01-2002, 03:34 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

also i got it working Great hakc d00d
Reply With Quote
  #116  
Old 09-01-2002, 08:19 PM
suzemir suzemir is offline
 
Join Date: Jul 2002
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack - i love it

thanks
Reply With Quote
  #117  
Old 09-01-2002, 11:36 PM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't work. Here's what happens.

As soon as I edit admin/sessions.php from:

find: (1)

if ($session['styleid']!=0) {
$bbuserinfo['styleid'] = $session['styleid'];
}

to

// +++++++ Time Online Hack [ g-force2k2 ] +++++++
$inactivetime = 5; // Configure Time Out Time Here in Minutes!
$factivetime = $inactivetime * 60;
$newtime = time() - $bbuserinfo[lastactivity];
if($newtime < $factivetime) {
$DB_site->query("UPDATE user SET timeonline=timeonline+$newtime WHERE userid='$bbuserinfo[userid]'");
}
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++




I get this when my page loads:

There seems to have been a slight problem with the Groove-Salad database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

Database error in vBulletin 2.2.6:

Invalid SQL: UPDATE user SET timeonline=timeonline+2 WHERE userid='3'
mysql error: Unknown column 'timeonline' in 'field list'

mysql error number: 1054

Date: Sunday 01st of September 2002 05:31:31 PM
Script: http://groove-salad.com/forum/forum/
Referer:




I don't understand why it's saying the script is at http://groove-salad.com/forum/forum/

Any help would be greatly appreciated.
Reply With Quote
  #118  
Old 09-01-2002, 11:59 PM
Goldknight's Avatar
Goldknight Goldknight is offline
 
Join Date: Aug 2002
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Rock


dUhhhh ...
Of course ...
Ok, I m going to let g-force2l2 care of this one..

later


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

groovesalad did you run the queries first? regards...

g-force2k2
Reply With Quote
  #120  
Old 09-02-2002, 01:33 AM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please help

https://vborg.vbsupport.ru/showthrea...943#post293943
Reply With Quote
  #121  
Old 09-02-2002, 01:34 AM
groovesalad groovesalad is offline
 
Join Date: Aug 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gforce: sorry, new to this. How do I run a query?
Reply With Quote
Reply

Thread Tools

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:22 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.08152 seconds
  • Memory Usage 2,319KB
  • Queries Executed 27 (?)
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
  • (1)bbcode_code
  • (2)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
  • (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_postinfo_query
  • fetch_postinfo
  • 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