Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Optimization for "Last Post in Profile" Details »»
Optimization for "Last Post in Profile"
Version: 1.0.1, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Version: 3.5.0 RC3 Rating:
Released: 09-26-2005 Last Update: 09-27-2005 Installs: 11
DB Changes Uses Plugins
Is in Beta Stage  
No support by the author.

Optimization for "Last Post in Profile"

Description
vBulletin has a feature to display information about the last post made by a user in his profile.
However, this can be very server intensive:

Quote:
Originally Posted by vBulletin Admin Control Panel
Show Last Post on Profile Page
Showing the last post on a member profile can cause large table scans which leads to table locking.
This may increase load time on your forums as well as the load of your server.
This option should only be enabled for smaller forums.
These table scans are necessary because vBulletin does not know if the last post is accessible (eg. not soft-deleted, not in moderation and not in a forum where the viewing user does not have access rights).
But: How often does it happen that the last post is NOT accessible?

If your answer is seldom, then this Hack is for you:
It directly fetches the last post info in this case, without the need for any table scans.

Drawback: If the last post is NOT accessible, then it causes one additional, pretty light query and some PHP processing in member.php.

More background Info: http://www.vbulletin.com/forum/bugs3...iew&bugid=1405

ATTENTION: Due to Multi-Table UPDATEs being used in the installation code of this product, you will need at least mySQL 4.0.4 in order to install this properly.
If you install it with an older Version, it will still work - however it will always cause the additional query then for all users until they have made a new post.

History
1.0.0
Initial Version

1.0.1
Minor Bugfix

Show Your Support

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

Comments
  #12  
Old 11-08-2005, 11:02 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm ... could be.

Change the condition in Hook userdata_presave from

PHP Code:
if (THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'newthread'
to

PHP Code:
if ((THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'newthread') AND is_object($this->registry->dmref)) 
Reply With Quote
  #13  
Old 11-08-2005, 03:34 PM
ThorstenA's Avatar
ThorstenA ThorstenA is offline
 
Join Date: Nov 2004
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the same error occurs ... I have disabled the plugin. Thanks for your very quick help anyway!
Reply With Quote
  #14  
Old 11-08-2005, 04:50 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm .. strange
The condition explicitly checks if it is an object.

Do you have other Plugins on the same Hook?

I tried to reproduce this:

- Clicked reply in a Thread
- Took another browser, sent myself a new PM
- Submitted the newreply form

No problems.

Can you tell me exactly how to reproduce the error?
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 08:30 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.04209 seconds
  • Memory Usage 2,244KB
  • Queries Executed 20 (?)
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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (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
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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