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?

Owen 03-28-2004 05:10 PM

<a href="http://www.vxforums.com" target="_blank">www.vxforums.com</a> live!

Boofo 03-28-2004 05:16 PM

Is there a test account?

Owen 03-28-2004 05:28 PM

didnt realise...
uhm not really.

here:
Last updated at 07:13 PM - March 28th, 2004 Threads: 3,691 (2 Today), Posts: 54,677 (31 Today), Thread Views: 391,961
Total Registrations: 2336, Active Registrations: 2,336
There has been 1 new thread and 5 new posts since your list visit, Owen.
Top Poster: Owen (4,831 Posts = 8,475.44%)
Top Thread Starter: SSJ3 Goten (214 Threads = 7,133.33%)
Top Referrer: danthemansloan (5 Referrals)
Top Reputation: Owen (21 Reputation Points)
Most Viewed Profile: SSJ3 Goten (582 Views)
A warm welcome goes out to our newest member, ((0.1)).

Owen 03-28-2004 05:29 PM

it got unfixed...

Boofo 03-28-2004 05:53 PM

But it was working? For how long?

Owen 03-28-2004 06:00 PM

less than an hour I think...

Boofo 03-28-2004 06:25 PM

Go in and optimize and repair your tables in the Admin CP when you get a minute and see if that fixes it again. ;)

Owen 03-28-2004 06:33 PM

nope didnt fix it...

Boofo 03-28-2004 06:41 PM

Also, do a hard refresh (CTRL+F5) and see if it fixes it. If it worked for an hour then the code HAS to be right, or it wouldn't work right at all.

Owen 03-28-2004 07:13 PM

still not working... I downloaded my index.php to make sure the code was still in there... It is..

lasto 03-28-2004 09:30 PM

nice one boofo - good to know theres an update :)

lasto 03-28-2004 10:01 PM

Boofo seeing as u good at stats is there any chance of this option

u know when in admin cp it sshows this

New Posts Today 1 New Threads Today 1

and have it reset at say 12 midnight ?

be even better if u can get it to say what the stats where for the previousday but i know im pushing me luck :)

Beermonster 03-29-2004 07:15 AM

Thanks will be installing this one :)

Boofo 03-29-2004 07:19 AM

Quote:

Originally Posted by lasto
Boofo seeing as u good at stats is there any chance of this option

u know when in admin cp it sshows this

New Posts Today 1 New Threads Today 1

and have it reset at say 12 midnight ?

be even better if u can get it to say what the stats where for the previousday but i know im pushing me luck :)

It resets at whatever time you have the board set at in the Admin CP.

Previous day stats would require another query or two, I'm afraid. ;)

lasto 03-29-2004 07:23 AM

yeah cheers boofo but id like to see how many posts and threads where done each day not so bothered if u cant do previous days though :)

Boofo 03-29-2004 07:31 AM

That will be in the update when I get it all together as well as percentages if I can get those all worked out for larger boards. ;)

Don't forget to click the install button so you can be notified when the update is released. ;)

blakkboy 03-31-2004 02:47 PM

i dont know how to do this part

Quote:

Turn on DEBUG and go to the Admin CP > vBulletin Options

Add New Setting:

Varname: forumhomecachetime
Setting Group: Forums Home Page Options
Title: Forumhome Stats Cache Update Time
Description: This setting allows you to set the interval (in minutes) between the Forumhome Stats Cache updates.
Option Code: leave blank
Default: 10
Display Order: 55
vBulletin Default: No

Boofo 03-31-2004 02:53 PM

Quote:

Originally Posted by blakkboy
i dont know how to do this part

Check this post out. ;)

https://vborg.vbsupport.ru/showpost....4&postcount=47

And don't forget to click install. I will be updating this hack in the next few days. ;)

blakkboy 04-01-2004 04:22 AM

^^^ niiice

sabret00the 04-01-2004 09:16 AM

can you make it do a thread of the day as well boofo?
ala https://vborg.vbsupport.ru/showthread.php?t=61260 but to fit into the current display style.

Boofo 04-01-2004 09:35 AM

Haven't you figured out by now that I can do almost anything, sabret00the? Sure, I do most of it badly, but I do it! ;)

It can be added probably very easily. You just have to let me know how you want it to look with the thread of the day and I will see what I can do about adding it. I added (in my site version only so far) the member of the day hack by kentaurus (with his total permission, I might add) already so this shouldn't be too much of a chore to add to this hack, even for an idiot of my caliber. ;)

sabret00the 04-01-2004 09:39 AM

a line just above the top poster line would be fine, just to say
Thread Of the Day is: vB3 Forumhome Stats Cache Serialize hack v2.2
not sure what query you'd do to decide thread of the day, but it would be good.

Boofo 04-01-2004 09:48 AM

Wouldn't need a query. Just use the hack with the cron job and rearrange the code for the variable and VOILA! A homemade thread of the day addition to this hack. ;)

sabret00the 04-01-2004 09:53 AM

you lost me :(

Boofo 04-01-2004 10:00 AM

I t ' s...e a s y...t o...a d d. ;)

By the way, you DID vote for this hack in the HOTM, right? ;)

Now we need to get the others to do it. ;)

sabret00the 04-01-2004 10:20 AM

we do need others to do it ;) it's a great hack, not to mentio you erwin and xenon seem to have the monopoly on hacks on my test board, so you deserve credit

Boofo 04-01-2004 10:47 AM

Yes, but wouldn't it be nice to be running a hack of the month on your board, too? ;)

And I meant that we need others to vote for it, too. ;)

sabret00the 04-01-2004 01:54 PM

it's being worked on :ninja:

Seby 04-04-2004 07:52 PM

I just installed the hack and all the percentages don't work, anything I can do to fix it?

Cheers,
Sebastian

Boofo 04-04-2004 07:56 PM

I'm working on that and I might have a fix. If you want to test it out, pm me and I will tell you what to do with it. ;)

Please click the install button too as there will be an upgrade soin with the fix and some more stats added to it. ;)


All times are GMT. The time now is 05:49 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.02649 seconds
  • Memory Usage 1,842KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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