The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Total Time Online Hack v1.0 Details »» | |||||||||||||||||||||||||
[ 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:
PHP Code:
Show Your Support
|
Comments |
#212
|
||||
|
||||
hmm g-force, i just realised that the hack it's adding a query everywhere, in all pages. i really dont like that because i'm trying to stay with an average of max 18queries on my forums.
and you should use in your sessions.php something like: Code:
$timeactive = time() - $bbuserinfo['lastactivity']; if ($bbuserinfo['userid'] != 0 and $timeactive < (5 * 60)) { $DB_site->query("UPDATE user SET timeactivity=timeactivity+$timeactive WHERE userid='$bbuserinfo[userid]'"); } UPDATE check below how to optimise the code and eliminate the extra query... wait for g-force to update his files... or do it yourself if your belt is strong enough. |
#213
|
|||
|
|||
NSeXcellent:
make sure that the link is this: PHP Code:
everything is included in the zip file, other changes are just custom ones nothing necessary Da GoTTi: did you include the $post[onlinetime] variable in the postbit? Neo: how would you do it? TECK: thanks for the addition i will add the link to the first post regards... g-force2k2 |
#214
|
||||
|
||||
ok, g-force i found a way to dont load any query at all. you can update your code if you want... is your hack and it's a great tool.
now let's optimise shall we? here it is what i did, step by step (keep in mind i used my own terms, change them to yours): run this query: [sql]ALTER TABLE user ADD timeactivity int(10) unsigned DEFAULT '0' NOT NULL AFTER posts[/sql] in /admin/functions.php find: Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); // activity time $post[activity] = floor($post[timeactivity] / 3600); if ($post[activity] <> 1) { $pluralhour = 's'; } else { $pluralhour = ''; } Code:
if ($ourtimenow - $bbuserinfo['lastactivity'] > $cookietimeout) { if (!isset($bypass)) { if ($noshutdownfunc) { $DB_site->query("UPDATE user SET lastvisit=lastactivity,lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"); } else { $shutdownqueries[99]="UPDATE user SET lastvisit=lastactivity,lastactivity=$ourtimenow".iif($showforumusers,",inforum='0'","")." WHERE userid='$bbuserinfo[userid]'"; } } $bbuserinfo['lastvisit'] = $bbuserinfo['lastactivity']; } else { if (!isset($bypass)) { if ($noshutdownfunc) { $DB_site->query("UPDATE user SET lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"); } else { $shutdownqueries[99]="UPDATE user SET lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"; // This update will be done in the doshutdownfunction automatically, but the old method was doing screwy things!! } } $bbuserinfo['lastvisit'] = $bbuserinfo['lastvisit']; } Code:
$timeactive = time() - $bbuserinfo['lastactivity']; if ($ourtimenow - $bbuserinfo['lastactivity'] > $cookietimeout) { if (!isset($bypass)) { if ($noshutdownfunc) { $DB_site->query("UPDATE user SET ".iif($bbuserinfo['userid']!=0 and $timeactive<(1*60),"timeactivity=timeactivity+$timeactive,","")."lastvisit=lastactivity,lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"); } else { $shutdownqueries[99]="UPDATE user SET ".iif($bbuserinfo['userid']!=0 and $timeactive<(1*60),"timeactivity=timeactivity+$timeactive,","")."lastvisit=lastactivity,lastactivity=$ourtimenow".iif($showforumusers,",inforum='0'","")." WHERE userid='$bbuserinfo[userid]'"; } } $bbuserinfo['lastvisit'] = $bbuserinfo['lastactivity']; } else { if (!isset($bypass)) { if ($noshutdownfunc) { $DB_site->query("UPDATE user SET ".iif($bbuserinfo['userid']!=0 and $timeactive<(1*60),"timeactivity=timeactivity+$timeactive,","")."lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"); } else { $shutdownqueries[99]="UPDATE user SET ".iif($bbuserinfo['userid']!=0 and $timeactive<(1*60),"timeactivity=timeactivity+$timeactive,","")."lastactivity=$ourtimenow".iif($showforumusers,",inforum='0' ","")." WHERE userid='$bbuserinfo[userid]'"; // This update will be done in the doshutdownfunction automatically, but the old method was doing screwy things!! } } $bbuserinfo['lastvisit'] = $bbuserinfo['lastvisit']; } Code:
Activity Online: <font color="#E4630A">$post[activity]</font> hour$pluralhour as i said before, i did it this way because all i wanted to have is the time in postbit. the results? a screenshot is here... go ahead and update your cool hack now. thanks for letting me aport a small contribution to it. cheers. floren. |
#215
|
||||
|
||||
Great great HACK ! :classic:
Thank YOU very much man ! I use it on a (mutilated ) 2.2.2 board and works PERFECT ! Have A Cool Day ! |
#216
|
||||
|
||||
TECK > your modification is NOT working for me :glasses:
Give me MySQL error PS: esti cumva Roman ? |
#217
|
||||
|
||||
monitox, it doesnt work because the params and variables are not identical. this is a custom install for my forum, not the original hack. just wait for g-force to customize it, because you add an extra query on the process with his current hack...
and yes i'm romanian.. you can tell by the name. |
#218
|
|||
|
|||
g-force =
Yes the code is in the postbit, here is what I got in there: <p align="right"><smallfont><a href="javascriptpeneditsigwindow(490,320,'$session[sessionhash]','$post[userid]')">Edit Sig</a> | <a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged] | <a href='timeonline.php?s=$session[sessionhash]&action=view_leader'>Time Online:</a>$post[onlinetime]</smallfont></p> anything wrong? |
#219
|
|||
|
|||
Da_GoTTi: did you make the admin/functions.php file edit? regards...
g-force2k2 |
#220
|
|||
|
|||
Quote:
|
#221
|
|||
|
|||
yes the modification is on the functions....
all of it is in correctly, i dunno what is causing it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|