Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Validate matching quote BBCode tags. Details »»
Validate matching quote BBCode tags.
Version: 1.3.0, by raywjohnson raywjohnson is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.8.0 Rating:
Released: 05-14-2009 Last Update: 09-17-2013 Installs: 37
Supported Uses Plugins
Re-useable Code Additional Files Translations  

Quotes Validation

I created this modification to help alleviate the need to edit posts that have invalid/mismatched QUOTE tags. For a busy forum, correcting bad QUOTE tags can become a big problem for your moderators.

Messages (new or edited) rejected by this mod will return the member to the post submission form with the phrase: "One or more of [quote] tags are missing or mismatched. All posts are required to have proper matching quotes."

I have been running it on my board for a month or so without problems. It may run on versions older then 3.8, but I have not tested that.

I have created a number of mods for my board, this is the first one I have released!

--RayJ

NOTE: Plugin works on vBulletin version 4

Description
Check new and edited posts for valid/matching open and close [quote] BBCode tags.
*Should* work with any number of nested or included quote tags.

Details
1 Product XML with 3 Plugins, 2 Phrases, 5 Settings, and 0 Queries
1 File/Class
No template modifications.

Files
class_verifyquotes.php
install.txt
license.txt
license-vqbc_rayj2009.txt
v1.3 = product-vqbc_rayj2009_1-3.xml
v1.2 = product-vqbc_rayj2009_1-2.xml
v1.1 = product-vqbc_rayj2009_1-1.xml
v1.0 = product-vqbc_rayj2009.xml

Upgrading
v1.0-v1.1 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-1.xml (Allow Overwrite)
v1.(0/1)-v1.2 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-2.xml (Allow Overwrite)
v1.(0/1/2)-v1.3 :
Upload class_verifyquotes.php file to the /includes/ directory
import product-vqbc_rayj2009_v1-3.xml (Allow Overwrite)

History
1.0
Initial Version
1.1
Added plugin: newpost_preview
Added setting: Auto Preview Mode.
If active, the system will automatically put you in preview mode, and display the error message in the post area, when QUOTE mismatches are found.
Added phrase: To display CSS around "in post" error message.
Bug Fix: versions v1.0 and v1.1 (Note: fix already applied to all versions)
Memory leak causes download dialog for all browsers (for large posts). Download quotes_validation_bugfix.zip (contains: class_verifyquotes.php) and upload it. Fixes all previously installed versions.
1.2
Added Option: Style (CSS) for error message
Added Option: Bad Quotes Error Message
This will let you edit the Error Message and CSS that controls the output without having to edit the phrase directly. I left the original phrase code in place so that it will not get wiped out when you upgrade. You will have to search for the phrase (vqbc_bad_quotes_error) and copy it to the new setting.
Changed the phrase that displays the "in post" error message to work with the new options.
1.3
Bug Fix: Removed recursion and complex regular expressions. These were causing issues with large posts.
Added Option: Ignored Tags (allows you to add tags to be ignored during validation, note: noparse is always ignored)

Notes
PHP 5.0+ required.
If you are still using PHP 4 (you should upgrade). Or you can edit the class_verifyquotes.php file and remove all public and private keywords (before each function). Then edit the product-vqbc_rayj2009_v1-1.xml file and remove the PHP 5.0 dependency line.

Download Now

File Type: zip quotes_validation_v1-3.zip (15.5 KB, 46 views)

Show Your Support

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

Comments
  #42  
Old 09-17-2013, 07:27 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by raywjohnson View Post
True. Thanks. I will to some testing on version 4 to see what I can find out.

--RayJ
Yes I was merely pointing out in a subtle way, that to expect a add-on that is coded for version 3.8, to work without flaw on a version 4 installation, is not reasonable.
Reply With Quote
  #43  
Old 09-17-2013, 07:48 PM
Joe Blow Joe Blow is offline
 
Join Date: Aug 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Further info:

Quote:
It was core dumping with with signal 4 when one of the regexp functions was called on the string.
Reply With Quote
  #44  
Old 09-17-2013, 08:01 PM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Joe Blow View Post
Further info:
Quote:
It was core dumping with with signal 4 when one of the regexp functions was called on the string.
Yep. I found the same problem while testing. I will be working on a fix today.

The issue is that due to the recursion, it runs out of memory when crunching through large posts. I thought I had a fix for that already, but simply failed to take into account text before and after any quoted text. So a 5k post with 10 nested quotes causes 10 PHP recursive calls. The regex is also recursive!

I have re conceptualized the functionality and may have come up with a fast and efficient solution.

I hope to upload the newest version later today.

--RayJ
Reply With Quote
  #45  
Old 09-17-2013, 11:18 PM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alrighty then!

Found a good solution. Version 3 does not use recursion at all. I also added an extra check to make sure the class file (class_verifyquotes.php) exists. So if the file gets deleted or renamed, your board will not go down (i.e. show a blank page).

I also added the ability to remove tags (other than just "noparse") prior to validation.

I tested it in VB4 and it worked fine.

Everyone should upgrade to version 3 of this plugin.

Standing by for bug reports!

--RayJ
Reply With Quote
Благодарность от:
Max Taxable
  #46  
Old 09-17-2013, 11:25 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by raywjohnson View Post
Alrighty then!

Found a good solution. Version 3 does not use recursion at all. I also added an extra check to make sure the class file (class_verifyquotes.php) exists. So if the file gets deleted or renamed, your board will not go down (i.e. show a blank page).

I also added the ability to remove tags (other than just "noparse") prior to validation.

I tested it in VB4 and it worked fine.

Everyone should upgrade to version 3 of this plugin.

Standing by for bug reports!

--RayJ
Just to be clear, this will still work in 3.8.x series? Not that I use this, just so the people that do know.
Reply With Quote
  #47  
Old 09-17-2013, 11:37 PM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
Just to be clear, this will still work in 3.8.x series? Not that I use this, just so the people that do know.
Yes. Thanks for reminding me. It is still developed on and for VB3.8.

--RayJ
Reply With Quote
  #48  
Old 10-26-2013, 11:12 PM
Black Tiger's Avatar
Black Tiger Black Tiger is offline
 
Join Date: Apr 2004
Location: Netherlands
Posts: 957
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry but I've got a problem on 3.8.7 with 1.3 so I think it's buggy, because this problem does not occur with version 1.2.

I've got vbulletin 3.8.7 pl3 running. When I use version 1.3 and try to make a new post, I don't get the in between lines saying that my thread is being posted, but I just get a white screen, nothing more.

When I use version 1.2 the problem is gone and I can post again.

How can this be fixed?
Reply With Quote
  #49  
Old 10-26-2013, 11:41 PM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you upgraded to 1.3, did you upload the class_verifyquotes.php file to the /includes/ directory? Each version must use its own class_verifyquotes.php file.

--RayJ
Reply With Quote
Благодарность от:
Max Taxable
  #50  
Old 10-27-2013, 12:03 AM
Black Tiger's Avatar
Black Tiger Black Tiger is offline
 
Join Date: Apr 2004
Location: Netherlands
Posts: 957
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No I didn't because it said:
Quote:
v1.(0/1/2)-v1.3 : just import product-vqbc_rayj2009_v1-3.xml (Allow Overwrite)
So I thought that was not necessary.

Thank you for the quick support, I'm going to change it now!
Reply With Quote
  #51  
Old 10-27-2013, 12:13 AM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No worries. And thank you for the feedback. I will fix the instructions!

-RayJ
Reply With Quote
Reply


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 07:34 PM.


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.05407 seconds
  • Memory Usage 2,348KB
  • Queries Executed 26 (?)
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
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete