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)

Boofo 03-28-2004 02:11 PM

Quote:

Originally Posted by Owen
I can't find $stats['activepercent'] in my code or in the txt installation file...

What percentage codes do you have then?

djohn 03-28-2004 02:46 PM

Quote:

Originally Posted by Boofo
What is fixed?

Problem with displaying the stats block in Opera
Quote:

And no, there's no way to do that. Look at the advanced search box and you will see that is how the panels work in vB3. Sorry. ;)
Ah well, after all it's not something i badly needed. Doesn't matter, thanks for your hack and your support, anyway!

Owen 03-28-2004 02:57 PM

// Ditch the 2 decimal zeros on a whole percent ...
if (($statscache['topposterpercent'] % 10) == 0)
$statscache['topposterpercent'] = vb_number_format($statscache['topposterpercent']) . '%';
else
$statscache['topposterpercent'] = vb_number_format($statscache['topposterpercent'], 2) . '%';

// Ditch the 2 decimal zeros on a whole percent ...
if (($statscache['topthreadspercent'] % 10) == 0)
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent']) . '%';
else
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent'], 2) . '%';

This one?

Boofo 03-28-2004 03:13 PM

No above all of that. It would have something like this in it:

numbermembers / $newuserid

Mijae 03-28-2004 03:53 PM

That code isnt in my index.php, or the txt file.

???

Boofo 03-28-2004 03:55 PM

Ok, give me the code you have ABOVE what Owen posted.

Owen 03-28-2004 03:59 PM

$statscache['newthreads'] = intval ($newestthreads[count]) ;
$statscache['newposts'] = intval ($newestposts[count]);
$statscache['newusers'] = intval ($newestusers[count]);
$statscache['getthreadviews'] = intval ($getthreadviews[tviews]);
$statscache['topposter'] = $topposter[username];
$statscache['topposterid'] = intval ($topposter[userid]);
$statscache['toppostercount'] = intval ($topposter[posts]);
$statscache['topposterpercent'] = round(100 * ($topposter[posts] / ($totalthreads + $totalposts)), 2);
$statscache['topstarter'] = $topstarter[postusername];
$statscache['topstarterid'] = intval ($topstarter[postuserid]);
$statscache['topstartercount'] = intval ($topstarter[count]);
$statscache['topthreadspercent'] = round(100 * ($topstarter[count] / $totalthreads), 2);
$statscache['getfileviewsun'] = $getfileviews[username];
$statscache['getfileviewsid'] = intval ($getfileviews[userid]);
$statscache['getfileviews'] = intval ($getfileviews[profileviews]);
$statscache['ref2'] = $ref[username];
$statscache['topreferrerid'] = intval ($ref[userid]);
$statscache['ref'] = intval ($ref[referrals]);
$statscache['toprepun'] = $toprep[username];
$statscache['toprepid'] = intval ($toprep[userid]);
$statscache['topreprep'] = intval ($toprep[reputation]);
$statscache['lastupdate'] = intval (TIMENOW);

there is this...

Boofo 03-28-2004 04:13 PM

Great! Ok, here we go!

Replace these 2 lines in that code:

PHP Code:

$statscache['topposterpercent'] = round(100 * ($topposter[posts] / ($totalthreads $totalposts)), 2);
$statscache['topthreadspercent'] = round(100 * ($topstarter[count] / $totalthreads), 2); 

with this:

PHP Code:

if($statscache['topposterpercent'] > 100

$statscache['topposterpercent'] = vb_number_format(($topposter[posts] / ($totalthreads $totalposts)) * 100 1000) . '%'

else 

$statscache['topposterpercent'] = vb_number_format(($topposter[posts] / ($totalthreads $totalposts)) * 1002) . '%'


if(
$statscache['topthreadspercent'] > 100

$statscache['topthreadspercent'] = vb_number_format(($topstarter[count] / $totalthreads) * 100 1000) . '%'

else 

$statscache['topthreadspercent'] = vb_number_format(($topstarter[count] / $totalthreads) * 1002) . '%'


and delete these:

PHP Code:

// Ditch the 2 decimal zeros on a whole percent ...
if (($statscache['topposterpercent'] % 10) == 0)
$statscache['topposterpercent'] = vb_number_format($statscache['topposterpercent']) . '%';
else
$statscache['topposterpercent'] = vb_number_format($statscache['topposterpercent'], 2) . '%';

// Ditch the 2 decimal zeros on a whole percent ...
if (($statscache['topthreadspercent'] % 10) == 0)
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent']) . '%';
else
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent'], 2) . '%'

and let me know what happens. make sure you set the update time at 0 to test this.

Owen 03-28-2004 04:38 PM

YUPS! It works! Thanks man.

Boofo 03-28-2004 05:00 PM

Can you post a screenshot so I can see it?


All times are GMT. The time now is 03:11 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.01489 seconds
  • Memory Usage 1,763KB
  • 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
  • (3)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