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)
-   -   Who was online today [available in english & german] (https://vborg.vbsupport.ru/showthread.php?t=34014)

SWFans.net 01-22-2002 02:19 PM

Works great. :D Thanks again.

Wolf42 01-25-2002 12:30 PM

Dein Hack funzt tadellos! THX!!

Jawelin 01-28-2002 03:24 PM

Very very useful hack, but I have some synchro problem... :greedy:

Installation type #1: I definetively don't think the followin code finds out the right midnight time when the server hasn't the same user's time zone... :pleased:
PHP Code:

WHERE lastactivity " . mktime(0,0,0,date("m"),date("d"),date("Y")) . " 

???

Thanks a lot.
Bye

Jawelin 01-28-2002 03:41 PM

Quote:

Originally posted by genial
[...]and replace this line:
PHP Code:

$unixtoday $bbuserinfo[timeoffset] * 3600 $unixtoday

with this:
PHP Code:

$unixtoday $unixtoday + ($bbuserinfo['timezoneoffset'] - $timeoffset) * 3600

and test it again. ;)
i hope so it will work well. please give me your feedback about it.

Excuse me.
If you make the correction to $unixtoday between the two SELECTs, you'll obtain different results from SELECT COUNT and SELECT... Shouldn't you ?

I think it should be bette place the
PHP Code:

$unixtoday $unixtoday + ($bbuserinfo['timezoneoffset'] - $timeoffset) * 3600

right after the first $unixtoday = assignment.

Do you agree ?

genial 01-28-2002 09:38 PM

The problem is, if the timezone of a member is -5 cet and another user has +7 cet, then there are problems with the correct count of today-online-record. Therefore, for the online record counts it has to be taken an uniform timezone, namely the servertime.
To reset the display of the today-online-member-names at 0:00 hours of his time zone the display of the today-member-names has to be called up separately at his timezone.

I have a solution for this problem in my head, but momentarely i don't have the time to realize this. therefore it needs much more time to release the new version of this hack, that includes a fix for this problem. to this point the present hack works only 100%, when each member is in the same timezone as the server.

Jawelin 01-29-2002 08:23 AM

Yeah. Infact yesterday I applied the hack and found about 270 users from the midnight with all your corrections.
Today I have 0 (zero!) users, according to the same hack... :confused:

Actually I think the traslation you made to $unixtoday var had the wrong sign ... :?:

I though to a simpler solution, I guess.
Simply, replace in the ORIGINAL HACK CODE:
PHP Code:

mktime(0,0,0,date("m"),date("d"),date("Y")); 

with:
PHP Code:

mktime($timeoffset-$bbuserinfo['timezoneoffset'],0,0,date("m"),date("d"),date("Y")); 

This should traslate the server's midnight time towards the user one.

What do you thin about ?

Jawelin 01-29-2002 08:43 AM

Quote:

Originally posted by Mystics
[...]"Most users ever online on a day".
[...]Greetz,
Mystics

Excuse me. I don't understand how this hack make the difference between storing into db the maxusers of the original VB index.php and the maxusers for the entire day.
It seems these two numbers are stored in the same field of the same table, and the second overwrites the first one.

Mystics, please, could you explain better those steps:
PHP Code:

  if ((int)$maxusers[0] <= $totalonline) {
    
$time time();
    
$maxloggedin "$totalonline " $time " " $maxusers[2] . " " $maxusers[3];
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[0] = $totalonline;
    
$maxusers[1] = $time;
  }

  [...]
  [...]
  [...]
  
  if ((int)
$maxusers[2] <= $numbertodayonline) {
    
$time time();
    
$maxloggedin $maxusers[0] . " " $maxusers[1] . $numbertodayonline " $time;
    
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    
$maxusers[2] = $numbertodayonline;
    
$maxusers[3] = $time;
  } 

Thanks a lot.
Bye

Mystics 01-29-2002 11:35 AM

Quote:

Originally posted by Jawelin
Mystics, please, could you explain better those steps
The records are stored in the Template maxloggedin

Before the hack: only the number and the Time of the "Most users ever online at the same time" was stored in this Template.

Therefore the content looked like:
Code:

21 1010710015
21 = $maxusers[0] = $totalonline = Number of the "Most users ever online at the same time"
1010710015 = $maxusers[1] = $time = Unix-Time of the moment when the record was reached

After the Hack: First the number and the Time of the "Most users ever online at the same time" and then the number and the Time of the "Most users ever online on a day" is stored in this Template.

Therefore the content look like:
Code:

21 1010710015 84 1010530336
84 = $maxusers[2] = $numbertodayonline = Number of the "Most users ever online on a day"
1010530336 = $maxusers[3] = $time = Unix-Time of the moment when the record was reached

Jawelin 01-29-2002 02:00 PM

Thanks a lot for such an exaustive answer.
I asked because, after having installed the hack for two days, I always got 0 as the maximum value and today as the date.
But I think it was due to the timezone problem.
About that, what do you think about my simple workaround of your hack code (3 posts above here) ?
Quote:

Originally posted by Jawelin
Simply, replace in the ORIGINAL HACK CODE:
PHP Code:

mktime(0,0,0,date("m"),date("d"),date("Y")) 

with:
PHP Code:

mktime($timeoffset-$bbuserinfo['timezoneoffset'],0,0,date("m"),date("d"),date("Y")) 

This should traslate the server's midnight time towards the user one.

Thanks again.

zadi 01-30-2002 04:17 AM

On our forums we use the colored users online hack which colorizes members by usergroups. When we added the "Who-was-Online-Today" we noticed that it showed up in "black" (our link color). Well we wanted one that matched the colors shown in the CUO hack and so my co-admin hacked the hack. Enjoy. :) Remember to modify $mod["$userid"] or $todayuser['usergroupid'] == # to reflect your usergroup colors & ids.


created by genial @http://www.skats-board.de (eMail: phenomenal_genial@hotmail.com)
documentation & posted (with a few little changes) by Mystics (eMail: mystics27@gmx.net)

Modified by The Tech for Zadi


All times are GMT. The time now is 06:14 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.01498 seconds
  • Memory Usage 1,776KB
  • 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
  • (9)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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