vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Who Was Online Today on forums (https://vborg.vbsupport.ru/showthread.php?t=59579)

eXtremeTim 01-09-2004 12:00 PM

Quote:

Originally Posted by Zeitgeist
That's the same problem I'm having, too. The hack isn't working! Didn't the author noticed that? Where's the bug? :ermm:

I have the same problem as them. The most users ever online in a day resets at midnight.

I will look and see if i can figure out what is going on in a little while.

Zeitgeist 01-09-2004 12:08 PM

Quote:

Originally Posted by eXtremeTim
I have the same problem as them. The most users ever online in a day resets at midnight.

I will look and see if i can figure out what is going on in a little while.

Thanks, extreme. I think you can compare the code from the vB 2.x.x hack with this new hack and so you might be able to find the wrong code in this hack.

Jean147 01-09-2004 12:30 PM

was looking for that. Thx a lot. :top

eXtremeTim 01-09-2004 12:31 PM

Fixed it.

Here are my changes

Find:
PHP Code:

if ((int)$maxusers['maxonline'] <= $totalonline)
{
    
$time time();
    
$maxloggedin "$totalonline " $time " " $maxusers['maxonline'] . " " $maxusers['maxonlinedate'];
    
$maxusers[0] = $totalonline;
    
$maxusers[1] = $time;


Replace with:
PHP Code:

    if (intval($maxusers['maxonline']) <= $totalonline)
    {
        
$maxusers[0] = $totalonline;
        
$maxusers[1] = TIMENOW;
    } 

Now Find:
PHP Code:

if ((int)$maxusers[2] <= $numbertodayonline) {
    
$time time();
    
$maxloggedin $maxusers[0] . " " $maxusers[1] . $numbertodayonline " $time;
    
$maxusers[2] = $numbertodayonline;
    
$maxusers[3] = $time;


Replace with:
PHP Code:

    if (intval($maxusers['maxonline']) <= $totalonline) {
    
$maxloggedin $maxusers[0] . " " $maxusers[1] . $numbertodayonline " TIMENOW;
    
$maxusers[2] = $numbertodayonline;
    
$maxusers[3] = TIMENOW;
    
$DB_site->query("REPLACE INTO " TABLE_PREFIX "datastore (title, data) VALUES ('maxloggedin', '" addslashes(serialize($maxusers)) . "')");



Zeitgeist 01-09-2004 01:33 PM

Sorry, it doesn't work. It resets the date to 01-01-1970 and hides the most users ever online on a day completly.

eXtremeTim 01-09-2004 01:51 PM

This hack only works if whosonline is on so make sure that you have it turned on.

eXtremeTim 01-09-2004 02:07 PM

I have not been able to recreate your problem I have check all the code im using and this looks like the only parts i changed. Check and make sure you did the replaces correctly.

Zeitgeist 01-09-2004 06:15 PM

That's a screenshot of my forum after replacing the variables with yours. I'm 100% sure that I've made exactly what you've posted. Who's online is enabled and I haven't made any other changes to index.php *confused*

eXtremeTim 01-09-2004 06:35 PM

Quote:

Originally Posted by Zeitgeist
That's a screenshot of my forum after replacing the variables with yours. I'm 100% sure that I've made exactly what you've posted. Who's online is enabled and I haven't made any other changes to index.php *confused*

Mind posting the whole whosonline block of code you have? I will compare it to mine and see if there are anymore differences. That way i can see if you messed up or if i left something out or if its working becuase of some other change i have done on my board. Seing as my board is already heavily modified. You can check it out on mine running the code i have posted. http://www.extremechatforums.com/forum/index.php

Zeitgeist 01-09-2004 06:48 PM

That's the whole code of the hack:
Code:

// ### WHO WAS ONLINE TODAY ########################
        if (intval($maxusers['maxonline']) <= $totalonline)
{
                $maxusers[0] = $totalonline;
                $maxusers[1] = TIMENOW;
}
$todayloggedinusers = "";
$numbertodayonline = 0;
$numbertodayonlineinvisible = 0;
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, options FROM ".TABLE_PREFIX."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))
{
 $todayuser['options'] = intval($todayuser['options']);
 foreach($_USEROPTIONS AS $optionname => $optionval)
 {
  $todayuser["$optionname"] = iif($todayuser['options'] & $optionval, 1, 0);
 }
 $numbertodayonline++;
 $invisibleuser = '';
 $userid = $todayuser['userid'];
 $lastactivetime = vbdate($vboptions['timeformat'], $todayuser[lastactivity]);
 
 if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6)
 {
  $numbertodayonlineinvisible++;
  continue;
 }
 if ($todayuser['invisible'] == 1)
 { // Invisible User but show to Admin
  $invisibleuser = '*';
 }
 $username = fetch_musername($todayuser);
 
 if (!$todayloggedinuser)
 {
eval("\$todayloggedinuser = \"".fetch_template('forumhome_todayloggedinuser')."\";");
}else{
eval("\$todayloggedinuser .= \", ".fetch_template('forumhome_todayloggedinuser')."\";");
}
}
$DB_site->free_result($todayusers);
if ($bbuserinfo[usergroupid] == 6) {
 $todayonline = $numbertodayonline;
} else {
 $todayonline = $numbertodayonline - $numbertodayonlineinvisible;
}
        if (intval($maxusers['maxonline']) <= $totalonline) {
        $maxloggedin = $maxusers[0] . " " . $maxusers[1] . " $numbertodayonline " . TIMENOW;
        $maxusers[2] = $numbertodayonline;
        $maxusers[3] = TIMENOW;
        $DB_site->query("REPLACE INTO " . TABLE_PREFIX . "datastore (title, data) VALUES ('maxloggedin', '" . addslashes(serialize($maxusers)) . "')");
}
$todayrecordusers = $maxusers[2];
$todayrecorddate = vbdate($vboptions['dateformat'],$maxusers[3]);
eval("\$todayloggedinusers = \"".fetch_template('forumhome_todayloggedinusers')."\";");



All times are GMT. The time now is 10:51 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.01319 seconds
  • Memory Usage 1,770KB
  • 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
  • (4)bbcode_php_printable
  • (3)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