corzblog bbcode parser preview



Here it is! My [search engine fodder] bbcode to html parser, and html to bbcode parser [/search engine fodder]!

This is the actual very onsite parser that parses the bbcode of my blogs and site comments, which as well its usual tasks of, well, you know, the parsing stuff, also moonlights doing a cute wee background demo of itself, you're looking at it. it knew you wanted to do that. hit the "preview" button to see at least one half of the parser's bbcode to html/html to bbcode functionality.

The front-end (below) is built-in to the parser, you just call the function and it creates the form. The cool, super-portable JavaScript bbcode buttons and functions come in the package, too. Have fun. Oh, and by the way, output is 100% pure HTML5, or nice plain bbcode, which ever way you look at it, it's free.

button to undo the last javascript change
cbparser quick bbcode guide..
Most common bbtags are supported, and with cbparser's InfiniTags™ you can pretty much just make up tags as you go along. If cbparser can construct valid html tags out of them, it will. Experimentation is the key, and preview often.

A few bbcode examples..
[b]bold[/b], [i]italic[/i], [big]big[/big], [sm]small[/sm], [img]http://foo.com/image.png[/img], [code]code[/code],[code]teletype[/code], [url="http://foo.com" title="foo!"]foo U![/url], and more.. To post code with indentation and/or strange characters, .htaccess, etc., use [pre][/pre] tags.
download cbparser
an HTML5 compliant bbcode parser



Welcome to the comments facility!


previous comments (seventeen pages)   show all comments

cor - 28.02.08 11:21 am

Sony AK, cbparser will check for certain things, unclosed tags and such, but it won't teach people the basic concepts of bbcode. Your example works just fine. Feel free to drop an example that doesn't work, I'll get a better idea of exactly what you mean.

amir, throw the script into a text editor - voluminous notes and instructions are provided within. You should be in there setting your prefs, anyway.

Never run a script without first studying its contents!!!

;o)
(or


Mike - 20.04.08 7:36 pm

Really nice job, I've been doing php for about 2 years now and have been looking for a bb parser to same time as I do not have the patience to build one smiley for :). This is really nice, I was using simplebb before but it just didn't cut it. Thanks for the parser.


Mike - 20.04.08 8:06 pm

Couldn't seem to edit my prev comment, anyways this site has a fast load time yet when i run the file on my server it seems to take for ever. Any suggestions?


cor - 23.04.08 3:12 pm

Your (editing) session runs out after a while; you only get so long.

As for cbparser, I can't think of anything off-hand, that would make it slow on your server - it runs on some *very* slow machines with no problems, and there's no reason it shouldn't.

Check your php error log. Maybe there's something up.

;o)
(or


cor - 23.04.08 3:19 pm

I see what you mean about editing on this page! That's new! smiley for :eek:
I'll have a look into that.

;o)
(or

ps. it was my spell-checker. smiley for :roll:


Gary Glass - 24.04.08 1:49 am

I've been trying to get a bbcode wysiwyg working on a Fireboard forum. TinyMCE's bbcode plugin is pretty buggy. But the HTML version seems to be better. So I thought I would use your component to convert the HTML submitted from TinyMCE's editor to bbcode. Here's the first thing I tried:

<p><strong>bold</strong></p>
<p><em>ital</em></p>
<p><a href=\"http://shutterglass.com\">link</a></p>
<blockquote>
<p>quote</p>
</blockquote>
<p>normal</p>

And using your unmodified cbparser, I got this result:
<p><strong>bold</strong></p>
<p><em>ital</em></p>
<p><a href="http://shutterglass.com">link</a></p>
<blockquote>
<p>quote</p>
</blockquote>
<p>normal</p><pre>string(137) "<p>[b]bold[/b]</p><p>[i]ital[/i]</p><p><a href="http://shutterglass.com">link[/url]</p>
<blockquote><p>quote</p></blockquote><p>normal</p>

As you can see, the p's, and blockquote's didn't convert at all. The closing A tag did, but not the opening tag. Advice?


cor - 24.04.08 7:43 am

cbparser can convert its own xhtml to bbcode, but as for anyone else's tag soup, forget it! If you use cbparser to create the xhtml, it will work fine.

;o)
(or


Scott - 02.06.08 9:55 pm

First and foremost thanks a lot for this parser and so far I am truly impressed.

Second thing is that i am using YUI and was wondering if you would know that the html generated from that would be fully compliant with cbparser. meaning that the Yahoo GUI editor would produce HTML that would be easily converted to BBCODE using your code.


Thanks a lot


cor - 17.06.08 4:58 pm

Aha! The comments are back for this page! A sticky bug in the new comment thing/pajamas marriage. All better now.

Scott, see my previous post.

Having said that, there is more I could do to make cbparser convert "any old HTML" into valid bbcode tags. It's already a unique and funky feature, it seems smart to make the most of it, extend it. I've had a few emails along similar lines, too, so I'll maybe have a look into this.

for now..

;o)
(or


numstruck - 14.11.08 10:17 pm

Hi (or

This looks amazing, but I'm lost.

I want to add a page to my site with a comment form like this that will use tables and boxes and all of your awesome srcipting.

But I have no idea how to do it, I downloaded your parser, then uploaded it to my host,
and all I get is this exact same page...WITHOUT a comment form.

I don't want the demo page, I just want this exact same form I am typing in...on my page, but every link leads to /blog/inc/... none of which are included in the download.

I know I need /comments.php somehow, I'm just not sure how to do it, I have tried viewing the sources, and I know I need some sort of form fields...and I have read thru the parser comments...but I just don't understand the syntax for do_bb_form string, gui creation, include POST variables etc. etc. etc.

I guess what I am asking is, am I missing some easy step to insert this useful script on one of my pages?
I'm not a total n00b to php, I have learned enough to build the rest of my site, but this just seems to be out of my league...and I really would like to use this.

Please help, I've included my email, and I will gladly link back to your site.


cor - 15.11.08 5:25 am

Hey numstruck! Remember, cbparser is no more than a module to convert bbcode to xhtml and back.

However, cbparser also has the capability to draw funky forms and more, and that might be what is confusing you into thinking that it can do "everything". Almost, but not quite. You're right, you need a "comments.php".

Inside the distribution, is a folder called "examples", and in there, a script called "text.to.html.converter.php". Without too much messing around, that could be hacked into a simple comment facility.

Just like in cbparser.php, you'll need to adjust the preferences. I happen to keep my copy of cbparser (one copy is enough to run all the forms and tools on the site) inside /blog/inc/, though feel free to keep yours wherever you like.

Inside the example script, there's a section of code, something like..

<?
if (isset($_POST['preview'])) { etc... 
?>


You could add your own section, checking not for 'preview', but 'publish' (meaning someone pressed that button on the form). Your section of code would grab the string they posted, and write it to a file. You could display (include()) that file at the top of the page (a-la "previous comments"). And so on.

In fact, as you are not the first to ask for such a thing, by any means, and as it's a fine Saturday morning task, I have gone ahead and done all this, as well as a few other edits, zipped the whole thing up for your learning and amusement, and hopefully, hacking. You can grab that, here..

https://corz.org/engine?download=menu&section=beta/corzblog

Full documentation is included in the script, though if you have any comments or questions about it, feel free to drop them here.

Have fun!

;o)
(or

p.s. the "tables" aren't tables, they only look that way.


next comments (3 pages)

First, confirm that you are human by entering the code you see..

(if you find the code difficult to decipher, click it for a new one!)


gd verification image

 

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!