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.

Mystics 01-13-2002 04:31 PM

Quote:

Originally posted by TELEK
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.
Have you adjusted the existing templates and created the new templates? Seems so, if you don't have done that :rolleyes:

TELEK 01-13-2002 04:50 PM

yeah, I did

genial 01-13-2002 05:17 PM

Quote:

Originally posted by Lionel
Does this only count members or can it count guests too?
the current release count only members.

i will release a new version of this hack in the near future, which counts members and guests. guests will be differentiated through their ip, that means two guests with the same ip will be counted as one guest and a guest with different ips (surfing the web through a proxy-server) will be counted as more guests.

Lionel 01-13-2002 05:25 PM

Quote:

Originally posted by genial
the current release count only members.

i will release a new version of this hack in the near future, which counts members and guests. guests will be differentiated through their ip, that means two guests with the same ip will be counted as one guest and a guest with different ips (surfing the web through a proxy-server) will be counted as more guests.

Great because it can only look good when you display more. :D

TELEK 01-13-2002 05:25 PM

OK, I figured out how to work it, kind of. I don't understand what templates are, and how template sets work. The reason why it wasn't working was because the style set I was using, had the template set Hyren Village selected, and the templates I made for the hack were in default template set. But when i switch my style to default, the layout changes. Should I put those templates you make (for the hack) in every template set?

Mystics 01-13-2002 05:29 PM

Quote:

Originally posted by TELEK
Should I put those templates you make (for the hack) in every template set?
Yes! If you want to use the hack in every of your styles! But if you never use the default template set, you only have to insert the hack into your "Village"-Style-Templates.

Erwin 01-13-2002 05:38 PM

Hi genial,

Iinstalled the updated code. No way of knowing if it does work until tonight, but it looks like it's working. The numbers did change.

Just one IMPORTANT NOTE for potential installers:

Remove the "color" variable from the first code change if you do NOT have the color hack installed (or whatever that color variable is for) - otherwise your index.php will not work as you will get a database error! :)

Will let you know if there are any problems. Thanks!

Erwin 01-13-2002 05:46 PM

On second thoughts, I don't think the updated code is working. On the "visitors who have visited today" I am seeing members who was on definitely yesterday according to my timezone, and not since. I think you are using the DEFAULT timezone for VB - not the server one, but the default one, not the member's own timezone.

Server time zone: GMT -6
VB default: GMT 0
My timezone: GMT +10

Instead of using GMT -6 which was what it was using, it is now using GMT 0 (I think).

Anyone else with the same problem?

genial 01-13-2002 09:25 PM

Quote:

Originally posted by Erwin Loh
Just one IMPORTANT NOTE for potential installers:

Remove the "color" variable from the first code change if you do NOT have the color hack installed (or whatever that color variable is for) - otherwise your index.php will not work as you will get a database error! :)
uups sorry, i overlooked this. :o

i have fixed this little mistake in the posted code. ;)

i will check the fix for the timezone problem tomorrow, if i find time for. :D

DarkReaper 01-14-2002 01:50 AM

Cool. :)

http://www.seriouscommunity.com

Installed there earlier today :)

Twig Deez 01-14-2002 09:00 PM

working well over here. great hack!

a couple of screenshots:
> how it looks on the forumhome page
> how it looks when the new window pops up

:)

skyline2002 01-15-2002 09:54 PM

hi, guys!! how can i let the second version(Version with usernames on extra site) work for my vb 2.01??

the first version works fine, but the second version I got nothing show up in Onlineday.php. I found some codes in onlinetoday.php
is only for vb 2.21. That may be the problem.

so can any one help me with the problem??
thank you guys so much!!!

Here is the pic. what I got :

skyline2002 01-16-2002 07:13 AM

Quote:

Originally posted by skyline2002
hi, guys!! how can i let the second version(Version with usernames on extra site) work for my vb 2.01??

the first version works fine, but the second version I got nothing show up in Onlineday.php. I found some codes in onlinetoday.php
is only for vb 2.21. That may be the problem.

so can any one help me with the problem??
thank you guys so much!!!

Here is the pic. what I got :

