Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

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
  #22  
Old 03-27-2011, 08:35 PM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The bug fix has already been applied to both versions. So you only have to download the latest!

And... there is a new version (1.2) that added the ability to change the error message, and the CSS that controls its display, via the options.

--RayJ
Reply With Quote
  #23  
Old 03-27-2011, 09:48 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice update, thanks.

If anyone is interested I'm using this CSS to make a rounded border with a slight shadow, light yellow background and dark red text... Easily edited to your needs.

There are 3 properties needed for each rounded border (radius) and shadow... -moz is for firefox browser, -webkit is for chrome browser, and the other is for IE9 and standard web browsers.

Code:
color: darkred; background: lightyellow; border: 2px  inset red; padding: 4px; margin: 2px; -moz-border-radius: 5px;  -webkit-border-radius: 5px; border-radius: 5px;  moz-box-shadow:0 0 2px darkred; -webkit-box-shadow:0 0 2px darkred; box-shadow:0 0 2px darkred;
Reply With Quote
  #24  
Old 12-03-2011, 04:48 PM
ravenscape's Avatar
ravenscape ravenscape is offline
 
Join Date: Mar 2008
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great modification, but people occasionally will have a problem with it on our site due to the length (number of characters) of the quoted text. The limit within one set of quote tags appears to be 8281. I can add another set of quote tags around a 8281 character quote and add some more text in the outer set.
Reply With Quote
  #25  
Old 12-04-2011, 01:31 AM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you using the latest version? There was an issue with large posts in the original version.

--RayJ
Reply With Quote
  #26  
Old 12-04-2011, 05:11 AM
ravenscape's Avatar
ravenscape ravenscape is offline
 
Join Date: Mar 2008
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it is version 1.2 that I have installed.
Reply With Quote
  #27  
Old 12-04-2011, 07:28 AM
xorex's Avatar
xorex xorex is offline
 
Join Date: Jan 2008
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will be good if mod would have setting for exclude validate quotes inside tags

example: [code] [html] [php] e.t.c
Reply With Quote
  #28  
Old 12-04-2011, 08:56 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 ravenscape View Post
it is version 1.2 that I have installed.
I will check that out and see what is causing the problem!

Quote:
Originally Posted by xorex View Post
will be good if mod would have setting for exclude validate quotes inside tags

example: [code] [html] [php] e.t.c
I will try to implement that.


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

Quote:
Originally Posted by ravenscape View Post
This is a great modification, but people occasionally will have a problem with it on our site due to the length (number of characters) of the quoted text. The limit within one set of quote tags appears to be 8281. I can add another set of quote tags around a 8281 character quote and add some more text in the outer set.
I have looked over the code and tested various amounts of data. I posted over 16000 characters in QUOTED text, with and without proper QUOTE tags. Everything worked as expected.

Could you do me a favor? Check your forums "Maximum Characters Per Post" setting. That may be what is causing this issue. The setting is in Message Posting and Editing Options.

--RayJ
Reply With Quote
  #30  
Old 12-05-2011, 12:47 AM
ravenscape's Avatar
ravenscape ravenscape is offline
 
Join Date: Mar 2008
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by raywjohnson View Post
I have looked over the code and tested various amounts of data. I posted over 16000 characters in QUOTED text, with and without proper QUOTE tags. Everything worked as expected.

Could you do me a favor? Check your forums "Maximum Characters Per Post" setting. That may be what is causing this issue. The setting is in Message Posting and Editing Options.

--RayJ

The max characters setting is at 50,000.

This is the maximum amount that I can post in a single quote.

Quote:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tristique posuere elit, vitae iaculis ipsum suscipit adipiscing. Aliquam ultricies tortor at nulla vehicula mollis. Aliquam euismod tristique est, laoreet feugiat nisi ornare ut. Vestibulum sodales magna non erat dictum eget vehicula sapien viverra. Proin eget sem eget mi sodales aliquam a eu nisi. Ut imperdiet pulvinar gravida. Praesent eu placerat ipsum. Nunc cursus, lorem sed tempor sollicitudin, erat odio consequat mauris, sed ornare magna risus nec ante. Vestibulum eget lectus vel felis dignissim volutpat vitae a arcu. Proin orci ante, ultricies at convallis in, fermentum sed justo. Nullam dignissim risus vitae lorem luctus pellentesque. Suspendisse eu nibh id orci rutrum porttitor. Quisque pellentesque purus quis felis dignissim aliquet. Cras dictum pellentesque ipsum eget sollicitudin. Duis scelerisque justo id sapien sollicitudin eu facilisis lectus dapibus. Nunc turpis lorem, hendrerit et auctor nec, fringilla vel mi.

