Log in

View Full Version : Mini Mods - Strip BBCodes From Quotes


MarkFL
04-07-2015, 09:00 PM
This simple hack allows you to define a list of BBCode tags and their content that you want to be stripped from the body of posts quoted by your users. This eliminates the repeated and unnecessary posting of images, videos and other such media.

Update: version 1.1


Fixed serious flaw whereby post content was stripped of BBCodes when previewing the post. I now have the correct hook location, and I apologize for any inconvenience to anyone.


Update: version 1.2


The function that actually strips the BBCode tags and their content from quoted posts has been moved to an external PHP file, so that it can be used by other products. There is no change in functionality.


Update: version 1.3


Select usergroups may now be exempted from the stripping of BBCode tags from quoted posts.


To Install:

Download and extract the attached zip file, then upload the contents of the "upload" folder to your forum's root directory.

In AdminCP, go to Plugins & Products -> Manage Products -> Add/Import Product.

Click on "Choose File" and browse to the product xml file that was included in the .zip file.

Click "Import"

You MUST set your settings to enable the mod. Each setting has an explanation of its use.

https://vborg.vbsupport.ru/attachment.php?attachmentid=152964&stc=1&d=1437507359

The default list of tags is: attach,img,video

Support for this product can be found here:


MHB - Strip BBCodes From Quotes (http://mathhelpboards.com/vbulletin-products-61/strip-bbcodes-quotes-22041.html)
TAZ - Strip BBCodes From Quotes (https://theadminzone.com/threads/strip-bbcodes-from-quotes.145229/)

MarkFL
04-08-2015, 05:15 AM
Reserved.

MarkFL
04-15-2015, 05:20 AM
I found and fixed a serious flaw with this product as described above. :o

DSemen
04-18-2015, 07:09 PM
Thanks, was looking like.
Is it possible to adapt to version 4.1.3?
In my case, after the installation does not work multi citation.

MarkFL
04-18-2015, 09:16 PM
Thanks, was looking like.
Is it possible to adapt to version 4.1.3?
In my case, after the installation does not work multi citation.

Can you give me a link to your site and a test account to use so I can see how it behaves?

MarkFL
04-19-2015, 01:46 AM
In the new version 1.2, there is no change in how the product functions, I have simply put the PHP function that strips the tags and their content into an external file so that a new product I will be uploading soon can use it as well. :D

DSemen
04-19-2015, 08:48 AM
Can you give me a link to your site and a test account to use so I can see how it behaves?
Thank you very much! In version 1.2, everything works without error
In the new version 1.2, there is no change in how the product functions, I have simply put the PHP function that strips the tags and their content into an external file so that a new product I will be uploading soon can use it as well. :D
Is it possible to remove all the tags between brackets when empty?

https://vborg.vbsupport.ru/external/2015/04/10.jpg

MarkFL
04-19-2015, 12:45 PM
Yes, edit your "newpost_quote" template to wrap the following conditional around the existing code:

<vb:if condition="$pagetext"></vb:if>

DSemen
04-19-2015, 03:45 PM
Thank you.
Encountered an error: After answering a multi Quote checked with marked positions can not be removed! https://vborg.vbsupport.ru/external/2015/04/7.jpg

MarkFL
04-19-2015, 03:58 PM
Thank you.
Encountered an error: After answering a multi Quote checked with marked positions can not be removed! https://vborg.vbsupport.ru/external/2015/04/7.jpg

I am unable to reproduce this error. Can you describe exactly what you are doing?

DSemen
04-19-2015, 04:11 PM
I note a few posts (4 for example) for multi citation, I press the button "Reply to Thread" and answer.

In this case, a tick (previously marked) remain active. https://vborg.vbsupport.ru/external/2015/04/7.jpg

They should be removed after the answer. https://vborg.vbsupport.ru/external/2015/04/8.jpg

MarkFL
04-19-2015, 04:19 PM
I note a few posts (4 for example) for multi citation, I press the button "Reply to Thread" and answer.

In this case, a tick (previously marked) remain active. https://vborg.vbsupport.ru/external/2015/04/7.jpg

They should be removed after the answer. https://vborg.vbsupport.ru/external/2015/04/8.jpg

Yes,when I reply, they are all unmarked for multi-quote just as they should be. Are you actually submitting the reply?

If so, try disabling the product, and see if this behavior persists...

DSemen
04-19-2015, 04:23 PM
Behavior persists even when turned off.
Starts to work properly only after hack deleted

MarkFL
04-19-2015, 04:56 PM
The earliest version of vBulletin to which I have access is 4.2.0 PL3, and it behaves correctly just as vB 4.2.1 and vB 4.2.2 PL 4 do.

If other users of vB 4.1.x report this issue, then I will mark this product for 4.2.x only.

nosaes
04-19-2015, 05:53 PM
I'm getting the following error:
Fatal error: require_once(): Failed opening required '/home/rogcommunity/public_html/forums/stripbbcodesfromquotes/striptagsfromquotes.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rogcommunity/public_html/forums/includes/functions_newpost.php(1663) : eval()'d code on line 1

Any idea how to resolve this?

Edit: I'm on 4.2.2

MarkFL
04-19-2015, 06:07 PM
I'm getting the following error:

Fatal error: require_once(): Failed opening required '/home/rogcommunity/public_html/forums/stripbbcodesfromquotes/striptagsfromquotes.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rogcommunity/public_html/forums/includes/functions_newpost.php(1663) : eval()'d code on line 1

Any idea how to resolve this?

Edit: I'm on 4.2.2

Did you upload the contents of the "upload" folder to your forum's root directory (where forum.php resides)?

edit: To everyone asking for support, please click "Mark As Installed." :D

nosaes
04-19-2015, 07:10 PM
Did you upload the contents of the "upload" folder to your forum's root directory (where forum.php resides)?

edit: To everyone asking for support, please click "Mark As Installed." :D

Oh. Thank you, I feel pretty silly now. Works great!

Marked as installed.

DSemen
04-19-2015, 07:13 PM
The earliest version of vBulletin to which I have access is 4.2.0 PL3, and it behaves correctly just as vB 4.2.1 and vB 4.2.2 PL 4 do.

If other users of vB 4.1.x report this issue, then I will mark this product for 4.2.x only.


Maybe you can help this file
P.S. Marked as installed. Nominate for Modification of the Month

DSemen
04-22-2015, 03:45 PM
The earliest version of vBulletin to which I have access is 4.2.0 PL3, and it behaves correctly just as vB 4.2.1 and vB 4.2.2 PL 4 do.

If other users of vB 4.1.x report this issue, then I will mark this product for 4.2.x only.

This product is not working properly in these versions, check.

MarkFL
04-22-2015, 04:25 PM
This product is not working properly in these versions, check.

I don't use the quick edit option because on the forums with which I am involved we use LaTeX rendering by MathJax, and the quick reply/edit simply do not work well with it. My users like for their LaTeX to be rendered after posting or making an edit without having to manually refresh the page.

However, when I enable the quick reply on my local dev site, I do see the behavior you have indicated. but I see this behavior even with my product uninstalled. I must therefore conclude that it is behavior intrinsic to vBulletin 4.2.x. As I said above, I don't have access to vBulletin 4.1.x and so I can't say whether that version behaves in this way or not.

DSemen
04-22-2015, 04:34 PM
The last screen shot I have tested with version - 4.2.2

MarkFL
04-22-2015, 04:39 PM
The last screen shot I have tested with version - 4.2.2

Yes, I find that when using the quick reply with multi-quote, and the new post is placed on a different page, the multi-quote is left checked...and this is with or without my product being installed. Therefore, I must conclude that this is not the result of my product, but simply the default behavior of vBulletin.

DSemen
04-22-2015, 04:44 PM
This is the result of your product. After the removal of your product forum working properly.
Forum test, there was nothing found except Strip BBCodes From Quotes

MarkFL
04-22-2015, 05:52 PM
This is the result of your product. After the removal of your product forum working properly.
Forum test, there was nothing found except Strip BBCodes From Quotes

As I said before, I get the same behavior with or without my product being installed. I just double-checked, and this is indeed the case. Therefore, I stand behind my assertion that this is not the result of my product.

DSemen
04-23-2015, 11:58 AM
Sorry, this behavior is indeed observed in all versions vBulletin without your product.
I apologize for misrepresentation

Alan_SP
04-23-2015, 04:55 PM
I note a few posts (4 for example) for multi citation, I press the button "Reply to Thread" and answer.

In this case, a tick (previously marked) remain active. https://vborg.vbsupport.ru/external/2015/04/7.jpg

They should be removed after the answer. https://vborg.vbsupport.ru/external/2015/04/8.jpg

This is known bug in vB4, and not resolved for some time.

It happens sometimes, but in other instances doesn't happen. Who knows why. And I'm not optimistic that it would be solved by authors of vB.

Stratis
07-21-2015, 03:47 PM
Thanks Mark, works fine in 4.2.0 pl4
You rock ;)

MarkFL
07-21-2015, 03:50 PM
Thanks Mark, works fine in 4.2.0 pl4
You rock ;)

Thanks for the feedback and for marking as installed. :up:

Stratis
07-21-2015, 04:19 PM
in future... it would be nice if this take effect to which usergroups we select.
admins - smods - mods when they answer in posts they know what is better to quote or not.

MarkFL
07-21-2015, 04:21 PM
in future... it would be nice if this take effect to which usergroups we select.
admins - smods - mods when they answer in posts they know what is better to quote or not.

I will add the option to exempt selected usergroups tonight! ;)

MarkFL
07-21-2015, 05:38 PM
Update: version 1.3


Select usergroups may now be exempted from the stripping of BBCode tags from quoted posts.