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)

c-pr0mpt 07-26-2002 10:56 PM

On a forum I work on, the todaylogged in users shows the correct number to me if I am logged in as admin, but if I log out or sign in under a normal user it doesnt count invisible users.

Now I know about the fix to changing the code to $numbertodayonline

But it doesnt work. It still stays the same. Any help?

Here is my code in index.php
Code:

// today online hack begin
  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;
  }

  $todayloggedinusers = "";
  $numbertodayonline = 0;
  $numbertodayonlineinvisible = 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")) + (($bbuserinfo['timezoneoffset']-$timeoffset)*3600)) . "
                ORDER BY username");
  while ($todayuser=$DB_site->fetch_array($todayusers)) {
    $numbertodayonline++;
    if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
      $numbertodayonlineinvisible++;
      continue;
    }
  }

  $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;
    $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
    $maxusers[2] = $numbertodayonline;
    $maxusers[3] = $time;
  }
 
  $todayrecordusers = $maxusers[2];
  $todayrecorddate = vbdate($dateformat,$maxusers[3]);
 
  eval("\$todayloggedinusers = \"".gettemplate('forumhome_todayloggedinusers')."\";");
//today online hack end

And in te template I am using, $numbertodayonline.

Thanks!

Schorsch 08-06-2002 04:19 AM

here the ultimate question :banana:

besides the number of registered members, how can I show the total number of guests who were online ?

I saw this feature on a phpBB2 board, take a look at the screenshot.

isn't there a possibility to realize this cool feature for the hack for vBulletin ???

thanks,
Schorsch

disillusioned 08-08-2002 01:34 AM

Parse errors hurt my brain...

I followed every step of this hack from beginning to end... And ended up with happy spiffy parse errors... I'm not sure why- Also, we use .php3 files for all of our forums... Now, I'll upload it and all user or $forum relative data is missing- including avatars, status, post counts, and everything else..
I also had a very similar- almost identical parse error with the 'what style are we all using' hack... I'm not sure why this is- I'm uploading in ASCII and everything... but it's quite frustrating to do all that vigorous copy/pasting ;-) and find your board all that much more worse for wear.

Would anyone like to cue me on on how stupid I'm being?
I'd greatly appreciate it!

Tony G 08-10-2002 07:37 AM

Sorry for bumping, but there is a problem.

The time for when the most users online isn't working. Everything else works okay.

Any ideas?

Beams 08-10-2002 08:06 AM

Installed fine but noticed it only starts counting the user online from 12midday it seems to work fine until 5-6 am then its back to 0 users. The problem is it doesn't count any users online until 12 midday again so missing 6 hours any ideas why??

Ideally it would be best if it would work from 12 midnight to 12 midnight :)

Great hack btw

Thanks for any help

Beams :D

NexDog 08-10-2002 11:55 AM

Well, no suprise that this isn't working for me. :D

Folloowed the steps to the letter, editted index.php and created the 2 templates and editted forumhome. Nothing. :(

I'm using the instructions found here:

https://vborg.vbsupport.ru/attachmen...&postid=212495

I thought the code might be commenting itself out. For example:

PHP Code:

// today online hack begin if ((int)$maxusers[0].......... 

So I did:

PHP Code:

// today online hack begin
 
if ((int)$maxusers[0]........ 

And got a parse error on line 374. Weird.

Tony G 08-10-2002 12:32 PM

Quote:

Originally posted by Beams
Installed fine but noticed it only starts counting the user online from 12midday it seems to work fine until 5-6 am then its back to 0 users. The problem is it doesn't count any users online until 12 midday again so missing 6 hours any ideas why??

Ideally it would be best if it would work from 12 midnight to 12 midnight :)

Great hack btw

Thanks for any help

Beams :D

I'm assuming it's programmed to a certain time and so it will reset on that exact time. So for this cycle it should go for 24 hours.

NexDog 08-10-2002 02:03 PM

Yep, just went through the hack again, step-by-step. I made no mistakes. But it just doesn't show up. :(

Tony G 08-11-2002 01:01 AM

Now it aint showing anyone thats come online today. And it was working fine yesterday. Damn this hack. :p

NexDog 08-15-2002 05:51 AM

Been through this hack with a fine tooth comb. Just doesn't display. :(


All times are GMT. The time now is 08:07 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.01353 seconds
  • Memory Usage 1,748KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)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