Development > Feature Requests

Bring Shoutbox "html" BBCode handling in line with SMF

<< < (2/2)

aegersz:
simple when you find the cheat sheets  :)

1. Exempt Admins [ticked]

2. Regex Filter is (array('#<html>#m','#</html>#m'),array(' ',' ')

thanks for your help, Ninja !

EDIT: added 'm' (for multiple) as I originally omitted from the <html> start tag accidentally.

♦ Ninja ZX-10RR ♦:
There you go! Glad it worked then :D

We'll definitely need to fix that permission thing in a future release anyway, don't think it's intended.

Chen Zhen:

There are settings within each shoutbox to enable/disable specific bbcodes.
You can simply disable the html bbcode that you are talking about by ensuring it is not highlighted from that list.

Unless you want admins to use it in the shoutbox but no one else.

You can try this:

regex filter:

--- Code: ---<html[^>]+?[^>]+>|</html>

--- End code ---

regex callback:

--- Code: ---preg_replace('/<html[^>]+?[^>]+>|</html>/i','',$m[0])

--- End code ---

aegersz:
thank you and yes, i am aware and use the 'enable/disable specific bbcodes' menu option.

I decided to keep my regex filter and use your regex callback (but had no idea what that was and despite reading up on, still have no clue but i'm certainly going to use yours).

I want my Shoutbox to support all/most bbcodes but haven't added any icons for them as I want keep them hidden.

Chen Zhen:
The filter is the regex condition to trigger the callback function.
The callback function is to change the shout text.. with that example I used preg_replace.
$m is the array containing the data for the callback..
in this case $m[0] is the entire shout line that was entered by the member.

Navigation

[0] Message Index

[*] Previous page

Go to full version