vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Total Time Online Hack v1.0 (https://vborg.vbsupport.ru/showthread.php?t=42864)

g-force2k2 08-27-2002 10:00 PM

Total Time Online Hack v1.0
 
[ Click Here ] to download the latest update!

Nifty Addon by TECK: ;)

[View TECK's Modification]

Yeah my first hack for vb2.2.7 :p but then again its compatible with vb2.2.6 as well tested on both :)

What does this hack do? Just as the title states :p 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

g-force2k2 08-28-2002 05:05 PM

Screenshot A :: postbit template

g-force2k2

g-force2k2 08-28-2002 05:06 PM

Screenshot B :: Time Online Leader Board

FYI :: this screenshot now looks different :p instead of that one link i integrated a page nav system into it... regards...

g-force2k2

g-force2k2 08-28-2002 05:07 PM

Screenshot C :: getinfo template

Enjoy the hack :D

g-force2k2

ExcErr 08-28-2002 05:51 PM

nice hack, will install it today...
thx!

PS: plz add the # of posts column to the Leader time online....because it's more comfortable to see how many hours user was online and how many posts he posted...
if you will do it, plz post than the upgrade way from old v to new...
thx again

g-force2k2 08-28-2002 05:55 PM

thanks to WebmasterXT found a quick fix... sorry it was a last minute thing... but here's the fix...

find:

PHP Code:

if($newtime $inactivetime) { 

replace it with:

PHP Code:

if($newtime $factivetime) { 

im sorry for such the quick fix... but there shouldn't be anymore... it was a last minute change that i forget to update... my bad...

regards...

g-force2k2

g-force2k2 08-28-2002 05:58 PM

Updated Zip...

g-force2k2

NTLDR 08-28-2002 06:01 PM

I can't wait to install this one :D I've wanted it ever since someone suggested it ;)

irn-bru 08-28-2002 06:15 PM

thanx m8 nice hack ..

Just a few suggestions.

timeonline.php

[ Previous Page ]";
[ Next Page ]";
[ Last Page ]";

Change---

[ Previous Page ]</a>";
[ Next Page ]</a>";
[ Last Page ]</a>";

getinfo_timeonline---

Change the <normallfont> </normallfont> to <smallfont> </smallfont>

"my getinfo is all smallfont"

time---

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr><td width="50%">
<img src="https://vborg.vbsupport.ru/images/vb_bullet.gif" alt="" border="0" align="absmiddle"><normalfont><b>
<a href="index.php?s=$session[sessionhash]">$bbtitle</a> Total Time Online Hack © g-force2k2</b></normalfont></td></tr></table>

Change to---

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr><td width="100%">
<img src="https://vborg.vbsupport.ru/images/vb_bullet.gif" alt="$bbtitle" border="0" align="absmiddle"><normalfont><b>
<a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt Total Time Online © g-force2k2</b></normalfont></td></tr></table><p>

g-force2k2 08-28-2002 06:17 PM

Quote:

Originally posted by ExcErr
nice hack, will install it today...
thx!

PS: plz add the # of posts column to the Leader time online....because it's more comfortable to see how many hours user was online and how many posts he posted...
if you will do it, plz post than the upgrade way from old v to new...
thx again

:p hope thats good :) regards...

g-force2k2

Webmasta XT 08-28-2002 06:19 PM

hey i installed this hack Awesome hack man, keep up the good work

g-force2k2 08-28-2002 06:21 PM

Quote:

Originally posted by irn-bru
thanx m8 nice hack ..

Just a few suggestions.

timeonline.php

[ Previous Page ]";
[ Next Page ]";
[ Last Page ]";

Change---

[ Previous Page ]</a>";
[ Next Page ]</a>";
[ Last Page ]</a>";

Thanks for this update :p the other changes are a matter of preference... ;) zip updated :) regards...

g-force2k2

DrkFusion 08-28-2002 06:26 PM

Does this add a query for each user online?
I saw your demo, and there are 10 people online, and 10 queries, so I am guessing this is what it does, a forum which I admin at has hundreds of people online at ones, so...not sure, mind telling me?

Thanks, nice idea by the way

g-force2k2 08-28-2002 06:28 PM

no DrkFusion... it'll only run that query as many times that its fetched on the page... so the default is set to max 10 so it'll only ever hit 10 queries... regards...

g-force2k2

DrkFusion 08-28-2002 06:29 PM

Looks very nice man, good job.

Chris M 08-28-2002 06:51 PM

Very smooth:)

Satan

ExAvIoUr 08-28-2002 07:13 PM

worked perfectly.

NTLDR 08-28-2002 07:45 PM

Truely Amazing g-force2k2, this is on of the best hacks I have installed ;)

One v.minor error, in the time_leader template, this:

Code:

<a href="member.php?s=&session[sessionhash]&action=getinfo&userid=$userid">
Should be this ($ not &)

Code:

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">
Thank you for sharing this :D

g-force2k2 08-28-2002 07:47 PM

NTLDR :: thanks ;) will update shortly thanks for telling me about the error though :p every bit helps... regards...

g-force2k2

ULTIMATESSJ 08-28-2002 07:57 PM

