Quote:
Originally Posted by Nj?rd Eriksson
Great hack, Boofo, but ...
... percentages still don't work (yes, I applied the changes you suggested.)
... I have a style-problem. The stats window is displayed in some sort of default vBulletin style in all my six styles to which I applied the modified FORUMHOME template (see screenshot.)
Do you have a fix for this? 
|
1. Fix for my style problem (might not be universal but did the job for me):
In the
FORUMHOME template, replace:
HTML Code:
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
<tr>
<td class="panelsurround" align="center" colspan="6">
<table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td align="$stylevar[left]">
<fieldset class="fieldset" style="margin:0px">
With:
HTML Code:
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
<td class="alt1" align="center" colspan="6">
<table class="alt1" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td align="$stylevar[left]">
<fieldset class="alt1" style="margin:0px">
2. Fix for the incorrect displayed percentages (not universal, works probably only for certain larger boards):
This fix is a modification of
Boofo's modification which you can find here:
https://vborg.vbsupport.ru/showpost....&postcount=208
In
index.php replace:
PHP Code:
$statscache['topposterpercent'] = round(100 * ($topposter[posts] / ($totalthreads + $totalposts)), 2);
$statscache['topthreadspercent'] = round(100 * ($topstarter[count] / $totalthreads), 2);
With:
PHP Code:
$statscache['topposterpercent'] = vb_number_format(($topposter[posts] / ($totalthreads + $totalposts)) * 100 / 1000, 2 ) . '%';
$statscache['topthreadspercent'] = vb_number_format(($topstarter[count] / $totalthreads) * 100 / 1000, 2 ) . '%';
And delete this:
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) . '%';