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)
-   -   vB3 Forumhome Stats Cache Serialize hack v2.2 (https://vborg.vbsupport.ru/showthread.php?t=61420)

BarBeQue 04-10-2004 08:37 PM

I installed the admincp thing so i got this for code:
PHP Code:

$updatetime $vboptions['forumhomecachetime'];
$statsupdate '';

$getupdatetime vbdate("$vboptions[timeformat] - F jS, Y"$statscache['lastupdate']);
$statsupdate "Last updated at $getupdatetime"

And in admincp i set the time to 10

The stats do update but the time shows the previous time when the update queries run. As soon as i press refresh and the cache gets read then it does show the new time

Boofo 04-10-2004 09:07 PM

That's the way it is supposed to work.

Boofo 04-10-2004 09:10 PM

Quote:

Originally Posted by surfhog
ops!!! removed i hope :)
okay I will do as you say and thanks again

Ok, here is your fix.

Replace the top referrer code in the index.php with this:

PHP Code:

    // <!-- TOP REFERRER -->
    
$ref $DB_site->query_first("
        SELECT COUNT(*) AS referrals, user.username, user.userid
        FROM " 
TABLE_PREFIX "user AS users
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (users.referrerid = user.userid)
        WHERE users.referrerid <> 0
        AND users.referrerid NOT IN (1)
        GROUP BY users.referrerid
        ORDER BY referrals
        DESC LIMIT 1
    "
); 

Thanks to NTLDR for fiinding my mistake. ;)

BarBeQue 04-10-2004 09:16 PM

Ok, i fixed my prob myself.

I removed the
PHP Code:

$statsupdate "<font color=green>Last updated at $getupdatetime</font>&nbsp;"

from the orig place

Then AFTER the update stats "if" statement ended and the stats update time was added to the cache i added this:

PHP Code:

$getupdatetime vbdate("$vboptions[timeformat] - F jS, Y"$statscache['lastupdate']);
$statsupdate "<font color=green>Last updated at $getupdatetime</font>&nbsp;"

Now it updates the queries AND the last update time at the same moment, when all the queries run.
See screenshot

yay!

Boofo 04-10-2004 09:18 PM

That's the way I have it on my site. I just never chnaged it in the file on here. Oops! ;)

BarBeQue 04-10-2004 09:21 PM

lol

glad it's fixed

Great hack!

Boofo 04-10-2004 09:25 PM

You had doubts? ;)

surfhog 04-11-2004 08:23 PM

thanks boofo

finally this appears to work now without any errors :)

I will post on the other threa ref forum quick stats, which i still have error :(


Quote:

Originally Posted by Boofo
Ok, here is your fix.

Replace the top referrer code in the index.php with this:

PHP Code:

    // <!-- TOP REFERRER -->
    
$ref $DB_site->query_first("
        SELECT COUNT(*) AS referrals, user.username, user.userid
        FROM " 
TABLE_PREFIX "user AS users
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (users.referrerid = user.userid)
        WHERE users.referrerid <> 0
        AND users.referrerid NOT IN (1)
        GROUP BY users.referrerid
        ORDER BY referrals
        DESC LIMIT 1
    "
); 

Thanks to NTLDR for fiinding my mistake. ;)


Boofo 04-11-2004 09:07 PM

Quote:

Originally Posted by surfhog
thanks boofo

finally this appears to work now without any errors :)

I will post on the other threa ref forum quick stats, which i still have error :(

See? Now aren't you glad I didn't let you give up (in the pm)? ;)

Don't forget the install button, my friend. ;)

surfhog 04-11-2004 09:13 PM

yes, yes and yes lol *hit install button*=yes

Thank you so much for your brilliant support :)


All times are GMT. The time now is 02:34 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.02477 seconds
  • Memory Usage 1,759KB
  • 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
  • (5)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
  • (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