Great, i've been waiting for a hack like this for ages, good work

/me clicks install

NTLDR 08-28-2002 08:11 PM

I have put the display of the time online in the postbit along with the number of posts etc, how easy would it be to just change this display H:M:S (Hours:Mins:Seconds) instead of 0 Hours, 0 Minutes, 0 Seconds Online?

Goldknight 08-28-2002 08:12 PM

Great job as you always do =D

/me install

Goldknight 08-28-2002 08:14 PM

Quote:

Originally posted by NTLDR
I have put the display of the time online in the postbit along with the number of posts etc, how easy would it be to just change this display H:M:S (Hours:Mins:Seconds) instead of 0 Hours, 0 Minutes, 0 Seconds Online?
I d like to have that one too

ExAvIoUr 08-28-2002 08:18 PM

me too if thats possible.

g-force2k2 08-28-2002 08:24 PM

its pretty simple guys ;) just open up the admin/functions.php and go down the the function that i created... just change Days to D... Hours to H... Minutes to M and Seconds to S :p its that simple and it'll change up for all three setups like that :) enjoy

err... edit nvm i see what you mean :p give me a minute and i'll create the setup for you :) regards...

g-force2k2

NTLDR 08-28-2002 08:31 PM

I thought it was that code but was't 100% ;)

I have copied the function and changed it to:

PHP Code:

// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
// do time online function
  
function doposttimeonline($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:";

    
$totmin = (($hours 3600) + ($days 86400));
    
$newmin $timeonline $totmin;
    
$minutes floor($newmin 60);
    
$ftime.= "$minutes:";

    
$totsec = (($hours 3600) + ($minutes 60) + ($days 86400));
    
$seconds $timeonline $totsec;
    
$ftime.= "$seconds";

    return 
$ftime;

}
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

And placed it under the other one and changed:

PHP Code:

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

To:

PHP Code:

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

So I get H:M:S (eg: 0:44:10) in the post bit and the full length version everywhere else.

Thanks again g-force2k2, if Hack of the month comes back this will be my nomination :D

g-force2k2 08-28-2002 08:37 PM

heh good job man :p here's a more modified code and it'll change it everywhere on the forum and i think you wanted it to look more like this anyway :p but you can just add this as a new function like you stated if you want that ;) regards...

g-force2k2

g-force2k2 08-28-2002 08:39 PM

Quote:

Originally posted by NTLDR
Thanks again g-force2k2, if Hack of the month comes back this will be my nomination :D
thanks ;) i owe you one :) regards...

g-force2k2

Goldknight 08-28-2002 08:40 PM

Thanks g-force2k2 :)

:banana:

NTLDR 08-28-2002 08:45 PM

Quote:

Originally posted by g-force2k2
thanks ;) i owe you one :)
No problem, this hack is the best I have seen in ages, I've allways wanted it since someone requested it ages ago, and you have done a superb job. Your one of the top hackers here g-force2k2 and a credit to vB.org :)

Velocd 08-28-2002 09:50 PM

Very cool hack g-force, I'll think about installing this later. ;)

bommelchen 08-28-2002 10:06 PM

How can i display the user with the most online time on Forumhome ?

The Hack is nice :)

THX Bommelchen

PsYc 08-28-2002 10:16 PM

great hack :)


works like a charm

good work, very good :D


[high]* PsYc clicks *install*[/high]

g-force2k2 08-28-2002 10:22 PM

Quote:

Originally posted by bommelchen
How can i display the user with the most online time on Forumhome ?

The Hack is nice :)

THX Bommelchen

open index.php (root folder)

find:

PHP Code:

// get total posts 

before it add:

PHP Code:

$tuser $DB_site->query_first("SELECT username,userid,timeonline FROM user ORDER BY timeonline DESC LIMIT 1");
$ttime dotime($tuser[timeonline]);
$bestonline "<b>User Most Online:</b> <a href='member.php?s=&action=getinfo&userid=$tuser[userid]>$tuser[username]</a> - $ttime"

then in the forumhome template where you want to appear place the variable ::

PHP Code:

$bestonline 

i think that should work ;) haven't tested yet... but regards :)

g-force2k2

bommelchen 08-28-2002 10:37 PM

Sorry this is not working ! i get a blank page.
Any idears ?

bommelchen

NTLDR 08-28-2002 10:44 PM

PHP Code:

$ttime dotime($tuser[timeonline]); 

Should be:

PHP Code:

$ttime dotimeonline($tuser[timeonline]); 

;)

g-force2k2 08-28-2002 10:49 PM

:p thanks NTLDR i said i didn't test it :p didn't even remember my own function name ;) thanks for backing me up as usual :) regards...

g-force2k2

bommelchen 08-28-2002 10:54 PM

Big thanks work perfect !!

bommelchen

[D]Vincent 08-29-2002 01:14 AM

Great hack, I will install it soon.

Gohan 08-29-2002 01:19 AM

Great Hack, g-force2k2!

I'll install it tommorrow :D


All times are GMT. The time now is 04:49 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.01577 seconds
  • Memory Usage 1,862KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (12)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete