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)

Souly 08-29-2002 02:31 AM

Installed on a 2.2.5 Version without any Problems! Great Hack!

My Demoscreens:[GERMAN]

[1] ID-Card (ausgefahren)
-----------------------------------
http://www.clanforen.de/clanforen/im...imeonline1.gif

[2] Profil-Card
-----------------------------------
http://www.clanforen.de/clanforen/im...imeonline2.gif

[3] ?bersicht aller Zeiten
-----------------------------------
http://www.clanforen.de/clanforen/im...imeonline3.gif


thx!

Boofo 08-29-2002 02:54 AM

I couldn't get it to work on the forumhome even with this change. It kept messing up my "Member of the Day" hack. Neither one would show right if I have them both going. Any other way to get it to show on forumhome?

And how is the Time online per day calculated?

And one last thing Sorry :)). Is there a way I can get it to NOT show any users times that are all at zero until they are online?

Quote:

Originally posted by NTLDR
PHP Code:

$ttime dotime($tuser[timeonline]); 

Should be:

PHP Code:

$ttime dotimeonline($tuser[timeonline]); 

;)


g-force2k2 08-29-2002 03:03 AM

Boofo the code should work... if it doesn't just change some variables around and see what happens...

As for the time online per day calculated? the total time online divided by the days registered... :p maybe this hack should be included in vb3 so that the members who registered way before hand don't lose their time :P

As for selecting the users with no time... just change this query ::

PHP Code:

  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user"
); 

to this ::

PHP Code:

  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline != 0"
); 

regards... hope that helps somewhat :)

g-force2k2

Boofo 08-29-2002 03:11 AM

That didn't quite work. The list is smaller but I still have about 10 users who show up on the listing that have no time online. Also, the forumhome thing doesn't work no matter what I change around.

Is there a way, after we figure the list out, to not have the template show up in the profile if there is no time either?

g-force2k2 08-29-2002 03:22 AM

open member.php

find:

PHP Code:

// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
  eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

replace with:

PHP Code:

// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$userinfo[onlinetime] > 0) {
      eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    } else {
      
$getinfo_template "";
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

regards... will look into forumhome issue for you now... can you give me the coding for FireFlys member of the day and the code you're using for mine? regards...

g-force2k2

Boofo 08-29-2002 03:29 AM

LOL Now it doesn't show up at all in the getinfo template, even when there is some time. Do we need to check for zeros on all of it or something?

You know me, g-force2k2, it never ceases to go quite right in the beginning. :)

g-force2k2 08-29-2002 03:36 AM

nah actually Boofo that was my bad... in the member.php replace the code i just gave you with this code:

PHP Code:

// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++
  
$userinfo[onlinetime] = dotimeonline($userinfo[timeonline]);
    if(
$userinfo[timeonline] > 0) {
      eval(
"\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";");
    } else {
      
$getinfo_template "";
    }
// +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ 

that should fix that problem :)

now open index.php

find:

PHP Code:

// get total posts 

above that add:

PHP Code:

// +++++++ Total Time Online Hack v1.0 [ g-force2k2 ] +++++++
$topuseronline $DB_site->query_first('
  SELECT userid, username, timeonline 
  FROM user
  ORDER BY timeonline
  DESC LIMIT 1'
);
$totaltimeonline dotimeonline($topuseronline[timeonline]);
$ftopuseronline "<b>Top User Online:</b> <a href='member.php?s=$session[sessionhash]&action=getinfo&userid=$topuseronline[userid]'>$topuseronline[username]</a> : $totaltimeonline";
// +++++++ Total Time Online Hack v1.0 [ g-force2k2 ] +++++++ 

open forumhome template:

place where you want to show :

PHP Code:

$ftopuseronline 

regards :)

g-force2k2

Boofo 08-29-2002 03:43 AM

Firefly's Code:

Code:

