Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

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
  #2  
Old 09-27-2005, 04:26 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1st to install I see. Will post back in time with comments.
Reply With Quote
  #3  
Old 09-28-2005, 01:18 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The drawback seems less severe than using the built-in system all the time, based on your explanations. Is that correct?
Reply With Quote
  #4  
Old 09-28-2005, 08:01 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes. As pointed out, in most cases the first query (which I added) should catch the necessary data.
Only if it does not it will make a fallback to the default code.
Reply With Quote
  #5  
Old 09-28-2005, 01:21 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I just found out my webhost only has MySQL 4.0.25. So I'll have to wait...
Reply With Quote
  #6  
Old 09-28-2005, 01:26 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Erm ... MySQL 4.0.25 is newer than MySQL 4.0.4.
All MySQL Versions > 4.0.4 should work just fine
Reply With Quote
  #7  
Old 09-28-2005, 01:30 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

d'Oh!

Yeah, 25 is greater than 4. I apparently had mentally ignored the 5 and just saw the 2, and said that's less than 4...
Reply With Quote
  #8  
Old 09-28-2005, 01:41 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, just one question: After importing the product, should the "Show Last Post on Profile Page" option in the "User Listing & Profile Viewing" section of the options be on or off? I just wasn't certain if turning it on meant it was using the built-in system or if your hack replaces the built-in system with your own.
Reply With Quote
  #9  
Old 09-28-2005, 01:47 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On. If it is off, then it is completely off.
This Hack replaces/extends the built-in system.
Reply With Quote
  #10  
Old 11-08-2005, 10:44 AM
ThorstenA's Avatar
ThorstenA ThorstenA is offline
 
Join Date: Nov 2004
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A handful users complain that if they create a new post while receiving a private message, they'll get a fatal error

Quote:
Fatal error: Call to a member function on a non-object in .../includes/class_dm_user.php(1427) : eval()'d code on line 3
Reply With Quote
Reply

Thread Tools

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 11:51 AM.


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.06794 seconds
  • Memory Usage 2,288KB
  • Queries Executed 23 (?)
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_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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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