vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Optimization for "Last Post in Profile" (https://vborg.vbsupport.ru/showthread.php?t=96999)

Andreas 09-26-2005 09:00 PM

Optimization for "Last Post in Profile"
 
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

The Realist 09-27-2005 03:26 PM

1st to install I see. Will post back in time with comments.

JJR512 09-28-2005 12:18 AM

The drawback seems less severe than using the built-in system all the time, based on your explanations. Is that correct?

Andreas 09-28-2005 07:01 AM

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.

JJR512 09-28-2005 12:21 PM

Well, I just found out my webhost only has MySQL 4.0.25. So I'll have to wait...

Andreas 09-28-2005 12:26 PM

Erm ... MySQL 4.0.25 is newer than MySQL 4.0.4.
All MySQL Versions > 4.0.4 should work just fine :)

JJR512 09-28-2005 12:30 PM

d'Oh!

Yeah, 25 is greater than 4. :D I apparently had mentally ignored the 5 and just saw the 2, and said that's less than 4... :o

JJR512 09-28-2005 12:41 PM

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.

Andreas 09-28-2005 12:47 PM

On. If it is off, then it is completely off.
This Hack replaces/extends the built-in system.

ThorstenA 11-08-2005 10:44 AM

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


All times are GMT. The time now is 11:10 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.01987 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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