+-------------------------------------------------------------------------------------------------+
| Member of the day                                                                              |
+-------------------------------------------------------------------------------------------------+
| A hack by Chen 'FireFly' Avinadav (chen.avinadav@vbulletin.com)                                |
+-------------------------------------------------------------------------------------------------+

                                                +
                                                +++
                                                +

+-------------------------------------------------------------------------------------------------+
| In index.php, replace this code:                                                                |
+-------------------------------------------------------------------------------------------------+
$permissions=getpermissions();
if (!$permissions['canview']) {
    show_nopermission();
}
+-------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------+
| With this code:                                                                                |
+-------------------------------------------------------------------------------------------------+
$permissions=getpermissions();
if (!$permissions['canview']) {
    show_nopermission();
}

// start member of the day stuff
$thisdate=date('Y-m-d');
$getdaytemplate=$DB_site->query_first("SELECT template
                                        FROM template
                                        WHERE title='memberoftheday'
                                          AND templatesetid=-2");
$daytemplate=$getdaytemplate['template'];
$daybits=explode('||vb||',$daytemplate);
if ($daybits[0]!=$thisdate or ($resetmember==1 and $bbuserinfo['usergroupid']==6)) {
/* This template is either outdated or the admin wants to reset it.
  Either way, we need to choose a new member of the day. Aren't you excited?! */
    $newmember=$DB_site->query_first("SELECT userid,username
                                        FROM user
                                      WHERE userid<>$daybits[1]
                                        AND (usergroupid=5
                                          OR usergroupid=6
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                      ORDER BY RAND()
                                      LIMIT 1");
    $newtemplate=$thisdate.'||vb||'.$newmember['userid'].'||vb||'.$newmember['username'];
    $DB_site->query("UPDATE template
                        SET template='".addslashes($newtemplate)."'
                      WHERE templatesetid=-2
                        AND title='memberoftheday'");
    $memberoftheday['userid']=$newmember['userid'];
    $memberoftheday['username']=$newmember['username'];
} else {
    $memberoftheday['userid']=$daybits[1];
    $memberoftheday['username']=$daybits[2];
}
// end of member of the day stuff
+-------------------------------------------------------------------------------------------------+

                                                +
                                                +++
                                                +

+-------------------------------------------------------------------------------------------------+
| In the "forumhome" template, replace this code:                                                |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername</a>
+-------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------+
| With this code:                                                                                |
+-------------------------------------------------------------------------------------------------+
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername</a><br>
The $bbtitle member of the day is <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$memberoftheday[userid]">$memberoftheday[username]</a>
+-------------------------------------------------------------------------------------------------+

                                                +
                                                +++
                                                +

+-------------------------------------------------------------------------------------------------+
| Run this query:                                                                                |
+-------------------------------------------------------------------------------------------------+
INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,-2,'memberoftheday','0||vb||0||vb||0');
+-------------------------------------------------------------------------------------------------+

The code in this thread for the forumhome:

Code:

// get total posts


before it add:


$tuser = $DB_site->query_first("SELECT username,userid,timeonline FROM user ORDER BY timeonline DESC LIMIT 1");
$ttime = dotimeonline($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 ::


$bestonline


g-force2k2 08-29-2002 03:52 AM

okay thanks Boofo i don't see how the codes contrast... but i will install this on a my forum to see what i can observe for you regards... i posted some other coding above if you want to test that..

g-force2k2

Boofo 08-29-2002 04:15 AM

No need to test it on your end. Both fixes work perfectly. Thank you very much, sir. :)

We lucked out on this one. We usually have to go through alot more to fix it to work with my board. That must mean you are getting better and better all the time, huh? :) Can't beat experience. ;) Keep up the great work, there, g. :)

Now, all we have to do is get it not to show any members in the listing with the times at zero and we are all set. :)

g-force2k2 08-29-2002 04:18 AM

Boofo try using this query then? ::

PHP Code:

  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline > 0"
); 

regards... hope that fixes the final issue :) btw i think you're getting better then me Boofo ;)

g-force2k2

