Jump to content
bfarber
 Share


IP.Board 3.0 BBCode System Overhaul

BBCode is a core part of your forum system. We understand that. To that end, we've been working hard to completely rewrite and overhaul the entire bbcode handler in IP.Board 3.0. We think you'll like what is in store.

Changes since IP.Board 2.x

There are some core differences in the BBCode system we are introducing in IP.Board 3 that you may notice right away. For starters - *every* BBCode is configurable via the Admin CP. That means if you want to add "rel='nofollow'" to your urls, you can do so without editing files. If you want to change the resulting HTML for a code tag, you can do so, right there in the admin CP. Similarly, the backend treats every bbcode as "custom" as a result, and every bbcode is treated equally.

Additionally, we are changing the HTML that the bbcode parsing generates to be more XHTML compliant. Alt attributes are added to image tags. We've changed emoticons to place the emoticon code in the alt attribute, and have removed the (non-standard) emoid attribute entirely. Quotes will properly use the blockquote HTML tag (and, further, will use the "cite" HTML tag when you provide the name and link with the quoted text). Bold will now use the HTML "strong" tag and i will use the HTML "em" tag. Almost all of the bbcode HTML is being rewritten to be both more semantic, and to bring IP.Board's HTML output up to today's standards.

Additionally, the code-syntax boxes (e.g. HTML and SQL bbcode tags) are undergoing an overhaul that will make them much more flexible and allow us (and you!) to add new code languages very easily. We will be providing more information on how to do this in the future.

New features in the BBCode system