Duis arcu risus, interdum et venenatis vehicula, vehicula nec nibh. In sagittis, nibh non mattis adipiscing, mauris enim mollis elit, eu euismod justo dui sit amet erat. Ut at tellus massa, vitae accumsan orci. Vivamus leo ligula, blandit malesuada cursus nec, aliquam in lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer ante ligula, lacinia a elementum nec, ultrices eu purus. Phasellus sed velit metus, ac ultrices felis. Nam vehicula sapien in magna porta vulputate quis vel justo. Mauris dignissim imperdiet enim, in placerat felis scelerisque eget. Nullam placerat dignissim fringilla. Nullam massa leo, luctus non adipiscing nec, iaculis vitae eros. Maecenas vitae magna vitae velit tincidunt gravida sit amet sed sem. Fusce pulvinar libero ac lorem congue quis porta sapien gravida. Cras volutpat elementum risus, a imperdiet tellus ullamcorper fringilla. Sed ultrices libero ut sapien tincidunt fringilla.

Aliquam imperdiet augue aliquam lacus lacinia id porttitor nibh dapibus. Vivamus at justo lorem, ac mattis magna. Donec tempor accumsan quam, eget volutpat ante commodo at. Donec lacinia dictum odio. Fusce suscipit gravida lorem, eget feugiat lacus posuere eget. Integer eget felis nisi. Phasellus urna purus, egestas at porttitor nec, ullamcorper pharetra magna. Aenean quis porta turpis. Nulla eget augue et ante placerat viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vel metus sit amet mi vehicula egestas. Mauris dignissim consectetur ultricies. Integer condimentum elementum nisi, nec congue sem bibendum ut. Nunc ac sem non sapien porttitor ultricies.

Vivamus varius facilisis magna id interdum. Morbi facilisis risus in odio ullamcorper sodales. Mauris suscipit ipsum vitae dolor ullamcorper sed tempus risus rhoncus. Cras elementum placerat porta. Donec molestie vehicula egestas. Sed luctus justo quis magna porta non semper nibh dictum. Duis nec nunc magna, ut porta neque. Ut felis nunc, porttitor ut fringilla non, viverra sit amet nunc. Fusce at quam nec nisi semper tristique id ac est. Sed blandit tellus quis lectus feugiat egestas. Suspendisse vitae est vitae tortor volutpat luctus. Nunc bibendum consequat nibh, non adipiscing turpis ultricies ac. Integer elementum arcu nec mauris imperdiet consequat. Pellentesque a quam dolor. Morbi sit amet augue quis mi adipiscing scelerisque.

Maecenas elementum vestibulum vehicula. Nunc nulla eros, gravida vel cursus cursus, porta non magna. Etiam vehicula erat congue eros mollis quis tristique mi tempus. Maecenas at purus hendrerit lorem porttitor ornare id at nisl. Donec placerat justo sed ipsum faucibus iaculis. Proin id diam nec purus suscipit placerat. Pellentesque vitae justo odio, id ullamcorper mi. Donec sed dui sapien, quis gravida velit. Nullam vestibulum semper dolor, ac tincidunt elit consequat eu. Proin pharetra volutpat enim non condimentum. Etiam et fermentum lorem. Proin ornare ligula a ante lacinia tempus.

Morbi bibendum, risus id mattis suscipit, augue libero rutrum mauris, eu pretium dolor lacus non mauris. Vestibulum lobortis erat id diam commodo interdum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec posuere ultricies nisl, eget adipiscing lectus sodales id. Mauris pharetra, quam eu facilisis iaculis, odio magna laoreet magna, non malesuada massa nisi vitae nisl. In hac habitasse platea dictumst. In in purus nulla. Morbi ligula risus, hendrerit sed pretium quis, viverra et nulla. Donec ultrices, arcu eget feugiat rutrum, arcu urna egestas justo, non sollicitudin orci felis at nulla. Suspendisse aliquam est eu turpis ultricies pharetra. Curabitur facilisis convallis orci, nec sodales turpis condimentum vel. Phasellus augue elit, volutpat tincidunt sollicitudin vel, faucibus nec massa.

