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 (seven pages)   show all comments

Joe - 15.04.05 7:44 pm

Yep, that's what I'm looking for!
Thanks


fajarferdian - 16.04.05 2:11 pm

hm.. no email bbtags huh?
i tried to make it but you registered the < /a > with [ /url ]

need to make my own work around....

nice parser thou...


cor - 17.04.05 2:31 pm

Yeah there is!

Grab the most recent beta, the tag is one of the newer "special" URL tags, and goes [murl="nahnahnyanyanah!"]hit me![/url] where "nahnahnyanyanah!" will be the subject of the mail (quotes are optional)

I updated the "all tags" documentation when I did it, too, both versions! See here and here.

I still have to figure out why on certain pages it doesn't work, because the session variables are being forced into the URL, like on this page. But that's a corz.org comment script thing (and only when it runs here at my host), so shouldn't affect anyone else!

grab the latest beta!

;o)
(or


cor - 17.04.05 3:05 pm

I thought I might fix that right now (the comment script). It seems it's easy enough to disable the php session trans_id stuff, so the mail tag now works even on THIS page. I thought I was in for hours of research and coding. *phew*. cool..

hit me!

;o)
(or


cor - 17.04.05 6:52 pm

back again!

I was thinking about this email thing today, and I thought probably cbparser gets used in lots of "not just me" situations, ie. other users, adding comments and whatnot. So when I was messing about in the engine room just now, I added a regular [email] tag to the mix. It goes like this..

[email=email@address.com]hit me big boy![/email]
hit me big boy!

Clever users will realise you can add a subject yourself, like this..

[email=email@address.com?subject=w00h00!]hit me big boy![email]
hit me big boy!

The code is a bit clunky, and I might try and smarten it up before it gets out of beta. Crucially, the email address is "mashed" to prevent the spambot-friendly plain-text from appearing in the resultant HTML. This creates a bit of a headache at the HTML to bbcode side of things, but that's rarely used, and I've included a workaround anyway.

have fun!

;o)
(or


cor - 27.04.05 9:22 pm

It's new release time!


I've smartened up the processing order a bit, and improved the <pre> handling, specifically, the text is html entity encoded, so you can put regular html tags inside it. oops! You think one of you thousands of users would have spotted that! smiley for :lol: I fixed a bug with links inside <pre> blocks, too.

There's more spammer-protection, and some tasty new URL tags, as well as some other minor bits and bobs. Actually, there's been a LOAD of improvements since the last "official" release, beta users know what I mean!

Thanks for all the feedback, both here, and in my inbox, always appreciated, even if it takes me a few days to say so! Big w00ts and general fuzzy warm feelings go out to the developers at PHPWebSite who have replaced the PEAR bbcode parsing engine with cbparser for their parsing needs because, and I quote, "Compared to Pear's bbcode parser, it is easier to use and edit.". Nuff said! smiley for :D

Everything is backwards compatible, I think, so feel free to download the wholesome and lovable v0.7, and chuck it into place! Maybe have a quick run through the preferences first, though.

for now..

;o)
(or


JackE - 30.04.05 4:27 am

very cute, thanks.


Ben - 06.05.05 1:21 pm

Hi, thanks, i've been looking for something like this for a while.

How can I add a unique CSS style to the to the email tags? I played around but HTML to BBcode produces some odd results.

Ta

:o)


cor - 06.05.05 18:18 pm

simply replicate whatever unique feature inside the php code!

That's not a great answer, I know, but it's not so tricky. In fact, I've been thinking about giving everything a unique css tag, but it's one of those jobs best done all-at-once, and I'll need to see how that might affect css-less users, too. lots of people are intimidated by css.

okay, scroll down to the "create_mail" function and at its end you'll find.. return '<a title="email me!" href=".. , simply add your style right after the < a, so it becomes return '<a class="mytext" title="email me!" href=".. and then add that exact string into the php line that begins..
$html2bbtxt = preg_replace_callback("/\<a title\=\"email me!\" ...
and you should be good to go!

That is, in fact, why I used fixed titles for certian thing, to make it easy to slot other things in later. Remember to escape (but backslashes in front of) quotes inside the preg_replace_callback command in the html>bbcode part. get back here if you have difficulties, suggestions, or whatever..

;o)
(or


adam - 11.05.05 9:14 pm

when i make use of bbcode (on phpbb 2.0.4) a tag like test is apparently stored in the database as test . the bb2html routine converts this to test, which is not rendered properly by the browser.

any ideas?


adam - 11.05.05 9:32 pm

uh, crap.. you'll have to view source to see what i mean. i shoulda known better.


next comments (13 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!