I'm sure this is what you've all been wanting to find out about. Well, here we go (in no particular order)...

  • Aliases: BBcodes can now have aliases, so that more than one tag can execute the same custom bbcode. Uses? For instance, "code" and "codebox" both execute the same bbcode. Similarly, "media", "blogmedia", "flash", and "youtube" are all one bbcode that behaves the same way. (Hold your horses, we'll get to the media in a minute ;) )
  • Single-tags now supported: You wanted to add "
    ". You now can.
  • Option content is optional: Bet that sounded confusing. It really isn't - basically, taking the "URL" tag as an example, you can either provide the URL as the "option" to the URL tag, and display text as the "content", or you can omit the option entirely, and the content becomes the display text. This setting allows you to do the same thing with your own bbcode.
  • Prevent other codes from parsing: You can prevent other bbcodes from parsing inside your own bbcode. The classic example is our "code" bbcode - you don't want smilies and other bbcodes parsing within the code bbcode when you're trying to show someone how to use them.
  • PHP Plugin execution: Do you require a bit more logic to be carried out to replace the bbcode? You can utilize plugin files to do this. Plugin files have a defined interface and more information will be provided for developers near launch. Several of our default bbcodes utilize plugin files, so this should help developers more easily understand how they can be used. You will no longer need to modify built in bbcode processing files to add new bbcodes.
  • Control which groups can use a bbcode: The bbcode manager now has a multiselect which allows you to specify which groups can utilize the bbcode (secondary groups also supported). So if you want admins to be able to create tables using a [table] bbcode tag, but not members, go for it.
  • Control where each bbcode can be used: Want to allow images in posts, but not in signatures? Now you can configure this right from the bbcode management screens in the admin cp. This feature runs on a plugin system so modification developers can also allow you to configure which bbcodes are allowed in your custom applications.

New "default" BBCodes in IP.Board 3

I use the term "default" loosely, since everything is configurable via the ACP. In addition to all of the bbcodes you will find in IP.Board 2.x, the following default bbcodes will be available in IP.Board 3:

  • "member". Usage: bfarber. This tag is a "single" tag bbcode that accepts one option, the member's display name. When parsing out the tag, the bbcode will generate the correct link to the member's profile and display "<a href='correct link'>member name</a>".
  • "hr". Usage:
    . Very simple bbcode which generates a horizontal rule.
  • "xml" and "php". Usage:

    XML content

    or

    $phpCode = 1;

    . Generates syntax-highlighted code boxes, similar to the existing SQL and HTML boxes.

  • "media". Usage: http://youtube.com/videolink. Ah, the one most of you have been waiting for. The introduction of the media tag in blog was so well received, we've gone ahead and added it to the IP.Board core. You can configure the media tag matches and replacements (for those of you who own Blog 1.4, you'll know what I mean), which allows you to add new media services at will. Generic flash (the old "" bbcode in IP.Board) works through this new media tag as well. Optionally accepts "width,height" as it's option.

Sharing and formatting content couldn't get much easier that configuring what you want in the ACP!

Dull boring techie stuff

For those of you actually interested in the code aspects of the new system, we've completely rewritten the bbcode parser from the ground up. Firstly, sections should go back to the proper way of calling pre_db_parse before storing content in the database, and pre_display_parse before actually displaying it. This will ensure that bbcode can be correctly unparsed when a user edits their content.

A major change to how the formatted text is handled: it isn't! We don't do any bbcode parsing on save, storing (nearly) exactly what you submitted into the database. Instead we format the bbcode at the time of displaying the content. This means we don't have to "unparse" previously parsed bbcode, nearly eliminating any bugs in attempting to do so.

Another nice thing about this method...while you will need to rebuild your posts when you upgrade to IP.Board 3, you should never need to again. Ever. Yes, you read that right - you will need to rebuild your posts once upon upgrading to IP.Board 3....but after that, no more rebuilding posts headaches. Additionally, we intend to fully update our command-line rebuild posts routine, and we intend to introduce a task which will do this for you automatically should you wish. More information on this will be available as we get closer to launch.

Some of you may be wondering about the resource impacts of parsing a post on every display. In rewriting the bbcode engine, we've nearly completely eliminated regular expressions in our bbcode engine. Regular expressions allow you to take a "pattern" and find matches to that pattern in a block of text. This is how bbcode was found and replaced in IP.Board 2.x (and in most other bbcode engines out there). For IP.Board 3, we are talking what's called a "tokenized" approach. We use some very fast built in php functions (such as strpos and substr_replace) instead of performing massive regular expressions, making the entire bbcode parsing process much quicker. We will be profiling this in greater detail as IP.Board 3 starts wrapping up. We'll try to share the results of this profiling with you at that time.

We've also entirely rewritten the word wrap function in IP.Board. It should now be fully HTML-safe, HTML-entity-safe, and multibyte-safe...three huge problems we've repeatedly run into with the word wrap function in IP.Board 2.x. Additionally, there will now be one word-wrap function, and it properly lives in the bbcode library (though for legacy purposes, we will maintain a "redirect" function in our text handler class similar to the function in ipsclass in IP.Board 2.x).

All in all, once we get the various inevitable kinks all ironed out with using the new system, it should not only be much easier to utilize our bbcode library, but it should be much more reliable and much faster to boot!

Conclusion

We hope you like the changes in store, and we hope that the updates which many of you have waited a long time for will serve your post-formatting needs for the forseeable future. Please share your thoughts or ask any questions you may have, and we'd be happy to try to answer them for you.
 Share

Comments

Recommended Comments



First comment! Yay! :D

Everything sounds so nice...Is it possible to get some videos like with Nexus before the beta releases?

Link to comment
Share on other sites

[quote name='Professor P' date='Jul 15 2008, 04:17 PM']Does customization go as far as allowing one to choose which bbcode icons display in the rte and allowing one to create a button in the rte for their custom bbcodes?
You mean the buttons on the top, or on the left under the emoticons? Because there's already an option to put custom bbcodes on the left...

Link to comment
Share on other sites

[quote name='Gaяяett' date='Jul 15 2008, 07:45 PM'][quote name='Professor P' date='Jul 15 2008, 04:17 PM']Does customization go as far as allowing one to choose which bbcode icons display in the rte and allowing one to create a button in the rte for their custom bbcodes?
You mean the buttons on the top, or on the left under the emoticons? Because there's already an option to put custom bbcodes on the left...

Link to comment
Share on other sites

I'm curious. I think IPB software is really good. But I've been very impressed with the fact phpBB3 has gone WC3 Strict. Is this the plans for IPB 3. Are you planning to make that WC3 Strict also. As it seems that way looking at the changes your making?

Link to comment
Share on other sites



While RTE bbcodes are going to be "hardcoded" (because functionality to insert "bold" text in an RTE is a special command) we do intend to allow some sort of support for inserting the icons directly into the editor. Because this part of the update hasn't been completely finalized I can't give any more details. Basically, my answer is "that is the plan, but I can't guarantee it or tell you how it will work just yet".



No, we did not license his parser, this was completely written from the ground up. I do, however, communicate with him in private and have plans to loop him in further along in the development cycle for some things.



This isn't really related to the bbcode updates unless I'm missing something? But the answer is yes.

http://forums.invisionpower.com/blog/ips_n...?showentry=2449

My guess is like early 2009? If so, can't wait biggrin.gif!

Considering we intend to release IPB3 by the end of the year, I'd suggest betas should be out long before Aug 2009.....

Do you plan to make some video to show a part of ipb3?

For something like this there really isn't anything you can show a video of...what would it be, configuring a bbcode in the ACP? I think we're more concerned with the actual development at this time than spending a lot of time creating videos during the development cycle. As that's not really my area however, can't say if that will happen or not.

Does customization go as far as allowing one to choose which bbcode icons display in the rte and allowing one to create a button in the rte for their custom bbcodes?

So, did you end up working with henke37 or licensing his parser for this?

I'm curious. I think IPB software is really good. But I've been very impressed with the fact phpBB3 has gone WC3 Strict. Is this the plans for IPB 3. Are you planning to make that WC3 Strict also. As it seems that way looking at the changes your making?

Awesome, you got a rough idea when you're planning BETA (RC) stages?


It's great. But I think people want to see some features their own eyes.


Link to comment
Share on other sites

[quote name='bfarber' date='Jul 16 2008, 09:23 PM']Considering we intend to release IPB3 by the end of the year, I'd suggest betas should be out long before Aug 2009.....
Could you please check that you didn't write 2008 as 2009? >_<

Link to comment
Share on other sites


What happens if a member who can't use a BBCode quotes something froms someone who CAN use that type of BBCode?

For instance,
[iframe]http://www.example.com/[/iframe].--Member posts[quote name='Admin'][iframe]http://www.example.com/[/iframe]
Cool!!

Another question. Can you use two options in one BBcode tag? For instance

Control which groups can use a bbcode: The bbcode manager now has a multiselect which allows you to specify which groups can utilize the bbcode (secondary groups also supported). So if you want admins to be able to create tables using a [table] bbcode tag, but not members, go for it.

Admin posts





[media height="500" width="500"]http://www.example.com/media.flv[/media]
Link to comment
Share on other sites

[quote name='McBlack' date='Jul 16 2008, 11:13 AM']What happens if a member who can't use a BBCode quotes something froms someone who CAN use that type of BBCode?


Another question. Can you use two options in one BBcode tag? For instance


Largely, I assume once these sorts of things get in practice and tested our users will have specific feedback about how they want these sorts of things handled. ;)

