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

zadi 01-30-2002 04:24 AM

?

Jawelin 01-30-2002 11:08 AM

Nice!

What about the 'today' concept on board with different timezone from the users ?

It was the biggest - my own opinion - problem on the original hack.
Thanks.

Jawelin 01-30-2002 11:17 AM

The above patch works correctly to 'identify' the midnight away from the server's timezone, but there's still a problem with the $time variable, I guess.
Infact, when a new day arrives across midnight on the user's timezone (me, for instance, the Admin), this hack goes on adding the user number to the new-day counter as it was the previous day.... :(

I can't get out !!! Heeeellllppppp, please!

Note: my time = +1, server's time -5 = vbdate difference +6

Thanks a lot.
Bye

-=dm=- 01-30-2002 11:54 AM

great:)

is the hack on first page updated?
is there no need for add those changes?

thanx
dm

-=dm=- 01-30-2002 12:43 PM

btw I noticed the "Most users ever online was 1 on 30-01-2002 at 03:48 PM."

its reseted and dont update :(
How do I fix this?

I have this one on bottom of the page and its working fine(but also reseted after this hack)

"Number of Active Users Today": 6
Most users ever online on a day was 6 on 30-01-2002


and I have this one on the top:

this one are not updating
"Currently Active Users:"
Most users ever online was 1 on 30-01-2002 at 03:50 PM.

Mystics 01-30-2002 12:53 PM

Quote:

is the hack on first page updated?
No, the Hack on the first page only works 100% correct, when the server is in the same time zone as all users.


Quote:

Originally posted by -=dm=-
its reseted and dont update :(
How do I fix this?

Please check, if you have done really all changes in your Templates and your PHPs! The record doesn't get reset if everything is built-in correct :)

Jawelin 01-30-2002 01:17 PM

Quote:

Originally posted by Mystics
the Hack on the first page only works 100% correct, when the server is in the same time zone as all users
SURE! Of course.
Sorry having confused someone.

Even, does anybody have a solution to my problem with 6 hours more than the server ?

Mystics, which point should I modify to change the day for the stored counter ??? :(

Thanks

zadi 01-30-2002 05:13 PM

What ever problems the original hack had with the today concept will be in this one as well. All my friend did was modify it to use with the colored online users. ;) We didn't anticipate the time zone problems.

Waterski 01-30-2002 07:59 PM

Any chance to make this only visible to registered users or Admin?

Waterski

kc5uyw 02-02-2002 08:32 PM

Excellent ... been looking for this.

1yesfan 02-05-2002 09:30 PM

Not workign for me. I loaded everything, getting no error messages. Nothing is showing up!?!?!? Being new to this stuff, the templates I am making is a new one that will be in the customized area?

danielillo 02-08-2002 04:15 PM

Great Hack,

I'm also +6 hours form my server.... What did I do? Easy, just typed:
"Registered Users Online today (From 06:00 am to 06:00 am)" http://www.dondepuedo.com/foro/onlinetoday.php?s=
:D hehehehhee

I have one question, my VB is 2.0.3, the hack works perfect, but Mods and Admins are not showed in bold or bold + italic. Does it work only for 2.2.x?

Thanks and, please, excuse my English ;)

Mystics 02-08-2002 04:33 PM

Quote:

Originally posted by danielillo
but Mods and Admins are not showed in bold or bold + italic. Does it work only for 2.2.x?
This feature first was implemented in vB 2.2.x...so it doesn't work in 2.0.3, neither in "Who's online", nor in "Who was online today".

Jawelin 02-08-2002 06:21 PM

Quote:

Originally posted by danielillo
Great Hack,

I'm also +6 hours form my server.... What did I do? Easy, just typed:
"Registered Users Online today (From 06:00 am to 06:00 am)" http://www.dondepuedo.com/foro/onlinetoday.php?s=
:D hehehehhee

I have one question, my VB is 2.0.3, the hack works perfect, but Mods and Admins are not showed in bold or bold + italic. Does it work only for 2.2.x?

Thanks and, please, excuse my English ;)

I realized a little upgrade to the hack to manage other local times than the server.
Unfortunately, as it should be an absolute value to show an user the onlines from midnight, any admin should choose only ONE midnight for his server, and all the other time-zoned users will see the admin's midnight.
If someone is interested and with the permission of the author of this hack, I could post mine ...

LMK.
Thanks

X-Fan 02-10-2002 12:32 PM

Don't know if this has been asked before (and if it has, my apologies in advance), but would it be possible to do a variant of this hack that doesn't store all the names of those that have visited in a day, just the number, and to have that displayed in the Currently Active Users section (ie included in the forumhome_loggedinusers template)?

If it is, could someone give me a step-by-step on how to do that, please?

