Page 1 of 1

Custom BBCode additions

Posted: 2008-12-26 11:53pm
by Uraniun235
As noted in my signature, and as noted in posts by STARK, strikethrough would be awesome to have.

Fortunately, it appears to be a very simple addition to make, as detailed on this page:
To get started, simply go to your ACP (Administration Control Panel) then click on the Posting tab. Next, click on BBCodes on the left. Since you haven't added any custom ones yet, click on the Add a new BBCode button. You will now see 3 text input areas and a checkbox. The BBCode usage box is where you enter the BBCode -- i.e. similar to what users will enter. The HTML replacement text box is where you enter the HTML replacement code. The Help line text box is where you can enter a tip on how to use your new BBCode. Tips are generally displayed when the user rolls his or her mouse over the BBCode button on the posting screen. Finally the Display on posting page option allows you to show or hide the button on the posting screen. Hiding the button does not disable the BBCode -- users can still manually enter the BBCode.


...


BBCode usage:
{TEXT}


HTML replacement:
<span style="text-decoration: line-through;">{TEXT}</span>


Example usage:
strikethrough text

The page also includes examples for subscript and superscript, which may be handy for when people might like to express exponents without having to go through the hassle of creating/uploading/linking an image, or using the clunky caret character.

I know that our helpful admin staff are quite busy with real-life obligations and with other board management issues, but the impression I get is that this should be a very simple and quick procedure, so hopefully it shouldn't be a burden to implement this should they agree to it.

Thoughts?

Re: Custom BBCode additions

Posted: 2008-12-27 08:21am
by Darth Fanboy
Seconded, the motion passes. *grumbling from moderators* Wait, what do you mean I can't do that here?

I support this idea, especially if it is indeed this simple to implement.

Re: Custom BBCode additions

Posted: 2008-12-27 11:35am
by CmdrWilkens
If it is that easy I think it would be worthwhile to have. That being said I can see an awful lot more use out of super- and subscript.

Re: Custom BBCode additions

Posted: 2008-12-27 02:08pm
by Rogue 9
It's very easy; tables can be done too. I have superscript, subscript, tables, spoiler blocks, and a few other handy BBCodes already encoded in my own board on phpBB3; to make it as easy as possible, I can provide the necessary coding (which is already easy enough, as evidenced by the fact that I managed to implement it myself :razz:), and then all an admin would have to do is copy it to the relevant section of the ACP.

Re: Custom BBCode additions

Posted: 2008-12-27 06:13pm
by Manus Celer Dei
Subscript and superscript would be great. I always get headaches trying to read people's mathsy-sciencesy posts when they're full of ^s and []s and so on and suchforth.

Re: Custom BBCode additions

Posted: 2008-12-30 07:05am
by Edi
Strikethrough, subscript and superscript would be good additions. Don't know if we need anything else nearly as urgently.

Re: Custom BBCode additions

Posted: 2008-12-30 11:30am
by Eleas
Edi wrote:Strikethrough, subscript and superscript would be good additions. Don't know if we need anything else nearly as urgently.
I concur. Also, I think a gradual introduction of such changes would aid in debugging, should errors crop up.

Re: Custom BBCode additions

Posted: 2009-01-08 05:20am
by Brother-Captain Gaius
This would be an excellent addition. The applications and usefulness of superscript and subscript are obvious, particularly to such a science-oriented board such as this.

Strikethrough, though admittedly more for comedic purposes, is a versatile and generally handy thing to have. It belongs right alongside bold, italic, and underline.

Re: Custom BBCode additions

Posted: 2009-01-08 05:39am
by Stark
I'm curious about the practicalities of implementing this - I have no idea who has the access to do so any how often they're available.

Re: Custom BBCode additions

Posted: 2009-01-08 08:37pm
by Rogue 9
Implementing them is ludicrously easy, and I can't see how it would cause bugs with the board. The only limitation I'm aware of is whether the admins want to do it and whether or not one of them has five minutes to spare.

