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...
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.
08-30-02 at 01:31 AM g-force2k2 said this in Post #71 aight... for all the ppl that feel cheated... here's a code i devised for ya...no the counter isn't buggy because it uses the joindate but here's a little code i whipped up for ppl like you that feel cheated regards...
open timeonline.php
find:
PHP Code:
$daysregs = floor((time() - $lead[2]) / 86400);
replace with:
PHP Code:
// Time Online Hack Addon (fair time per day?) g-force2k2
$fairtime = 1030505285;
if($joindate < $fairtime) {
$daysregs = floor((time() - $fairtime) /86400);
} else {
$daysregs = floor((time() - $lead[2]) / 86400);
}
// Time Online Hack Addon (fair time per day?) g-force2k2
should really change those values up for ya now regards...
g-force2k2
This nor the other $fairtime value work for me. The Online per day is still counted from the register date.
Any ideas? Thanks. Great Hack (if i can just get this working!!)
i have converted this hack to vB 3.0.0 but i will not release untill i have permission off g-force2k2 and vB.org i have added a few extras such as Total To Show where you can pick how many you want to display on the page. also i have added sort by were you can pick what you want to sort it by eg username, timeonline etc. i have also removed the old page navs and intergrated it with the new and proper perpage nav