![]() |
CES Intelligent Attachment Query
CES Intelligent Attachment Query
Version: 1.3.0 Version 1.3.0 has no real changes other than now being a product. Now requires CES Pre-Process Hooks. *** NEWS *** 3/25/2007 - v1.3.0 (product version) released ------------------------------------------------------ 1/28/2007 - v3.0.0 released 1/27/2007 - v1.0.0, v2.0.0, v2.0.1 released I actually came across this while trying to reduce queries in my CES Site News mod which uses a customized showthread.php. Known Issues: - NONE What It Does: Normally showthread wastes a query on attachments by checking if the thread has an attachment in any post, not bothering to check if that post and attachment are even on the current page, then querying for the page's posts. This hack removes a potentially unnecessary query from showthread.php by joining queries. I hope someone from Jelsoft sees this thread. Mod Features: - removes 1 pointless query Products to Install: 1 Plugins Included: 2 Files to Upload: 0 Files to Edit: 1 New Templates: 0 Template Edits: 0 Queries Added*: -1 *See "What It Does" for details. *** Changelog *** As of Version 1.3.0: - only 1 file edit - requires CES Pre-Process Hooks - uses vBulletin's Plugin system - changed version numbering (confusion!) |
saved a copy of showthread, edited it, and copied over.....
least the boards still running....cant say ive noticed the saved query tho?? |
The query is only saved if there is an attachment anywhere in the thread and not on the page.
vBulletin by default will make a query in that situation. So in normal forum/showthread use, you would not notice a drop in queries. |
I uploaded version 2.0 which completely eliminates 1 query from showthread.php (even on the pages with attachments) if there is an attachment somewhere in the thread.
|
Forgive my stupidity, but I have to wonder if the one-less query makes up for all the new commands processed in showthread... :confused:
|
I get errors:
Code:
Database error in vBulletin 3.6.4: This was a thread that didn't have any attachments. I've reverted back for now. |
|
It's because there's a comma missing. This problem was fixed in version 3.0.0.
|
Quote:
|
Trying again... I'll post back with my results in a bit.
|
Everything seemed to work, except for one problem. All of the current attachments showed up as "attachments pending approval".
Reverted back to normal for now... |
This should not be happening... I'll look into it later today.
Do you have usergroups who need attachment moderation? Because I can't even figure out how to set that. |
No. Anyone can post attachments without moderation, excluding guests. The forum was restricted to certain usergroups. I didn't check in the open forums... whoops
|
Okay, this was caused by a typo I made in the 3.0 install file (that I didn't make in my test which is why I didn't understand the problem). Uploading the non-typo'd version now.
|
Basically you need to find:
PHP Code:
PHP Code:
PHP Code:
Not having this resulted in $attachment['visible'] being false, which class_postbit.php interpreted as the attachment requiring moderation to become visible. |
Thanks, it works. :)
|
Quote:
|
It seems this does not remove a query for my forum.
|
I didn't notice a difference either.
|
vBulletin only adds a query for attachments when the thread has an attachment somewhere.
This hack rearranges the code so that the query doesn't have to be added. The fact that you didn't notice a query removed means nothing, since this hack only prevents a query from being added, much like caching an uncached template in $globaltemplates, only with attachments. |
I am attempting to install this plugin on vBulletin 3.7 PL1. I have installed the latest version of CES Pre-Process Hooks (just the showthread portion), but this plugin keeps complaining that the dependancy on that script has not been met.
|
I will look into this when I rewrite this for 3.7.
|
All times are GMT. The time now is 06:07 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:
|