XF 1.1 Censoring a BB Code

Mt.Rev

Member
I'm trying to replace the BB Code by using the censor option, but it doesn't replace it.

Code:
Replace [code] with [quote]

Since the word replacement option doesn't effect BB Codes, is there another way I can do this?
 
I want to prevent people from using
Code:
 [code][/code ]
and if able to replace it with
Code:
[quote][/quote]


Or maybe a better way to explain it would be have the [code.] tag to do the same thing as how a [quote.] tag would do.

Where should I start looking to get this done?
 
Or is there a way to have the "Code" BBCode turn URL in to actual click-able links?

I tired to copy and paste the "quote" codes and replaced it with the "code", but it seems like it only changed the style of it.
I must be looking in the wrong place. Can anyone point me to the right direction please?
 
Yes, when people use the "code" BBCode, it doesn't create a click-able URL

Example:

Code:
http://xenforo.com
I would like the above to be a click-able link even when the BBCode is being used.

Or if it would be easier, to have the "Code" to act the same as "Quote" BBCode.
 
Library -> XenForo -> BbCode -> Formatter -> Base.php

Code:
'code' => array(
                'parseCallback' => array($this, 'parseValidateTagCode'),
                'stopSmilies' => true,
                'stopLineBreakConversion' => true,
                'trimLeadingLinesAfter' => 2,
                'callback' => array($this, 'renderTagCode')
            ),
 
Actually, it didn't work the way I expected it to.

I replaced the:

Code:
            'code' => array(
                'parseCallback' => array($this, 'parseValidateTagCode'),
                'stopSmilies' => true,
                'stopLineBreakConversion' => true,
                'trimLeadingLinesAfter' => 2,
                'callback' => array($this, 'renderTagCode')
            ),

With:

Code:
            'code' => array(
                'trimLeadingLinesAfter' => 2,
                'callback' => array($this, 'renderTagQuote')
            ),

This is the code from "quotes", but the URL still isn't click-able
 
Whoops... I did one more step. I took out the 'code' portion in this array as well.

Library -> XenForo -> BbCode -> Formatter -> BbCode -> AutoLink.php

Code:
protected $_disableAutoLink = array('url', 'email', 'img', 'code', 'php', 'html', 'plain');
 
I just tried what you did on my dev board and it worked fine creating a click-able URL.
It was a bit weird because when i first all I did was comment out
Code:
'parseCallback' => array($this, 'parseValidateTagCode'),
and then refreshed the post page and the link was click-able.
But when I tired it again, it wasn't click-able anymore.


Whoops... I did one more step. I took out the 'code' portion in this array as well.
Wonderful -- now it works perfectly!
I would never had been able to figure this out on my own.
Thanks for assisting me with this!
 
Top Bottom