But presently as the system stands at the moment (and keeping in mind IPB 3 is in very heavy development, so things can be changed at any time)

1) The bbcode simply wouldn't be parsed in the quoted text

2) No, you cannot pass multiple options, but by using a plugin you can accomplish this anyways. For instance, quote accepts name, date and post as options and the plugin file manages to parse all of these out. So, the answer is two fold - not natively through ACP configuration, but yes if you develop a plugin file to handle it.

Media uses "[ media=width,height ]" but the dimensions are optional.

[media height="500" width="500"]http://www.example.com/media.flv[/media]


		
	
Link to comment
Share on other sites

[quote name='Tarun.' date='Jul 16 2008, 12:23 PM']Can we add in a [you ] BBCode that displays the name of whichever member is reading the topic?
From what I understood, you can make BBCodes with a PHP output, so you could make something like this: (of course the coding will be different on IPB3)

INPUT
OUTPUT

IDK if it'll be $this->request->getField('logged_in_as'); but might be something like it.

That would make it say they user's display name if they're logged in. Otherwise, it would say Guest.

[you]

if ($this->request->getField('logged_in_as'); !== "" ) {
    echo $this->request->getField('logged_in_as');
}
else
{
    echo "Guest";
}
Link to comment
Share on other sites

[quote name='ysun' date='Jul 16 2008, 03:50 PM'][quote name='bfarber' date='Jul 16 2008, 09:23 PM']Considering we intend to release IPB3 by the end of the year, I'd suggest betas should be out long before Aug 2009.....
Could you please check that you didn't write 2008 as 2009? >_<

He intentionally wrote 2009, highly doubt betas will be out within 14 days, do you :lol:?

Link to comment
Share on other sites



Yup, through a plugin file (that's how we do Guest.



you won't have to rebuild posts *ever* again, ideally (except for the initial rebuild after upgrading)



You are surprisingly close actually...

$this->request->getField('members_display_name')



No, I actually wrote 2009 because I was quoting someone who said 2009. IPB3 should be out by the end of the year, so betas will be out well before the end of the year. Thus I was employing a bit of sarcasm in saying they should definitely be out by Aug 2009 (they should be out before the final release at the end of this year, in fact).

Can we add in a [you ] BBCode that displays the name of whichever member is reading the topic?

will be much easier without being forced to rebuild all posts

IDK if it'll be $this->request->getField('logged_in_as'); but might be something like it.

He intentionally wrote 2009, highly doubt betas will be out within 14 days, do you laughing.gif?

Link to comment
Share on other sites




Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...