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)

eva2000 01-13-2002 05:40 AM

i double checked and the

Active users today figure is resetting itself based on my server time ?

it's 5 pm where I am and it was reset to zero just now.. i checked and my server time is 12 am....

probably no way to fix that since every member would then see a different figure from different time zones ?

or can you define in the script the reset time or allow vB admins to define that time ?

i.e. based on the vB admin's GMT offset time..

Erwin 01-13-2002 09:11 AM

Eva is absolutely right, the same thing happens to me, so I figure it must be set to the server's time.

genial 01-13-2002 01:39 PM

Quote:

Originally posted by eva2000
Active users today figure is resetting itself based on my server time ?
yes so it is. the active users today figure will be reseted on 0:00 am servertime.

our server is in the same timezone as the members and so that was not importend for me and i didn't consider that.

i will see to fix it, so that showing to the members the active today figure according to there members-timezone and the todayrecord to the selected timezone in the vbb-options.

Admin 01-13-2002 01:56 PM

Great hack, I love the concept. :D

One thing, you might want to consider indexing the lastactivity column in the user table, otherwise the query scans a HUGE table (several thousands sometimes! :eek:)

genial 01-13-2002 02:14 PM

Quote:

Originally posted by FireFly
One thing, you might want to consider indexing the lastactivity column in the user table, otherwise the query scans a HUGE table
it's a good idea. :)

i will consider this in the next release of this hack, because the next release needs changes in the database for count guests. ;)

Admin 01-13-2002 02:39 PM

Just installed this here btw, works great. :)

genial 01-13-2002 03:22 PM

@all with the timezoneproblem of this hack:

i am not sure if this changes fix the problem, because our server is in the same timezone as the members and so i can't test it.

please test the changes for me. :D

find:
PHP Code:

$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user 
                WHERE lastactivity > " 
mktime(0,0,0,date("m"),date("d"),date("Y")) . 
                ORDER BY username"
); 

and replace with:
PHP Code:

$unixtoday mktime(0,0,0,date("m"),date("d"),date("Y"));
$unixtoday $timeoffset 3600 $unixtoday;
$numbertodayonlinerecord $DB_site->query("SELECT COUNT(*) AS count FROM user 
                                  WHERE lastactivity > " 
$unixtoday 
                                  ORDER BY username"
);
$numbertodayonlinerecord $numbertodayonlinerecord[count];
$unixtoday $bbuserinfo[timeoffset] * 3600 $unixtoday;
$todayusers=$DB_site->query("SELECT userid,username,usergroupid,lastactivity,invisible,lastpost FROM user 
                                  WHERE lastactivity > " 
$unixtoday 
                                  ORDER BY username"
); 

and find:
PHP Code:

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;


replace with:
PHP Code:

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


genial 01-13-2002 04:00 PM

<font size="3">important: please notice</font>

the fix for the timezone problem has changed at this moment, please check your code if you have this fix installed before.

Lionel 01-13-2002 04:21 PM

Does this only count members or can it count guests too?

TELEK 01-13-2002 04:29 PM

Ok, I did everything in the instructions, and nothing happened. I did the one on the seperate page. Anyways, nothing changed on the main page, and if I go to onlinetoday.php, it is just a blank white page.


All times are GMT. The time now is 10:52 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.01332 seconds
  • Memory Usage 1,761KB
  • 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
  • (4)bbcode_php_printable
  • (2)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