Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[Improvement] vBStats -> Member Referrer list PHP-code improvement (much less queries Details »»
[Improvement] vBStats -> Member Referrer list PHP-code improvement (much less queries
Version: 1.00, by KuraFire KuraFire is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-12-2003 Last Update: Never Installs: 15
 
No support by the author.

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
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...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-24-2003, 07:00 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice...I will be installing this improvement on my next site update

Satan
Reply With Quote
  #23  
Old 02-06-2003, 01:43 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

btw, Bane, maybe it's a good idea to link to this from the vBStats thread's initial post?

:up: hellsatan ^_^

(ps nice avatar )
Reply With Quote
  #24  
Old 02-13-2003, 09:04 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I sent out an update, because I released another Improvement-to-vBStats hack:

https://vborg.vbsupport.ru/showthrea...threadid=48869

Enjoy ^_^
Reply With Quote
  #25  
Old 02-15-2003, 08:31 AM
Bane's Avatar
Bane Bane is offline
 
Join Date: Oct 2001
Posts: 411
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has been fixed in the newest version of vbStats.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06100 seconds
  • Memory Usage 2,238KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete