![]() |
[Improvement] vBStats -> Member Referrer list PHP-code improvement (much less queries
HACK: [Improvement] vBStats -> Member Referrer list PHP-code improvement (much less queries)
BY: KuraFire [www.kurafire.com] DESCRIPTION: Instead of using 1 query for every member that has referred someone to your forum, this new code will use only 2 queries for it all, allowing you to set your Referrermax variable in the vB stats as high as you want, you'll not get 150 queries if you have 150 referring members or anything, anymore :) DIFFICULTY: Easiest :D INSTALL-TIME: 1 minute I'd say :) extended description: What the default vBStats Member referrer list bit does, is loop through all users who have referred a member to your board, and for each user it runs an additional query to select all the usernames of that user's referrerlist. My code improvement eliminates that and simply uses 1 query for all the users in the left column (referrers), 1 query for all the users in the right column (referrals) and some PHP intelligence to get the same result. No more query-per-user. 2 queries are all that remains, and a bit of PHP looping (not much). Now you can display your entire list without having to fear for the page needing God knows how many queries in total :) (it had 52 queries on first guest view in the old default way when I'd not limit the amount of users it'd display, it has 12 now... :)) Instructions are in the attachment :) Enjoy, vBStats users :) Disclaimer: I spoke with Bane about this a long time ago and he was happy I was improving his code cos he didn't have the time for it. I doubt he'd mind me releasing it now that I've gotten around to doing it, but if he does, I'll take it down... :) |
Nice work, implemented it on my site and page loads faster, less less less queries and works with 2.2.9 :)
|
This works on any board where vBStats works :)
as long as you haven't brutally raped your vbstats.php code anyway ;) |
funny, so many people have vBStats yet hardly anyone has noticed this..
*goes post a notice in the vbstats thread* ^_^ |
Nice mod :)
Did you ask bane for permission ;) - miSt |
Great work - no-one should really be fretting if their work is improved upon IMO ...
:D |
Mist: pah! ;p
Natch: I agree ^_^ |
Yes well i can't see why he would mind it's just always nice to ask these things to the respective creator :)
- miSt |
Well done Kura :) Should I get a chance to upgrade vbstats I will with your permission use this code. =) Very well done.
|
Yay, Bane's approval ^_^
;) Feel free to use this code in your new vBStats if you end up making that. I'm working on an alternative for vBStats, a stats system that doesn't do as much queries before a page even starts (like vBStats) and has a bunch of other features and is more flexible... (and, no offense, some cleaner code...) oh, and my point was, I'll be using my own code in that new Stats hack for the referrerlist (though we will be using a different template-style for the display) :) |
Wow Bane's here! :)
Welcome back buddy - miSt |
Quote:
|
flexible?
|
will do ^_^
though it'll probably just go in the Beta hack forum :) |
Quote:
yeah, more control on what all is seen and more power on who can see what, and easier to adjust the look of, mostly :) and also flexible like more modular, i.e. ability to add parts/new features at a later point :) |
Nice job, I'll install this. :)
|
Kura,
at phpportals, we have a Top10 module, which pulls things like top links, top files, top threads, top posters, etc. It also pulls top referrers. with your permission, I'd like to change the code of the top refererrers to use yours, so as to dramatically reduce the queries. regards scotsmist (dev @ phpportals) |
thebigboss: sure, go right ahead. I'd really appreciate it if you'd give me credit for it somewhere visible, though :)
(*hinthint* ;)) But feel free to use it :) |
kura, thanks.
I've put your name at the top of the script, but to put it in the html output may, not appeal to most, as its in a nice table. see here - http://www.phpportals.com/modules.php?s=&name=Top o course, the Top 10 Refererrers only shows if Refererrers are active in vbulletin admin. I'll also add to the credits page http://dev.phpportals.com/modules.php?s=&name=Credits , so it will be in the next release of vbportal. I'll do that as soon as I get a spare 5 :) regards scotsmist |
Great, thx :)
's fine like this, thank you & you're welcome ^_~ |
Nice...I will be installing this improvement on my next site update:)
Satan |
btw, Bane, maybe it's a good idea to link to this from the vBStats thread's initial post?
:up: hellsatan ^_^ (ps nice avatar ;)) |
I sent out an update, because I released another Improvement-to-vBStats hack:
https://vborg.vbsupport.ru/showthrea...threadid=48869 Enjoy ^_^ |
This has been fixed in the newest version of vbStats.
|
All times are GMT. The time now is 04:46 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|