cbparser bbcode tags
all o' them! (well, probably..)
This page aims to be the most complete reference for cbparser's many bbcode tags. Though it may not be. Feel free to copy and paste any of the examples here into the comment form at the bottom, test them out. If you find a cbparser tag that isn't here,let me know! Have fun..basic tags..
[b]bold text[/b] [i]italic text[/i] [u]underlined[/u] [big]big[/big] [sm]small[/sm]
code..
Please don't try these examples at home..[code]sudo rm -rf /*[/code] [coderz]echo "oops" > /etc/passwd[/coderz] [tt]for i in $( find . -name "*.conf" ); do chmod 777 $i; done[/tt]There's also..
[pre]preformatted monospace text, retains it's spaces and tabs.[/pre]which is useful for code blocks, ascii art, etc. This gets used a lot.
If you are feeling truly fruity, there's also a Cool Coloured Code Tag™, like this..
[ccc]<?php $arr = array("tahini", "honey", "spoon"); foreach ($arr as $key => $value) { echo "Key: $key; Value: $value<br />\n"; } ?>[/ccc]which will do automatic syntax highlighting of your php code. nice.
references..
This one goes in the text..[ref]*[/ref]It doesn't have to be a "*", it can be whatever you like, usually numbers.
the references themselves generally go at the foot..
[reftxt]I am the reference![/reftxt]
tables..
Not "real" tables, but lovely pure CSS tables. a wide selection..[t]the whole table goes inside here, ie. the rows and their cells[/t] [bt]ditto, but with a border this time[/t] [st]same again, but s p a c e d o u t[/t] [r]a row. put your cells inside here[/r] [c]an individual cell, for regular two-column layouts (currently 45% wide)[/c] [c1]this cell fill fill the whole row if you let it (100%)[/c] [c5]this cell will take up 50% of the width[/c] [c5l]same again, but aligned left (generally the default)[/c] [c5r]and this one will be aligned to the right[/c] [c3]use this cell for a three-column design[/c] [c4]this one will span four columns (and may explode!)[/c]example table:
[t][r][c4]this table[/c][c4]has four[/c][c4]cells[/c][c4]on one row[/c][/r][/t]Because these are pure CSS layout tables you can use any and all regular table tags for actual tables. InfiniTags™ makes this trivial. You can also change what individual cell types do, if the above is confusing to you. It's only CSS.You can also make..
[box]boxes[/box]which are spans; they can be stacked and all sorts; as well as..
[bbox]big boxes[/bbox]which will fill whatever space you give them. Obviously, you can also put things inside your boxes.
lists...
[list]put the items inside here[/list] [*]begin each item with thisFor example:
[list][*]well [*]I'm a list [*]with 3 items[/list]There are also [ol]ordered lists[/ol]. note: you can also use [ul][/ul] for lists, and if you like your close your list items, you can use [/*], but this is optional.
smileys..
:lol:
:ken:
:D
:eek:
:geek:
:roll:
:erm:
:cool:
:blank:
:idea:
:ehh:
:aargh:
images..
[img]https://autoconfig.corz.org/img/no_image.png[/img]There are also a couple of generic tags for left/right alignment, very useful for floating images left or right (the old left and right image tags are deprecated) though you can float any old thing inside them..
[left]for left-floating[/left] [right]for right floating[/right]
anchors (links)..
[url="https://autoconfig.corz.org/"]home![/url]You can put any valid anchor property inside the url tag..
[url="https://autoconfig.corz.org/" title="it's tech!"]hmm.. looks like the server's down[/url]You can nest tags inside other tags, like image tags inside url tags, etc. It's fairly flexible.
Note: you must use double quotes around your URL's. This creates nice html/xhtml. You could 'single' quotes if you really wanted to, cbparser doesn't mind, though if you do, the automatic tag case correction will turn your URLs to lower case, which may or may not screw them up. Use nice "double" quotes and all is well. There are other flavours of URL, too..
[eurl="http://somesite.com"]for an external link [/url]external links open in a new window or tab, depending on the browser.
[turl="for information"]a simple "link-less" pop-up title[/url]You may notice I altered the url tags slightly. The new eurl tag has exactly the same functionality as the old url tag, except if you want a new window to appear you must mindfully add the "e" to your links. I reckon most users are savvy enough to control their own browser's new tab/window behaviour.
The regular url tag now does exactly the same thing as the old purl tag. The purl tag (#page link) has therefore been deprecated; you can use regular url tags for those, too. cbparser should handle the switch automatically, converting old structures and flipping any erronous purl tags that might be enterted.
A corz.org speciality! "e" for external, "t" for "title-only", "m" for mail..
email bbcode..
[mmail="crazy parser dude!"]mail me![/mmail]puts *your* "mashed" "mailto:" link inside your text (think "my mail"; the [murl] tag is deprecated). You can set your webmaster email address in the cbparser preferences. In this example, the subject of this email will be set to "crazy parser dude!". Users can add regular email tags, too, like this..
[email=email@address.com]hit me big boy![/email]and smart users may even add a subject line, like this..
[email=email@address.com?subject=w00h00!]hit me![/email]Still fairly new, and the code is messy, but it works fine.
note: quotes are optional for mail tags.
dividers..
[hr] horizontal rule, 70% wide, centred [hr2] horizontal rule, 50px wide, aligned left [hr3] horizontal rule, 100px wide, aligned left [hr4] horizontal rule, 150px wide, aligned left [block]a quote block (centred, slightly narrower than regular paragraph)[/block] [mid]I'm in the middle! (centred, "CENTERED" if you're at the left of the Atlantic)[/mid]You can use different styles for these, it's all in the CSS.
drop-caps..
These are often font-dependant, hence the five flavours, mess around.[dc1]i[/dc] drop-cap, from a [dc2]p[/dc] thin size all [dc3]L[/dc] the way up to [dc4]X[/dc] a ... [dc5]W[/dc] thick sizeSometimes, if you feel funky, you can squeeze two letters in.
There are [size] tags now. I spotted someone trying it, why not! These use the standard bbcode pixel sizing, so anywhere from 1 (minute) up to, well, some large number. For a big word, you might do somthing like..
[size=24]I AM BIG![/size]I haven't really tested these yet, but they so should be okay. Feel free to test away!
miscellaneous tags..
[sp] a space, for when you need real space (creates an )With a proportional font (not monotype), spaces will squish-up, using
[sp]
ensures you get a proper space in your text. You can use lots of them together.[[ left square bracket ]] right square bracket [quote] this becomes a <cite> tag[/quote] (folk just started using [quote] tags, so I made it *do* something!) [news]wow![/news] news headline (It's big, and looks good in large blocks of text)
colours (same as "colors" ;o)..
You can now colour your text..[color=red]using standard web color values, or..[/color] [color=#9C64CA]a proper hex color value, the best of both worlds.[/color]These work really well, so long as you don't use quotes, so you can have all sorts of colour combinations, in even a single word!
&entities;
Special characters are automatically html entity encoded; in other words; & becomes &, < becomes <, etc, and as it's pure utf-8, you can throw pretty much any old entity into the parser and it should come out the other side unscathed. You can enter either the raw character or the &entity; value into the textarea, they will be displayed (on the page, and in your textarea) as raw entites, but wherever possible, saved in encoded form. Try it.I think that's about it, hopefully I won't be adding many more tags, and if I do, I might even remember to pop them into this "list o tags".
notes and tips:
As well as this little lot, you can (damn, I really meant to come up with a cute name for this; erm, what about "auto-tags", or "wing-a-tag", or "infinity-tags" (oh, that's nice) or, och it doesn't matter just now) just MAKE UP TAGS! ..[legend]legendary functionality![/legend]would work just fine, even though, strictly speaking, there's no such tag! Most any valid html can be entered as bbcode..
[dl] [dt]erm, dunno what goes here, probably a title[/dt] [dd]this is a definition table, whatever the hell that is[/dd] [dd]I guess it works like this. hmm. might be useful[/dd] [/dl]
So long as it's a valid, balanceable (I just made that up) tag, cbparser will parse and convert it to valid html markup. essentially, you are just using the quick'n'handy square bracket instead of the corresponding akward angle bracket. It makes you wonder; if keyboards had been designed differently, would bbcode parsers ever have been invented? anyway, an example:
Superscript isn't built-in to cbparser, but this would work just fine...
There I was, going along at my own size and height until [sup]Bang![/sup] woah, what was that?
I've added both-ways (there has to be a better word than THAT!) conversion to InfiniTags™, so if you ever edit the text in the future, the InfiniTags™ should come back just like regular bbcode tags. Well, I'm impressed.
I've tried to make cbparser comprehensive, yet flexible, simple, yet advanced. It's linear, so you can plug new tags in easily enough, just open cbparser.php in a good (and that means linebreak and utf-8 savvy, not Notepad, and not Word!) text editor, and hack away. backup first, of course.
That's it! make bbfun now!
;o)
You can test out any tags here, just copy and paste from the examples above, or make up your own tags!
note: you can leave questions about cbparser here
this page is just for testing..