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

Reply
 
Thread Tools
CES Intelligent Attachment Query Details »»
CES Intelligent Attachment Query
Version: 1.3.0, by thincom2000 thincom2000 is offline
Developer Last Online: Sep 2022 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.x Rating:
Released: 01-26-2007 Last Update: 03-25-2007 Installs: 19
Uses Plugins
Code Changes  
No support by the author.

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!)

Show Your Support

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

Comments
  #12  
Old 01-29-2007, 12:11 AM
Get Shorty's Avatar
Get Shorty Get Shorty is offline
 
Join Date: Jun 2006
Location: Baton Rouge, LA
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #13  
Old 01-29-2007, 10:18 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 01-29-2007, 12:17 PM
Get Shorty's Avatar
Get Shorty Get Shorty is offline
 
Join Date: Jun 2006
Location: Baton Rouge, LA
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #15  
Old 01-29-2007, 10:00 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #16  
Old 01-29-2007, 10:07 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Basically you need to find:
PHP Code:
attach.dateline AS attachdateattach.thumbnail_datelineattach.filenameattach.filesizeattach.visible 
and change:
PHP Code:
attach.visible 
to:
PHP Code:
attach.visible AS attachvisible 
That should fix your "all attachments are moderated" woes.

Not having this resulted in $attachment['visible'] being false, which class_postbit.php interpreted as the attachment requiring moderation to become visible.
Reply With Quote
  #17  
Old 01-29-2007, 11:04 PM
TheFrienzNet's Avatar
TheFrienzNet TheFrienzNet is offline
 
Join Date: Jan 2007
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, it works.
Reply With Quote
  #18  
Old 01-30-2007, 02:05 AM
Get Shorty's Avatar
Get Shorty Get Shorty is offline
 
Join Date: Jun 2006
Location: Baton Rouge, LA
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thincom2000 View Post
Basically you need to find:
PHP Code:
attach.dateline AS attachdateattach.thumbnail_datelineattach.filenameattach.filesizeattach.visible 
and change:
PHP Code:
attach.visible 
to:
PHP Code:
attach.visible AS attachvisible 
That should fix your "all attachments are moderated" woes.

Not having this resulted in $attachment['visible'] being false, which class_postbit.php interpreted as the attachment requiring moderation to become visible.
Trying it again...
Reply With Quote
  #19  
Old 02-03-2007, 09:48 PM
Skyline_GT Skyline_GT is offline
 
Join Date: May 2003
Location: Vancouver, BC
Posts: 482
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems this does not remove a query for my forum.
Reply With Quote
  #20  
Old 02-04-2007, 01:44 AM
Get Shorty's Avatar
Get Shorty Get Shorty is offline
 
Join Date: Jun 2006
Location: Baton Rouge, LA
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't notice a difference either.
Reply With Quote
  #21  
Old 02-04-2007, 02:00 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
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 05:25 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.06355 seconds
  • Memory Usage 2,311KB
  • Queries Executed 25 (?)
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
  • (6)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
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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