Nam a nibh viverra nisi venenatis vehicula non eu arcu. Nunc neque neque, blandit tincidunt eleifend sed, luctus nec metus. Aliquam non urna sem. Nulla facilisi. In dui nulla, malesuada at condimentum et, consectetur in urna. Phasellus bibendum, tellus gravida vestibulum volutpat, lorem arcu consectetur lorem, eget accumsan nunc massa in arcu. Quisque eu lacus et sapien malesuada vulputate. Nunc nunc quam, volutpat quis tempor a, eleifend vel erat. Morbi sit amet magna a felis ultricies accumsan. Duis ullamcorper ipsum eget dui rutrum aliquet. In in massa purus. Nunc molestie tempor risus. Aenean venenatis fringilla adipiscing.

Sed felis arcu, fermentum et gravida sit amet, blandit pretium metus. Praesent at eros ac augue tincidunt interdum. Donec a mattis eros. Aliquam lobortis, turpis eget mattis dapibus, nulla purus venenatis erat, sed congue tortor nisl ut enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras vulputate felis et mauris scelerisque auctor. Sed sed imperdiet eros. Vivamus pulvinar consectetur ipsum sit amet pellentesque. Curabitur vitae massa massa, vel porta velit. Etiam consequat quam vitae augue blandit tempus. Vestibulum laoreet suscipit tortor sit amet ultrices.

Donec a lorem ut sapien vulputate ultrices et ac odio. In ut elit sed est ullamcorper sodales eu ultrices enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dui ipsum, placerat sit amet hendrerit at, ullamcorper ac elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur a nisl nisl, sit amet convallis erat. Nunc ultricies ante sed nulla egestas scelerisque. Duis sed mauris eros. Donec tincidunt condimentum nisl, non aliquam augue sodales vitae. Pellentesque sit amet lorem vel lacus condimentum bibendum.

Praesent placerat tincidunt pharetra. Nam egestas, est rhoncus pharetra sodales, erat nisl euismod enim, non tempus velit elit at lacus. Aliquam erat volutpat. Fusce auctor varius ullamcorper. Suspendisse potenti. In a arcu id orci viverra rhoncus. In sit amet tellus id lacus porta bibendum nec quis ante. Aliquam ultrices quam eu eros consequat ut fermentum felis laoreet. Curabitur ullamcorper libero orci. Sed dignissim nunc a lectus posuere lobortis. Aliquam auctor enim ac neque pellentesque vulputate. Aliquam erat volutpat. Praesent pulvinar nunc volutpat urna dictum tincidunt. Nunc lectus erat, laoreet vitae vehicula a, facilisis eu sapien. Phasellus elementum aliquet sapien.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam euismod sem ac lorem sollicitudin tincidunt. Quisque vehicula neque vitae nisl cursus vitae iaculis nulla malesuada. Nulla urna augue, sodales vel viverra in, sagittis nec nulla. Maecenas lorem elit, pretium sed aliquet nec, pharetra a dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc vel cursus nisi. Curabitur aliquet, libero ut tempus malesuada, eros nisi cursus tellus, scelerisque semper quam turpis a turpis. Quisque ut metus augue. Maecenas fringilla, nulla quis fringilla commodo, quam justo ornare eros, quis ultrices tellus tortor sed tellus. Pellentesque in mattis tellus. Sed at sagittis odio. Nam et nisl lacus. Fusce imperdiet lacus dui, id s
I can post that in a nested quote with more text in the outer quote, so I don't think it's the max characters per post that's gonked. If I turn off the mod, then the posts we're having trouble with go through fine.
Reply With Quote
  #31  
Old 12-05-2011, 01:08 AM
raywjohnson's Avatar
raywjohnson raywjohnson is offline
 
Join Date: Feb 2007
Location: Las Vegas
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ravenscape View Post
The max characters setting is at 50,000.

This is the maximum amount that I can post in a single quote.



I can post that in a nested quote with more text in the outer quote, so I don't think it's the max characters per post that's gonked. If I turn off the mod, then the posts we're having trouble with go through fine.
Excellent. The next thing to check is the /includes/class_verifyquotes.php file. Specifically the Parse function. It should look like this:

PHP Code:
public function Parse($text) { 

    
$text preg_replace('#\[quote.*?\]#i','[quote]',$text);
    
$text preg_replace('#\[quote\]\[\/quote\]#i','',$text);
    
$text preg_replace('#\[noparse\].*?\[\/noparse\]#si','',$text);

    
$text $this->do_parse($text);
    return 
preg_match('/\[quote.*?\]|\[\/quote\]/si',$text);
  } 

if not, then you are still using the original buggy version.

--RayJ
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 10:58 AM.


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.04435 seconds
  • Memory Usage 2,358KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_php
  • (6)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
  • (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
  • (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
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete