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

Reply
 
Thread Tools
CES Intelligent Postbit Query Details »»
CES Intelligent Postbit Query
Version: 1.0.1, 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-27-2007 Last Update: 02-02-2007 Installs: 28
Code Changes  
No support by the author.

CES Intelligent Postbit Query
Version: 1.0.1

This hack is now used as a troubleshooting tool for members with unusually high queries on showthread. You do not need to install this unless your queries peak around 20 or higher.

Note that if after installing this you experience a drop in queries, it means you have a bad plugin installed. Leaving this installed, while this does not hurt your forum at all, does not solve your query problem - it only now hides it.

To disable the tool, you only need to change the line:
PHP Code:
$lastcheck = ($lastfetchtype == $fetchtype) ? true false
to:
PHP Code:
// $lastcheck = ($lastfetchtype == $fetchtype) ? true : false; 
Post your query success stories in the thread!

For those without success (i.e. it doesn't seem to make a difference), please don't uninstall, but help us determine what is different in your case. PHP version, MySQL version, hacks installed, PHP cache, etc. would all be useful information. Thanks!


*** NEWS ***
This section has become a list of bad plugins. Often these plugins can be optimized by a rewrite using a different hook, and thus not causing this query issue.

Product: Username Management
Hook Location: postbit_factory
Bad Plugin: Add Username history to postbit(legacy)

1/28/2007 - v1.0.0, v1.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

- Some users see an amazing improvement, others do not see a difference in query count for some time, while still others don't see any difference at all. It all depends on your server setup and your current vBulletin installation (settings, other mods, etc). This hack is still young (1 day) so we haven't narrowed down what causes these differences in success.

- If you are still experiencing the stolen signatures issue, you need to clear your sig_cache. Do this by going to AdminCP -> Maintenance -> Update Counters -> Empty Signature Cache.

What It Does:
On some installations showthread wastes 1 query per post in showthread.php when creating the postbits. You can tell if this applies to your installation if you approach or exceed 20 queries on a page of only 10 or so posts.

By adding these 4 lines, showthread checks to see if it already has created the appropriate Postbit Factory object instead of doing it all over again. Queries on showthread are thus DRASTICALLY reduced (1 per post), even though the code reveals no direct database references.

This can be a HUGE performance boost.

I hope someone from Jelsoft sees this thread...

Mod Features:
- removes multiple pointless queries

Products to Install: 0
Plugins Included: 0
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.0.1:
- fixed bug where posts would "steal" signatures from each other
Special thanks to TheFrienzNet for his help ^_^

Show Your Support

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

Comments
  #22  
Old 01-28-2007, 05:18 PM
Kiros72 Kiros72 is offline
 
Join Date: Apr 2006
Location: Albany, LA - USA
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks - trying it out now

Edit:

I'm getting the same bug as well - signatures messing up.
I'm not exactly sure why but it seems that there's no difference. 10 queries per page with or without this hack (10 posts per page as well) - or at least that's what I'm getting from the Microstats.
Reply With Quote
  #23  
Old 01-28-2007, 05:46 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had sigs turned off on my forum while testing this yesterday so I didn't notice. I will look into this issue.

Quote:
Originally Posted by Kiros72
I'm not exactly sure why but it seems that there's no difference. 10 queries per page with or without this hack (10 posts per page as well) - or at least that's what I'm getting from the Microstats.
A number of users have reported this just to edit their post 20 minutes later saying how awesome the changes were. If you are getting 10 queries per page it sounds like it's working (without the hack on a 10 post page should be about 20 queries). Are you using a PHP cache?
Reply With Quote
  #24  
Old 01-28-2007, 05:54 PM
TheFrienzNet's Avatar
TheFrienzNet TheFrienzNet is offline
 
Join Date: Jan 2007
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks thincom2000, but could you do it fast? I know I sound like a jerk but there are over 9,000 signatures messed up and my higher ranked bosses will be mad at me..

*Edit*

I got it fixed! In order to fix it, you must do 'Empty Signature Cache' in Maintenance! Thincom2000, I guess you have to update the readme.

*ReEdit*

Okay, I did that 'Empty Signature cache' but it worked only for a few minutes, after that it got messed up again. At the meantime, I will change the line back to what it was and run that 'Empty Signature Cache' maintenance script. Thank you Thincom2000.
Reply With Quote
  #25  
Old 01-28-2007, 06:01 PM
tanyeri24 tanyeri24 is offline
 
Join Date: Feb 2005
Location: Switzerland
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this line twice:
$postbit_obj =& $postbit_factory->fetch_postbit($fetchtype);

Replace both like the lines in the .txt file?
Reply With Quote
  #26  
Old 01-28-2007, 06:03 PM
TheFrienzNet's Avatar
TheFrienzNet TheFrienzNet is offline
 
Join Date: Jan 2007
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tanyeri24 View Post
I have this line twice:
$postbit_obj =& $postbit_factory->fetch_postbit($fetchtype);


Replace both like the lines in the .txt file?
Yes, if you want. One line is for hybrid mode and the normal view, but it's better doing it anyways. However, it's bugged, your user's signatures will be messed up.
Reply With Quote
  #27  
Old 01-28-2007, 06:08 PM
tanyeri24 tanyeri24 is offline
 
Join Date: Feb 2005
Location: Switzerland
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheFrienzNet View Post
Yes, if you want. One line is for hybrid mode, but it's better doing it anyways. However, it's bugged, your user's signatures will be messed up.
Installed :up:
Reply With Quote
  #28  
Old 01-28-2007, 06:09 PM
TheFrienzNet's Avatar
TheFrienzNet TheFrienzNet is offline
 
Join Date: Jan 2007
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You will experience a few bugs with users signatures. So I don't recommend it, yet.
Reply With Quote
  #29  
Old 01-28-2007, 06:21 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just turned them back on and I am not experiencing any issues with my user's signatures.

Looks like I'm going to need more info from you guys. What usergroups are experiencing this problem? What permissions do they have? Do you have any sig-modifying hacks installed? Where signatures messed up on new posts or old ones?
Reply With Quote
  #30  
Old 01-28-2007, 06:37 PM
Kiros72 Kiros72 is offline
 
Join Date: Apr 2006
Location: Albany, LA - USA
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From what I can tell, if this affects one usergroup, it should affect them all, however, I first noticed it with Registered Users. I'm not certain if anyone else is being effected because I had to revert the changes - users were starting to complain about how someone "stole" their signature.

The Registered Users have set signature permissions as follows:

Can Use Signatures: Yes
Maximum Characters in Signature Including BBCode Markup: 550
Maximum Characters in Signature Excluding BBCode Markup: 450
Maximum Lines in Signature: 8
Allow BB Code: Yes
Allow Basic BBCode: Yes
Allow Color BBCode: Yes
Allow Size BBCode: Yes
Maximum Value of x for SIZE=x BBCode: 5
Allow Font BBCode: Yes
Allow Alignment BBCode: Yes
Allow List BBCode: Yes
Allow Link BBCode: Yes
Allow Code BBCode: Yes
Allow PHP BBCode: No
Allow HTML BBCode: No
Allow Quote BBCode: Yes
Allow IMG Code: Yes
Maximum Number of Images in Signature: 8
Allow Smilies: Yes
Allow HTML: No

The only signature hack that I have is one that modifies the modifysignature template. If I'm thinking clearly, that only modifies the UserCP "Edit Signature" jazz. The hack that I have for it is the "Custom Sig Permissions Display" - for reference.

The first time I noticed this bug was at the first post of a thread - the first poster's signature was copied to the second poster's signature area. It was a total overwrite, not an addition. I looked to see if that was consistent, however, I didn't come across another instance like it before I went to revert the file.

Edit:

Also, I think you might have to have several members and several posts in a thread for this bug to appear - just a guess.

Edit 2:

As a note, I've had the file reverted for about 15 minutes (at least) and I'm still getting only 10 queries on a thread with 10 posts per page. I'm not sure this hack had an effect or not. :?
Reply With Quote
  #31  
Old 01-28-2007, 06:44 PM
jedisct1 jedisct1 is offline
 
Join Date: May 2006
Location: Paris
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

It seems to mess signatures. After installing this, some posts had the signature of another user.
Reverting the patch fixed it.
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 12:10 AM.


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.12316 seconds
  • Memory Usage 2,313KB
  • 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
  • (2)bbcode_php
  • (3)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
  • (4)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