Boofo 08-29-2002 04:27 AM

Sorry, that didn't change anything. :(

I'm not anywhere near as good as you on this stuff. I just seem to find more bugs with my setup than anyone else. I figure, if you can fix it to work with my site, then it will work with anyone's site. At least, that's the way it seems most of the time. :)

Quote:

Originally posted by g-force2k2
Boofo try using this query then? ::

PHP Code:

  $totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline > 0"
); 

regards... hope that fixes the final issue :) btw i think you're getting better then me Boofo ;)

g-force2k2


g-force2k2 08-29-2002 04:35 AM

Boofo

open timeonline.php

find:

PHP Code:

    $leadtime $DB_site->query("
        SELECT userid, username, joindate, timeonline 
        FROM user 
        WHERE userid!=0 
        ORDER by timeonline DESC LIMIT 
$startat,$perpage"); 

replace with:

PHP Code:

    $leadtime $DB_site->query("
        SELECT userid, username, joindate, timeonline 
        FROM user 
        WHERE userid!=0 AND timeonline > 0
        ORDER by timeonline DESC LIMIT 
$startat,$perpage"); 

regards :) maybe that'll work now :P

g-force2k2

Boofo 08-29-2002 05:01 AM

You're good! that fixed it. :)

What should this be at now?

PHP Code:

$totalusers $DB_site->query_first("
    SELECT COUNT(*) AS users
    FROM user
    WHERE timeonline > 0"
); 

leave it like it is?

g-force2k2 08-29-2002 06:05 AM

you can keep that as is as well ;) regards... glad that it worked :)

g-force2k2

Boofo 08-29-2002 06:11 AM

Thanks again for all of the help. Great hack! ;)

andrew67 08-29-2002 10:34 AM

Best hack out for a long time! GREAT WORK!!! :)

scottct1 08-29-2002 01:12 PM

I want to install this hack but I have one question, will it show the users time online when they are in invisable mode?

Thanks!

g-force2k2 08-29-2002 02:38 PM

scottct1 yeah it should... but i don't see that as a problem...

g-force2k2

Okiewan 08-29-2002 03:12 PM

Cool hack, but a problem?

Time online per day is out of whack for everyone but users who register after the hack is installed... any way to change it to start averaging from 0 rather than looking at how long the user has been registered? IMHO, that calc as it is now isn't very useful. I for example have been registered for nearly 3 years, was online 3 hours after installing the hack. Shows my online time as 3 hours, but my per day average as 8 seconds :)

NTLDR 08-29-2002 03:33 PM

Quote:

Originally posted by Okiewan
Time online per day is out of whack for everyone but users who register after the hack is installed...
I attempted to do this but failed badly :p

The way I wanted to do it was if you registed before the date the hack was installed it calculated the time online since then per day, otherwise it did it since you registred, but I didn't get anywhere :cry:

scottct1 08-29-2002 03:44 PM

Ok I clicked install. :) Any way to add a days column. :) Some of us spend way to much time in front of their computer!

wolfe 08-29-2002 04:05 PM

i get this error on the time online leader page

Fatal error: Call to undefined function: dotimeonline() in /usr/local/psa/home/vhosts/mysite/httpdocs/forums/timeonline.php on line 39

wolfe 08-29-2002 04:23 PM

not working properly on VBB 2.2.4

grog6 08-29-2002 04:27 PM

Waouhouh, thx a lot G-force2k2 !

It's a very fabullous hack, thanks for this work, it works perfectly :)

NTLDR 08-29-2002 04:52 PM

Quote:

Originally posted by wolfe
not working properly on VBB 2.2.4
It works fine on vB 2.2.4, go through the instructions, I expect you have made a mistake ;)

g-force2k2 08-29-2002 08:09 PM

wolfe did you make the changes to the admin/functions.php? regards...

g-force2k2

PsYc 08-29-2002 09:26 PM

Quote:

Originally posted by Okiewan
Cool hack, but a problem?

