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.
you can run it through either phpmyadmin (if you know what that is) or you could simply find the runaquery hack by Firefly just search his profile... or i can just make you a auto installer that'll automatically run the queries for you... your call regards...
Nice hack g-force2k2, love your forum design BTW. This hack could get pretty server intensive for heavy traffic forums however since it updates the user table at each page load.
You could move the user table update query into the updateuserforum function and get online time tracking done without any extra queries what so ever. It will lose a bit of it's 'real time' feel but not a bad compromise for a busy site.
If not that, moving up the code a few lines in sessions.php will at least exclude the non registered or non logged in users from generating the extra query on each page load.
great hack. i will install this one for sure.
now a question. i want it to display the top20 onliners. should i look into this mod? or can you write this up? thanks g-force.
hmm i noticed this on your first post:
"Please respect my hack and don't make any alterations unless permission is granted by me... thanks for respecting my hacks..."
what do you mean by this? well if i install your hack, rest assured i will modify it the way it suit best for my board.
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...