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)

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 11:30 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.02293 seconds
  • Memory Usage 1,764KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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