Page 1 of 1

How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 7:51 pm
by Matrix Leader
When I go to the BB Code in the ACP I only see the ones I added, But how to edit the values ot the built in ones?

I want to play around with the existing URL BB Code rather than adding a new BB Code for the URL the way I want it to be

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 7:54 pm
by canonknipser
you have to edit the bbcode-parsing php-file named includes/bbcode.php

Good luck :geek:

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 8:36 pm
by Pony99CA
See the [RFC] BBCode permissions and moving to all custom topic at Area 51 for a requirement to make built-in BBCodes more like custom BBCodes (and adding permssions to BBCodes).

If you do edit the built-in BBCodes, see the Links Opening New Windows Knowledge Base article for some of the issues you may face.

Steve

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 9:06 pm
by Pony99CA
If this is about your URL request that was locked, it may not be in bbcode.php at all. I believe that's where BBCodes are processed, but inserting BBCodes into the editor is probably done in posting.php (or an include). The actual insertion is probably done by editor.js in the template, but I'm not sure on how the interaction works.

Steve

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 9:19 pm
by 3Di
canonknipser wrote:you have to edit the bbcode-parsing php-file named includes/bbcode.php

Good luck :geek:
yup

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 9:32 pm
by Matrix Leader
What I found in the bbcode.php file is this:

Code: Select all

				case 3:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'#\[url:$uid\]((.*?))\[/url:$uid\]#s'			=> $this->bbcode_tpl('url', $bbcode_id),
							'#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s'	=> $this->bbcode_tpl('url', $bbcode_id),
						)
So I just added the EQUAL SIGN before: '#\[url=:$uid\] in the first one but that didn't do the trick

When I press the URL button on the forums it still only gives [URL]

What must I change?

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 9:37 pm
by Sajaki
canonknipser wrote:you have to edit the bbcode-parsing php-file named includes/bbcode.php

Good luck :geek:
Not necessarily. you can write your own parser. :ugeek: See bbTips for an example custom bbcode mod.
the UMIL installer autoinstalls the bbcode in this function.
This topic should be moved to mod writing.

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 9:46 pm
by Matrix Leader
Adding an equal sign seems like inventing the wheel! :shock:

All the members are complaining about this because if you enter a URL that you want to have diff. text appear, you need to enter the = sign! :roll:

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 10:23 pm
by Brf
The code you get when you push the button has nothing at all to do with the code in bbcode.php.
The insert code is right there in the posting_buttons.html template:

Code: Select all

	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);[/code]

Just put the = in there.

Re: How to edit existing default BB Code?

Posted: Wed Oct 26, 2011 10:48 pm
by Matrix Leader
Brf wrote:The code you get when you push the button has nothing at all to do with the code in bbcode.php.
The insert code is right there in the posting_buttons.html template:

Code: Select all

	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);[/code]

Just put the = in there.
Wow!!

That was so easy!! Thank you sir!!

Re: How to edit existing default BB Code?

Posted: Fri Mar 15, 2013 1:46 pm
by boolee
if anyone can help. I changed the last code in subSilver theme everything was ok. But when I did it in artodia: deluxe file posting_buttons then we did not want to work the opening theme or submit post, board jammed

google translate :(
Brf wrote:The code you get when you push the button has nothing at all to do with the code in bbcode.php.
The insert code is right there in the posting_buttons.html template:

Code: Select all

	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);[/code]

Just put the = in there.