Time online per day is out of whack for everyone but users who register after the hack is installed... any way to change it to start averaging from 0 rather than looking at how long the user has been registered? IMHO, that calc as it is now isn't very useful. I for example have been registered for nearly 3 years, was online 3 hours after installing the hack. Shows my online time as 3 hours, but my per day average as 8 seconds :)


yes same problem here too...

the counter seems a bit buggy

can you have a look at it g-force2k2?

Souly 08-29-2002 11:18 PM

I have do the follow to calculate a correct "Time Online Per Day".

First you need the Timestamp (LINUX) before you start to install my changes! ! !

in timeonline.php find:
PHP Code:

        $daysregs floor((time() - $lead[2]) / 86400); 

change it to: [installtimestamp=yourtimestampyou must change it manually]
PHP Code:

          $daysregs floor((time() - installtimestamp) / 86400); 

I have Start the Tool now, an now is Linuxtime=1030666140 - also my Code is
PHP Code:

          $daysregs floor((time() - 1030666140) / 86400); 

And don?t look on my bad english - first learn german :lick:

Boofo 08-29-2002 11:24 PM

What does this mean? :) Isn't that on the server already?

Quote:

First you need the Timestamp (LINUX) before you start to install my changes! ! !

g-force2k2 08-29-2002 11:31 PM

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 :p but here's a little code i whipped up for ppl like you that feel cheated :p 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

g-force2k2 08-29-2002 11:33 PM

ahh... see Souly had a similiar idea to me ;) just set the time back so but... for him all users will have that time as the register date... even if they register five weeks later ;) my code prevents that... but good thinking Souly :)

g-force2k2

Souly 08-29-2002 11:41 PM

hehe - nice :) very nice :)

OK. you see -- iam a newbie! :dead:

Boofo 08-29-2002 11:46 PM

All that did was make the Total Time Online and the Time Online Per Day the same value on my site. :)

g-force2k2 08-29-2002 11:50 PM

Boofo what time code did you use? try this number see if it varies the values differently?

PHP Code:

        $fairtime 1030494285

regards...

g-force2k2

Boofo 08-30-2002 12:22 AM

ok, that seemed to change it. It now look like around half (which would make sense since I installed this hack yesterday). But, what does this addon actually do? How will it affect people who register after it is installed? Thank you, by the way. :)

g-force2k2 08-30-2002 12:27 AM

how will this effect users afterwards :p? well if their joindate is after the time that installed their time won't be effected at all ;) so this is only more or less a feature to help those that have been long time members :) regards...

g-force2k2

Kars10 08-30-2002 10:30 AM

Hello G-Force!!
First Thankx for this great Hack. But theres a Problem with it.
Everytime i try to use the "next" Link in the Navigation of the "timeonline" i get a blank page. When i use the reload-Button the site is there. After this it works for 2-3 Klicks and then i get a white page. The same if i use the backlink in the "Forum-Navigation"....:confused:
I promised i make all youre Instruction says and i don?t see any error in my installation. Ok, i get that "zero-error" and make youre fix from Post #2. It works, but the Nav-Problem is a Problem...
Please help! ;)

PsYc 08-30-2002 12:29 PM

another little error:

when i watch the timeonline.php i see that my online time increase, the seconds, minutes and so on

but i don't see the time of other members increasing, but i know they are online too with me at the same time.

only when i go through something else in the board and then go back to the timeonline.php i saw their time but refreshing the page doesnt work here

i have your - post, division by zero and the fairtime addon installed too

any suggestions?

g-force2k2 08-30-2002 12:45 PM

hmm... i'll look into both issues...

Minifreunde make sure that you made the fix on the earlier posts... the links nextpage and the others i forgot to end with </a> could be a problem ;) it was fixed but perhaps you downloaded before hand... regards...

g-force2k2


All times are GMT. The time now is 06:36 AM.

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.01550 seconds
  • Memory Usage 1,921KB
  • 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
  • (21)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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