Edit: Just to make this simple, a fellow board member asked me for the code for the requested additions (as well as some others that I've implemented on my board) back in October when this first came up. Just to make this easy, I will simply quote my reply. The code next to the lines marked "bbCode:" goes in the field marked bbCode in the custom board codes tab of the ACP, and the code marked HTML goes in the HTML Replacement field just below it.
Rogue 9 wrote:Strikethrough:
bbCode: {TEXT}
HTML: <del>{TEXT}</del>

Spoiler block:
bbCode: Spoiler
{TEXT}
HTML: <span class="spoiler"><span class="spoiler-box" onclick="spoilerToggle(this);"><span class="spoiler-content" style="visibility:hidden;">{TEXT}</span></span></span>

Titled spoiler block:
bbCode: Spoiler
{TEXT2}
HTML: <div class="spoiler"><div class="spoiler-title">{L_PRIME_BBCODE_SPOILER}: <a href="#toggle_spoiler" class="spoiler-link" onclick="return(spoilerToggle(this));">{L_PRIME_BBCODE_SPOILER_SHOW}</a> {TEXT1}</div><div class="spoiler-box" onclick="spoilerToggle(this);"><div class="spoiler-content" style="visibility:hidden;">{TEXT2}</div></div></div>

Subscript:
bbCode: {TEXT}
HTML: <sub>{TEXT}</sub>

Superscript:
bbCode: [sup]{TEXT}[/sup]
HTML: <sup>{TEXT}</sup>

HTML tables are complex, and require multiple tags to work properly. Hence, bbCode tables are similar. The vBulletin board software has a much easier table code, but I haven't yet been able to replicate it, and can't dismantle it to find out how they do it since vBulletin is pay-only and proprietary. At any rate, here are the table codes.

Table tag:
bbCode: [table]{TEXT}[/table]
HTML: <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse">{TEXT}</table>

Table header, used in the top table row to make headers for the columns:
bbCode: [th]{TEXT}[/th]
HTML: <th>{TEXT}</th>

Table row, used to define the beginning and end of a row in a table. Simply using the Return key in the code will not suffice to create a new row; it will simply put a second row of text in the same cell.
bbCode: [tr]{TEXT}[/tr]
HTML: <tr> {TEXT}</tr>

Table cell, used to define cells in the table:
bbCode: [td]{TEXT}[/td]
HTML: <td width="50" valign="top" style="width: 37.5pt; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
{TEXT}</td>

Table cells of a different background color, in case you want to make rows or columns different colors to help with following them:
bbCode: [td2]{TEXT}[/td2]
HTML: <td width="50" valign="top" style="width: 37.5pt; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in; background: #99CCFF">{TEXT}</td>

If you want a different color for the color ones, simply replace the color code (the #99CCFF line in the HTML) with the appropriate color code. If you want to find a color code, simply use the Font Color function on this board, since it uses the color codes instead of text descriptors to denote them. Click the color you want on the palette to the right of the post form and copy that color code into the HTML. If you want more than two colors, of course, you can simply create td3, td4, and so on as additional tags.

When making a table, put all the text on one line. If you use line breaks at every row, the board won't know how to interpret it, since the [tr] tags also include line breaks themselves, and will deal with it by creating a large blank space above the table, with size corresponding to the number of line breaks in the code.

Since making a table this way is a pain in the ass, allow me to direct you to the simple spreadsheet converter. Simply do your table in a spreadsheet, copy it, and paste it into the converter, telling it to convert to HTML. Once that's done, put the result in a word processor, and do a find/replace to replace all < tags with [ and all > tags with ]. There's your bbCode table; post the result and you're done. Much easier than typing it all up.

And that's all the ones I've coded so far. If you want more, it'd be easier to look up an HTML tutorial than to ask me to program them, since I'd have to get a tutorial myself to do it.
Edit2: I see titled spoiler blocks are already in.

Re: Custom BBCode additions

Posted: 2009-01-12 06:53pm
by Imperial Overlord
I'm in favor of it.

Re: Custom BBCode additions

Posted: 2009-01-21 04:23am
by rhoenix
I say the three additions, which are the addition of strikethrough text, as well as subscript and superscript for notation would all be harmless at worst, and useful at best. I'm in favor.

Re: Custom BBCode additions

Posted: 2009-01-21 09:24pm
by Mayabird
I motion that we take this to a poll and get some strikethrough action started, with subscript and superscripts too. Or, however this "start a poll" stuff works.

Re: Custom BBCode additions

Posted: 2009-01-22 07:54pm
by Uraniun235
I second the motion.

Re: Custom BBCode additions

Posted: 2009-01-22 07:59pm
by Count Chocula
Edi wrote:Strikethrough, subscript and superscript would be good additions.
If those were added, I'd be hyped enough to click the PayPal icon and give Mike a little love! I'm tired of typing (TM).

Re: Custom BBCode additions

Posted: 2009-01-22 08:31pm
by Havok
Count Chocula wrote:
Edi wrote:Strikethrough, subscript and superscript would be good additions.
If those were added, I'd be hyped enough to click the PayPal icon and give Mike a little love! I'm tired of typing (TM).
This should be done regardless.

Re: Custom BBCode additions

Posted: 2009-01-23 02:06am
by Phantasee
fuck you guys, i'm starting a vote thread!

http://bbs.stardestroyer.net/viewtopic. ... 0&t=130845

Simple enough, Yes/No/Abstain. I figured there's been enough discussion, not just in this thread, but across the board, to warrant a vote thread.

I left out the Tables business because it's horribly ugly, I don't want to scare off the admins, and I don't think there's as much support for that as there is for the three key additions of Strikethrough, Superscript, and Subscript. I mean, I could start a poll to find out...but I'd rather not. :P

Re: Custom BBCode additions

Posted: 2009-01-23 01:45pm
by Rogue 9
Fair enough. If someone wants to make a table about something, a subpage on the Imperial Wiki will do just fine; the spreadsheet converter I linked to will also convert to wiki code. An example.