no one help me ??? :(

genial 01-16-2002 10:36 AM

Quote:

Originally posted by Erwin Loh
On second thoughts, I don't think the updated code is working. On the "visitors who have visited today" I am seeing members who was on definitely yesterday according to my timezone, and not since. I think you are using the DEFAULT timezone for VB - not the server one, but the default one, not the member's own timezone.

Server time zone: GMT -6
VB default: GMT 0
My timezone: GMT +10

Instead of using GMT -6 which was what it was using, it is now using GMT 0 (I think).
from the timezone-fix, which was posted here , please delete this line:
PHP Code:

$unixtoday $timeoffset 3600 $unixtoday

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.

Jawelin 01-16-2002 04:36 PM

Quote:

Originally posted by Mystics
The Hack only works 100% correct, when each member is in the same time zone as the Server!
Well. If I was about 6 hours behind the server ? :eek:
Is there any setting to modify (traslation) to make the daytime interval synchronized to my time and not to server one ?
Thanks a lot

Otherwise I think it'll not useful to me ... :(

Erwin 01-16-2002 07:32 PM

Hi genial,

No, your time fix did not work.

It looked as though it was okay when a user is unregistered, but when I log on as a registered user, there was 0 number shown. Not sure why to be honest - your fix should have worked.

I reverted back to the original fix.

S0uL 01-16-2002 08:18 PM

i have one problem the - Most users ever online on a day was - it keeps changing from day to day.

Lucky 01-17-2002 08:10 AM

Great Hack!

Thank you :)

DarkReaper 01-17-2002 08:47 PM

Could you make it so guests count as well? :)

Psychdrone 01-17-2002 11:39 PM

errr Great hack! as I said before!

But now I changed it to where the users lists is located on another page, and All it doseit tell me how many people have been online. but dose not include a list of people? anyhelp thanks!!!!!!!

Mystics 01-18-2002 10:33 AM

Quote:

Originally posted by Psychdrone
errr Great hack! as I said before!

But now I changed it to where the users lists is located on another page, and All it doseit tell me how many people have been online. but dose not include a list of people? anyhelp thanks!!!!!!!

Check if you have done all necessary template changes and if you have uploaded onlinetoday.php! (You only see the list of usernames on onlinetoday.php in the second version of the Hack!)

Psychdrone 01-18-2002 09:00 PM

the second version??

so just redownload that zip?

allright I will try this again

Mystics 01-18-2002 09:08 PM

Quote:

Originally posted by Psychdrone
the second version??
Look at my first Posting in this Thread.....there are two Versions of the Hack

1. All names of the Users who where online today are listed on the Forum-Home just below the "Curent Active Users"

2. All names of the Users who where online today are listed on a separate Site (onlinetoday.php)

That's what I meant with the "second version"! :p

And it seems, you have installed the second version...because you don't see the names on the Forum Home !!! So, upload onlinetoday.php and open it....you can see the names there (and first, follow all instructions in "who-was-online-today-with-extra-window.txt" !)

Psychdrone 01-20-2002 01:29 AM

heh didn't see your second post! :zzz:

anyways thanks bud, got it working, :)

If you ever need anything give me a holla :cool:

L'Bo 01-20-2002 01:22 PM

this seems like a great hack.. but when i try to install it on index.php i get a error

Parse error: parse error in /home/lbo/public_html/forums/index.php on line 267

thats what happend i am running 2.2.1

some one please help me

Shenlong 01-20-2002 01:37 PM

im running 2.2.1 and it works perfectly,

post line 267

Dark_Wizard 01-20-2002 11:41 PM

Awesome hack...thx!

SWFans.net 01-21-2002 10:32 PM

Thank you for the great hack. :)

I would like to make a request of anyone who might be able to answer.

I?d like to make the onlinetoday.php file also show invisible users to my mods, but I am unable to do so on my own. Can anyone provide the code that would allow usergroup 7 to see invisible users in onlinetoday.php?

Lucky 01-22-2002 05:19 AM

Sounds like a good idea!

genial 01-22-2002 06:17 AM

Quote:

Originally posted by SWFans.net
I?d like to make the onlinetoday.php file also show invisible users to my mods, but I am unable to do so on my own. Can anyone provide the code that would allow usergroup 7 to see invisible users in onlinetoday.php?
this changes will allow supermoderators and moderators to see the invisible user, no matter what there usergroupid is.

search for this line in the hack:
PHP Code:

if ($todayuser['invisible']==and $bbuserinfo['usergroupid']!=6) { 

and replace it with this line:
PHP Code:

if ($todayuser['invisible']==and $bbuserinfo['usergroupid']!=and $bbuserinfo['usergroupid']!=and !$mod["$bbuserinfo[userid]"]) { 



All times are GMT. The time now is 06:09 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.01617 seconds
  • Memory Usage 1,864KB
  • 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
  • (9)bbcode_php_printable
  • (13)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