Thomas P 02-10-2002 03:44 PM

Hi there,

nice hack, works great and was very easy to install!

Guests would be nice as mentioned, what about storing visitors in "whois online"?
Then stored visitors online today + members online today = all sessions served today... please state if I see things to easy ;)
Anyway: Great hack!

[german]Super Sache: Gute Arbeit! :)[/german]
cu,
-Tom

Jawelin 02-10-2002 06:19 PM

Quote:

Originally posted by X-Fan
Don't know if this has been asked before (and if it has, my apologies in advance), but would it be possible to do a variant of this hack that doesn't store all the names of those that have visited in a day, just the number, and to have that displayed in the Currently Active Users section (ie included in the forumhome_loggedinusers template)?

If it is, could someone give me a step-by-step on how to do that, please?

The hack DOESN'T store anyway all the users.
Simply searches into DB for all contacts within the day (for each user is keepen the timemark of last access).
The hack infact contains two selects: first for COUNT, second for retrieve rows.
Simply, use only the first one... ;)
Hwr I suggest you to use the second variation (with new page).
Simply you can modify index.php as written and don't create the link into template.

Bye

X-Fan 02-11-2002 01:41 AM

Quote:

Originally posted by Jawelin
Hwr I suggest you to use the second variation (with new page).
Simply you can modify index.php as written and don't create the link into template.

But that would still show the users online today in a separate "box" to the currently active users box. How would one incorporate the two together?

Sorry if the answer to this is an obvious one, but I'm still getting to grips with vBulletin!

Jawelin 02-11-2002 12:03 PM

They are in different bits in templates.
You should merge that bits in one, but shall work a little with cut&paste... ;)

Martz 02-11-2002 05:10 PM

How difficult would it be to change the query to show the the maximum number of users today, concurrently? This would be good for checking how many people have been on at once, instead of in total. It would be a great addition!

What would the query be?

Mystics 02-11-2002 05:22 PM

Quote:

Originally posted by Martz
How difficult would it be to change the query to show the the maximum number of users today, concurrently? This would be good for checking how many people have been on at once, instead of in total. It would be a great addition!
Uhm.......are you talking about "Currently Active Users", which is a standard feature of vBulletin? :confused:

mondaynightmike 02-15-2002 01:36 AM

Hhi i have the coloured user hack installed and i can't get this to run with it. Sorry i am a newbie.

The currently active users work fine shows me as red etc

but current active users today (this hack) just shows everyone as black. Can anyone help???

Mystics 02-15-2002 01:40 AM

Quote:

Originally posted by mondaynightmike
but current active users today (this hack) just shows everyone as black. Can anyone help???
-> Who-was-Online-Today [Modified to use with Colored Users Online]

mondaynightmike 02-15-2002 01:41 AM

thanks

Tim Wheatley 02-16-2002 02:20 AM

If anyone uses the seperate page to show their today online users, this is what they need in that pages php file:

Code:

<?php

error_reporting(7);
$templatesused = 'error_whosonlinedisabled,maxloggedin,whowasonline_todayloggedinusers,whowasonline_todayloggedinuser,whosonline_legend,whowasonline';
$loadmaxusers=1;

require('./global.php');

if (!$WOLenable) {
  eval("standarderror(\"".gettemplate("error_whosonlinedisabled")."\");");
}

$permissions = getpermissions(0,-1,$bbuserinfo['usergroupid']);
$usergroupdef = $permissions;

if (!$usergroupdef['canwhosonline']) {
  show_nopermission();
}

