One BBCode for Multiple options

Get help developing custom BBCodes or request one.
Post Reply
Dazbobaby
Registered User
Posts: 61
Joined: Fri Feb 13, 2009 7:02 pm
Contact:

One BBCode for Multiple options

Post by Dazbobaby » Sun Jul 14, 2019 9:10 am

is it possible to create a single bbcode that has multiple choices?
Example.

Code: Select all

[stars][/stars]

would become

Code: Select all

[stars=1 or 2 or 3 or 4 or 5][/stars]
This way you could have one bbcode and one number [stars=5] then it would show 5 stars and [stars=4] would show 4... and so on.

I already have the bbcode to display the stars

Code: Select all

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
.checked {
  color: orange;
}
</style>

<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
Ebikes and Technology The Bionic Cyclist

User avatar
ViolaF
Registered User
Posts: 1443
Joined: Tue Aug 14, 2012 11:52 pm

Re: One BBCode for Multiple options

Post by ViolaF » Mon Jul 15, 2019 3:21 pm

Just make 5 BBCodes and make them invisible in postbox

[star1][/star1]

Code: Select all

<span style="color: orange;" class="icon fa-star checked"></span>

[star2][/star2]

Code: Select all

<span style="color: orange;" class="icon fa-star checked"></span>
<span style="color: orange;" class="icon fa-star checked"></span>
etc...

Then make one with

[star][/star]

Code: Select all

Please enter a digit after BBCode [star1][/star1] to [star5][/star5]
and write as helpline to the user, to make 1 to 5 behind the bbcode

User avatar
ViolaF
Registered User
Posts: 1443
Joined: Tue Aug 14, 2012 11:52 pm

Re: One BBCode for Multiple options

Post by ViolaF » Mon Jul 15, 2019 3:25 pm

Corrections eg. unneeded checked in class (dont work in bbcode here either...)


Just make 5 BBCodes and make them invisible in postbox:

[star1][/star1]

Code: Select all

<span style="color: orange;" class="icon fa-star"></span>

[star2][/star2]

Code: Select all

<span style="color: orange;" class="icon fa-star"></span>
<span style="color: orange;" class="icon fa-star"></span>
etc...

Then make one > visible with

BBCode
[star][/star]

Replacement

Code: Select all

Please enter a digit after BBCode [star1][/star1] to [star5][/star5]
...and write a helpline to the user, to make a digit (1 to 5) behind the bbcode

Post Reply

Return to “Custom BBCode Development and Requests”