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][/img], [code]code[/code],[code]teletype[/code], [url="" 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 (nineteen pages)   show all comments

cor - 18.11.08 7:26 pm

Interestingly, as you were posting that, I was adding all these ideas, and others, into the example script! check it out..

while I read your post properly..


cor - 18.11.08 7:35 pm

smiley for :lol:

Well, I did exactly as you (were going to) ask! First, the "show only recent comments". You can set any number there, or 0, to have it always show all comments.

There's also an optional link; in fact, it's two links, that change automatically; either "show all comments", or "show only recent comments", depending on the current state. I used a simple $_GET variable for that, either it's set or it's not. It won't interfere with the form in any way, either.

I dunno how embeddable this is (is that a word?), but it's a simple enough design (though with cbparser in the mix, also quite feature-packed!), it should be easy enough to get it to play nice with most any standards compliant page. I would work backwards, pasting your index page into the comments script, simply replace my headers and such with your own content. I even have a php comment to show where the footer goes!

Or if your page is large and/or complex, simply remove the header parts from the example script, and paste everything else into your page. Or something like that; shouldn't be too tricky. The comment facility here at the org is designed to be "included" inside other pages, the example script simply does its own headers and such so that it works as a stand-alone demo - remove that stuff, and you're good to go.

But if you do have problems at this stage, feel free mail me a copy of your page (before and after you've added the comments code) and I'll take a look at it for you.

I might look into providing some kind of simple switch inside the comment script to have it stand-alone or embedded (like corzoogle and the distro machine have), we'll see. I don't want to make it *too* good, though. One day, I do plan to put out my own comment script, the one we are using here. But there's still a few things I'd like it to do before it goes public, and I've not been in any great hurry, imagining that there must already be zillions of capable comments script out there. But after reading your comments, I might have to re-think this and get a move-on!

Hopefully this wee example script will keep you going in the meantime.


p.s. YES! Install Apache. Do it now!

[edit]I went back in and enabled embedding. It's not an option, it just happens automatically, the script switching to stand-alone or embedded mode, as required, easily done. You could even access it both ways at once. Plus a few other wee improvements. If something like this really is needed, then here it is![/edit]

numstruck - 19.11.08 1:37 am


Sorry it took me so long to reply, I had downloaded the first script, had a
million problems...(again with the can't send headers errors. So like a fool
I tried hacking the parser itself...not a good plan. Then I deleted everything and
went back to the last version before the refresh script, it all worked again, so I
was coming back to ask how I might fix it...and shazam, you already have.
I downloaded the newest script, and it works like a finely crafted swiss timepiece.

Now some may think it is too much time to waste on a simple comment script, but I
think it is the little details that make a site worth returning to again and again.
Besides, I know many people will use it as a default chatroom, message board thingy.
(so for my site anyway, the refresh problem was key) and all the other features.

Tables, drop-caps, spans, boxes, references, formatting, colored code, smilies, lists,
headers, mail-mashing, anchors, floats, nesting, symbols, even a damn preview...


Thank You, Thank You, Thank You
an image

Interesting effect, spanning an image with a box... smiley for :lol:
PS - as soon as I have a few spare drachmas I will send them your way

numstruck - 19.11.08 5:25 am

FYI - on your bbtags page you say to add any examples that you're missing,
but there is no PUBLISH button, only a preview here they are...

They are the 2 animated tags, blink and scroll (or marquee actually)
[blink] [/blink]

[marquee] [/marquee]

With the proper modifiers scroll can be faster or slower, l-r, r-l, or even delayed.
<marquee direction='left' behaviour='scroll' scrollamount='4' scrolldelay='3'>

Just thought you might find them interesting or useful...or amusing if nothing else.smiley for :D

Another fascinating tidbit...color tags won't work inside of blink tags smiley for :roll:

cor - 19.11.08 6:50 am

Haha! No, there are no such tags! What you have discovered, is "InfiniTags™", which basically enables you to construct bbcode tags on-the-fly, and have cbparser convert them to XHTML, or in this case, HTML. cbparser is filled with such hidden wonders!

Some tags you might create on-the-fly could be valid XHTML, but those definitely aren't, which is the main reason cbparser doesn't have them built-in. You can do BLINK in css and still have valid pages, I do this elsewhere on-site - but generally it's a tag folk avoid, with good reason!

By the way, there used to a "publish" button on the bbtags page, but it was getting out of hand, and folk kept posting tech questions about cbparser there, instead of here, so I just switched it to preview-only. There's a mail link for missing tags, now. I think I have them all, though.

I'm glad you like the comment script. Even though it's small, it's very capable; and with automatic embedding and such, highly usable; drop-in-and-go. It will be interesting to see where it pops up.

Thanks for the feedback!


numstruck - 19.11.08 6:32 pm

Well, I didn't exactly just discover them, I have used both for many years.
All of my old gallery pages had/have scrolling NO REPOST headers.
(which is why I knew you could used direction, speed, behavior, and delay modifiers)

They are deprecated now, but then so is the font tag, and millions use it regardless.
I don't really see any advantage of validating pages anyway, and have never bothered.
The validators themselves may be useful for finding errors in your code, but unless
you are creating websites for a customer who insists on valid pages, what is the appeal?
The most popular browser in the world, (micromush IE), isn't standards compliant anyway.

I have read a few debates on the subject, and they usually justify the validation with -
" the future...", which seems particularly humorous given IE's 15 year refusal to
adopt the standards compliant modes of all other modern browsers. (FireFox, OPERA, etc.)

But what really has me curious is, you say people avoid the tags "with good reason"
since I already know you are extremely web savvy, your opinion holds good weight.
I use both of these tags, (in html pages), on dozens of sites, and the blink tag will
work even in forums and shoutboxes. So what would be the point of avoiding using it?
... or deleting the examples for that matter. Not criticizing mind you, just curious.
I can see maybe changing the scroll since I hotlinked one of your own smilies, but
that still wouldn't explain deleting the blinking example...

On another subject, I finally had a chance to browse around the rest of you site here,
and of course discovered even more of your remarkable collection of assorted goodies.
Your blog is an especially fascinating read, I wish I had more time for the archives.
Anyhoo, I have used up enough ink for now, cheers and regards,

cor - 19.11.08 8:53 pm

Oh, I could tell you had plenty of experience with the marquee tag! The discovery I was referring to, was InfiniTags™, which enables you to make up tags on-the-spot, even tags which are not built-in to cbparser. You see? You can even use [font]!

But if you do, I'll edit your post afterwards, and switch it for a valid css statement! Please don't take the deletions personally, I regularly delete whole posts, if I think they add nothing to the site and/or are pointless, or just because. I figured your point was well made without actual smileys scrolling across the page! Like lots of people, I find things flashing and moving on web pages quite distracting, which is why I earlier said, with good reason.

As I implied, you can still do perfectly valid blinking with CSS, and I do use it myself on the voyager router pages, once, where I want to REALLY grab their attention. I don't condemn its use, but I wouldn't encourage it, either. It all depends on the site and its content. In a fun chat page, loads of blinking isn't so bad. I generally associate blinking text with Religio-Jesus Sites.

As for XHTML and page validation; the biggest reason, for me, is that I can create simple, lightweight, easy-to-edit pages that are guaranteed to render in any standards-compliant device. More and more this is becoming important, even crucial, as web browsing is less and less something we do only on the desktop.

Most HTML4 is a soup of half-standard-compliant, half-proprietary tags, a confusing mess which is a very real challenge to render on a memory-starved, or CPU-starved device, as many smaller devices are. A device designed to go into, for example, space, isn't going to have gobs of spare memory and cpu capacity; it will be designed to be as efficient as possible, to use as little power as possible. Using less power is, of course, generally a good thing on Earth, too.

The XHTML+CSS model follows this design ethic by having a relatively small number of tags, which is therefor easy to parse, and easy to render. Moving style out of the content, and into included style sheets, again, creates a more efficient structure, geared towards rendering simplicity. Simplicity is good, not only because it makes working on your pages a helluva lot easier, it makes life for the browser easier, too.

IE might not be standards-compliant, per-se, but it is, up to a point, capable of rendering a simple standards-compliant page, and continuously improving in that area, but like most desktop browsers; Opera, Firefox, and so on, can also render pretty much any code, work around most errors to produce a highly readable page from any old jumble of HTML, but that's definitely not true of every platform, or every environment, right now.

For starters, spiders like simple, valid pages. If you want to have pages that are guaranteed to be spidered effectively, validation is a must. When I switched over to XHTML and started validating, I got an across-the-board hike in my Google rankings. And Google is one of the most advanced web bots in the world. Think about it; valid pages makes for better search engine rankings, even with Google - Like most desktop browsers, Google is expert at seeing through webmaster errors. Most bots are brain-dead by comparison..

Yes, Firefox et-al, will be spot that Oops! you forgot to close a div, and will correct this for you, visually. But unless you validate your page, you won't know about it. Then, along comes "SomeBot", which like all bots, sees your page as no more than one big string of text. Sadly, it isn't Firefox-in-a-bot, and so doesn't realize that you actually meant to close that div, and treats the rest of your page as div properties, ignores it. Same goes for wap-converter gateways trying to parse your content for cell phones, TV set-top browsers, etc.

If you install the Firefox "TIDY" plugin, you can see at-a-glance if a particular page is valid - if not, a big red X catches your eye. Be warned, though; if you do install it, and someone posts a <font> tag, or similar deprecated tag on your page*, you will have an almost uncontrollable urge to go in and switch it for a css class! smiley for :lol: Same goes for other deprecated tags!

As well as spiders (which make up a sizable proportion of modern web traffic), web content, in general, is more and more being scraped and utilized in a variety of unforeseen ways. Simple, standards-compliant, valid pages make this process relatively painless, and you may find your site being enjoyed and promoted in all sorts of places, on all sorts of interesting devices.

The shift to XHTML as the de-facto standard web language importantly signals a shift in our working style, the beginnings of discipline in our web coding. Sure, a lot of the design principles of strict XHTML + CSS, you could also adopt with regular HTML4+CSS, but people just don't. Old habits die hard.

Beginning (again) with XHTML is a chance to free ourselves from old-school limited (and limiting) thinking; layout with tables, styling with endless font tags, and so on - and thereby unleash our imaginations. Thinking back to when I used to have to edit these pages, it gives me the shivvers! Even trying to locate sections gave me a headache.

And don't forget screen-readers for the visually impaired. smiley for :ken:

Anyhoo, those are the main reasons I stand at this side of the HTML Vs XHTML debate**.

I seem to have gone off on one!

Glad you liked the blog; I recommend the archives on one of those hazy mornings after a party or gig. Let it wash over the mind. And never forget; just because it validates, doesn't mean it's valid!


If you still use HTML4 (or 3!) pages then the old tags not deprecated. Only if you have upgraded your pages to XHTML are they no longer valid. The blink tag was never valid, by the way; it's a proprietary Netscape tag. Marquee was Microsoft, I think. Other browsers and web entities may or may not recognize and implement them. And that's what was so wrong with non-standard tags.

** And don't get me started on the pure benefits of coding in XHTML. Not just design clarity and ease of editing, but extensibility; the ability to throw in other kinds of markup, even define namespaces and incorporate totally new kinds of markup at will. And don't forget automatic XML document conversion, so you could deliver your stuff as PDF, or SVG, and more, much more. The future is NOW!

numstruck - 20.11.08 8:21 pm

Hmmm, a very thorough explanation.

I suppose my problem is that my target audience is never going to be pda's or webTV,
they aren't going to be using screen-readers or browsing from outer space.

99.9% of them will be using OPERA or FireFox, and would think XML was a porno site.

Likewise, I'm not interested in ranks or SEO, in fact I hope to ban spiders completely.
(The last thing I need is web-crawlers using my limited free bandwidth)

It actually seems strange to me that something as useful as marquee would not be
included in web standards, even my digital watch can scroll numbers on the screen.
I suspect it has more to do with pushing technology like flash and java applets that
waste gigabytes of bandwidth and that the average user has no idea how to control.

It's a matter of perspective I guess, some say the web is becoming more "user friendly"
I say just the opposite is true. But I am admittedly biased, I think flash and java
are really nothing more than legal viruses, and most websites are only concerned with
advertising and tracking the users who visit them.

Sites like yours do give me some hope tho, not only offering free software and downloads,
but also giving advice and interacting with the people who wish to use that software.
I'm sure there are many in the industry who would happily see sites like this disappear,
along with all of the P2P, torrents, warez, hackers, crackers, tech-forums, security &
proxy sites, free file hosts, picture sharing sites, you-tube rippers, and a miriad of
other free and useful sites, forums and applications.

They would happily see the day that you first pay for a PC, then pay for a browser, then
pay for an ISP, then pay for every MB of bandwidth, then pay for the speed at which you
use that bandwidth, then pay for every application and program you use once you are
connected, then pay for any content you view, and pay again if you wish to save it. smiley for :roll:

But that day isn't here yet, and I hope my site will push it further into the future.

Time to fly, almost out of ink again...

an image

numstruck - 03.12.08 8:48 am

Hey Again,

I wonder if you might help me with a piece of code driving me insane...
I have installed a flat-file forum, and it doesn't display hotlinked thumbs.

In fact all of the "code" tags are basic html like <code> and <strong>
I checked their help forum and found this...

Open function_list.php and find function basic_html. It starts around line 680. Anywhere in that function, paste this:

preg_replace("#\<img\>(.*?)\</img\>#si",'<img src="\1" />',$text);

Then just enclose your images in <img> tags

It will work fine that way...
But what I really want is for it to turn something like this...


into a hotlinked thumbnail like..

<a href="" target=_blank><img src=""></a>

I have tried everything, can you help?
I just don't seem to be able to come up with the correct stringsmiley for :erm:

cor - 03.12.08 3:51 pm

Ahhh.. thanks for reminding me about that old section of code I meant to comment-out (or better yet, optionalize) in cbparser, the one where it slips into "legacy mode" during the html2bb() function when it discovers deprecated strings, like target=; makes it almost impossible to edit modern posts!

As to your issue, WTF? This has nothing to do with cbparser! Am I your free tech-dude now, or what? smiley for :lol:

Actually, it does have something to do with cbparser, because here's my answer; bypass that shoddy code, and use cbparser, instead. Really. It would be an easy project.


I'll have to have a rake in the post-dump log and see if I can fish it out. I could have sworn I posted it, but perhaps not. I remember being slightly intoxicated at the time. smiley for :roll: There was some server trouble recently, so there's no guarantee that particular log is still around, but I'll look, I promise.

Back to your [IMG] tags and such; I deduced that you are using Silentum message board. Why not drop into their forum and suggest; in the nicest possible way, of course; that their posting system is complete shite, and perhaps they should consider plugging in something like, oh, I dunno … cbparser? Or if that doesn't appeal to them, maybe just cooking up some basic bbcode themselves.

If they bite, simply wait for the update. If they don't, or you don't want to wait, plug in cbparser for yourself.



p.s. that's not a hot-link, this is a hot-link.

numstruck - 03.12.08 8:01 pm

Not sure where your reply went... I have that problem a LOT when I'm a "slightly intoxicated"

You deduce correctly that it is silentium board, and
Yeah, I know the post wasn't really about cbparser, but honestly, I figured you might have a solution.
Sorry for acting like you are free tech-support, it is just really hard to find someone to ask sh!t like this.

I have been to their forum, but even old questions go unanswered, I think the place is basically a ghostown.

Plugging in cbparser would be my dream come true solution, unfortunately I am totally clueless how to even begin.
I struggle with even simple rewrite rules like the one above, modifying the entire forum is out of my league.

On the bright side, they do give their permission to change "anything" in their README file.
So if you have time to explain how I might do it, (or waste five minutes and do it for me), I would be a very happy camper.

Heck, you already have the parser and the awesome comment script, you should just add a forum to your suite of offerings.
I bet you could make a forum script in no time that would be 100 times better anyway.
Finding a flat-file forum is as impossible as finding a decent comment script...

Cheers and Regards,

PS - I probably wasn't clear about the hotlink thing, what I want is for people to be
able to post the regular forum code for thumbnails from sites like Imagevenue etc.
the codes that begin with [url= and have them display correctly as hotlinked thumbs.
EDIT: I just tested it with preview...cbparser doesn't display them either :(

next comments (1 page)

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!)

Enter the 5-digit code this text sounds like :

lower-case bee, Upper-Case En, f-hive, lower-case you, Upper-Case Ee


Welcome to!

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