$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
                                  FROM moderator
                                  LEFT JOIN user
                                  ON (moderator.userid=user.userid)
                                  ORDER BY user.username');
  while ($moderator=$DB_site->fetch_array($forummoderators)) {
    $imodcache["$moderator[forumid]"][] = $moderator;
    $mod["$moderator[userid]"] = 1;
  }
  $DB_site->free_result($forummoderators);
  unset($moderator);

  $maxusers=explode(" ", gettemplate('maxloggedin',0,0));

  // today online hack begin
  if ((int)$maxusers[0] <= $totalonline) {
    $time = time();
    $maxloggedin = "$totalonline " . $time . " " . $maxusers[2] . " " . $maxusers[3];
    $maxusers[0] = $totalonline;
    $maxusers[1] = $time;
  }

  $todayloggedinusers = "";
  $numbertodayonline = 0;
  $numbertodayonlineinvisible = 0;
  $numbertodayonline = 0;

  $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");
  while ($todayuser=$DB_site->fetch_array($todayusers)) {
    $numbertodayonline++;
    $invisibleuser = '';
    $userid = $todayuser['userid'];
    $lastactivetime = vbdate($timeformat, $todayuser[lastactivity]);
    if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
      $numbertodayonlineinvisible++;
      continue;
    }
    if ($todayuser['invisible'] == 1) { // Invisible User but show to Admin
      $invisibleuser = '*';
    }
    if ($todayuser['usergroupid'] == 6 and $highlightadmin) {
      $username = "<FONT COLOR=#FF0000>$todayuser[username]</FONT>";

    } else if (($todayuser['usergroupid'] == 5) and $highlightadmin) {
      $username = "<FONT COLOR=#FF5501>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 7) and $highlightadmin) {
      $username = "<FONT COLOR=#A46F0A>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 14) and $highlightadmin) {
      $username = "<FONT COLOR=#A46F0A>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 10)) {
      $username = "<FONT COLOR=#00CC00>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 13)) {
      $username = "<FONT COLOR=#00CC00>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 9)) {
      $username = "<FONT COLOR=#0945A9>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 8)) {
      $username = "<FONT COLOR=#5409A9>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 2)) {
      $username = "<FONT COLOR=#666666>$todayuser[username]</FONT>";
    } else {
      $username = $todayuser['username'];
    }
    if (!$todayloggedinuser) {
      eval("\$todayloggedinuser = \"".gettemplate('whowasonline_todayloggedinuser')."\";");
    } else {
      eval("\$todayloggedinuser .= \", ".gettemplate('whowasonline_todayloggedinuser')."\";");
    }
  }

  $DB_site->free_result($todayusers);

  if ($bbuserinfo[usergroupid] == 6) {
    $todayonline = $numbertodayonline;
  } else {
    $todayonline = $numbertodayonline - $numbertodayonlineinvisible;
  }
 
  if ((int)$maxusers[2] <= $numbertodayonline) {
    $time = time();
    $maxloggedin = $maxusers[0] . " " . $maxusers[1] . " $numbertodayonline " . $time;
    $maxusers[2] = $numbertodayonline;
    $maxusers[3] = $time;
  }
 
  $todayrecordusers = $maxusers[2];
  $todayrecorddate = vbdate($dateformat,$maxusers[3]);

  eval("\$todayloggedinusers = \"".gettemplate('whowasonline_todayloggedinusers')."\";");

  if ($WOLrefresh) {
    $metarefresh = "<META HTTP-EQUIV=\"refresh\" CONTENT=\"$WOLrefresh; URL=onlinetoday.php?s=$session[sessionhash]$formeta\"> ";
  }
  if ($highlightadmin) {
          eval("\$legendtable = \"".gettemplate("whosonline_legend")."\";");
  }
  eval ("\$tablehead = \"$tablehead\";");
  eval("dooutput(\"".gettemplate("whowasonline")."\");");

?>


Tim Wheatley 02-16-2002 02:33 AM

Here's the colors which match the ones used in VBStats and also the other colored CURRENT online users hack.

Code:

if ($todayuser['invisible'] == 1) { // Invisible User but show to Admin
      $invisibleuser = '*';
    }
    if ($todayuser['usergroupid'] == 6 and $highlightadmin) {
      $username = "<FONT COLOR=red>$todayuser[username]</FONT>";

    } else if (($todayuser['usergroupid'] == 5) and $highlightadmin) {
      $username = "<FONT COLOR=darkred>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 7) and $highlightadmin) {
      $username = "<FONT COLOR=green>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 4)) {
      $username = "<FONT COLOR=black>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 8)) {
      $username = "<FONT COLOR=orange>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 3)) {
      $username = "<FONT COLOR=black>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 1)) {
      $username = "<FONT COLOR=black>$todayuser[username]</FONT>";

        } else if (($todayuser['usergroupid'] == 2)) {
      $username = "<FONT COLOR=blue>$todayuser[username]</FONT>";
    } else {
      $username = $todayuser['username'];
    }


mondaynightmike 02-16-2002 11:25 AM

ok another quesiton yeturdya my most ever users online in one day was 18 today it says 11. Whats going on? i looked through these pages but ocuold not find it, you may have posted it and i missed it. Can anyone help? I am using at the bottom of my forums http://www.f1modelnews.com/modelforums

thanks

Edgar 02-16-2002 04:47 PM

Great hack,works like a dream:)

Jawelin 02-16-2002 09:03 PM

Quote:

Originally posted by mondaynightmike
ok another quesiton yeturdya my most ever users online in one day was 18 today it says 11. Whats going on?
thanks

Is your timezone the same of your server one ?

mondaynightmike 02-16-2002 09:12 PM

um i have mine set a GMT i use 34sp.com as a server. I don't know what they run at. Can i change what time they run at?


All times are GMT. The time now is 01:07 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.03081 seconds
  • Memory Usage 1,891KB
  • 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_code_printable
  • (9)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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