Making Custom BBCode for Reverse Ordered Lists

Get help developing custom BBCodes or request one.
Post Reply
johnnyutah
Registered User
Posts: 1
Joined: Sun Aug 11, 2013 4:42 pm

Making Custom BBCode for Reverse Ordered Lists

Post by johnnyutah »

Is this possible and what would be the difficulty?

I have never made custom BBCode but I want to make one for <ol reversed> feature which makes it so a list counts down from the highest number to the lowest number...i.e:
[*] one
[*] two
[*] three
should show as:

3. three
2. two
1. one
Can someone please tell me if this is possible or no?

Thanks for reading.
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Making Custom BBCode for Reverse Ordered Lists

Post by Pony99CA »

According to W3Schools, the reversed attribute is currently only supported by Chrome and Safari and Impressive Webs says it's supported by most current browsers except IE, so I wouldn't recommend using it. Maybe you could fake one up using JavaScript, though (and that Impressive Webs article shows a method to do so).

However, if you add one, I believe that your example is incorrect. According to that Impressive Webs article, it doesn't literally reverse the list as you showed, it just counts downward. So the actual result of

Code: Select all

[olrev]
[*] one 
[*] two
[*] three
[olrev]
would be:

Code: Select all

3. one
2. two
1. three
If that's not what you want, you'll need something much more complicated.

Finally, the list tags are "special" BBCodes that don't follow traditional BBCode syntax (you don't need a closing * tag for list elements), so it may be tricky to handle.

Maybe something like the following would work:

BBCode Usage

Code: Select all

[olrev]{TEXT}[/olrev]
HTML Replacement

Code: Select all

<ol reversed="reversed">
{TEXT}
</ol>
I haven't tested that because I only have IE here. Let us know if that works.

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.
Post Reply

Return to “Custom BBCode Development and Requests”