• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Creating new BBCode?

FireChao

Male; call me "she" anyway
I am trying to add new BBCode to my phpBB forum - this is what it says on the screen where I am supposed to add BBCode (I deliberately put a space in the word "font" to stop some text from disappearing):

BBCode usage

Here you define how to use the BBCode. Replace any variable input by the corresponding token (see below).

Examples:

[highlight={COLOR}]{TEXT}[/highlight]

[fo nt={SIMPLETEXT1}]{SIMPLETEXT2}[/font]

HTML replacement

Here you define the default HTML replacement. Do not forget to put back tokens you used above!

Examples:

<span style="background-color: {COLOR};">{TEXT}</span>

<span style="font-family: {SIMPLETEXT1};">{SIMPLETEXT2}</span>

Please could you tell me what to put in to create alignment BBCode. If you know how to do it, it would be nice to have code too.

Thanks again.
 
Do you know HTML and CSS? If not, you need to learn them before you go messing around with forum settings like this if you don't want to come to grief. In any case, you'd need to provide more information about the tokens you can use (in the above example that's things like "{COLOR}" or "{SIMPLETEXT}", unless those are just general input markers and you can name them whatever you like--though I doubt that's the case) before someone could help you, unless there's someone here familiar with phpBB specifically. Additionally, when you say an "alignment" BBCode, do you mean something like a
tag that will give text a specific alignment, or a general-purpose kind of [align] tag that can take left, right, or center as values?​
 
When you say an "alignment" BBCode, do you mean something like a
tag that will give text a specific alignment, or a general-purpose kind of [align] tag that can take left, right, or center as values?​


I was thinking of making seperate codes for
and [centre]

EDIT: I forgot to post this part of the page (it may help)

Tokens
Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.

Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<STRINGNAME>} where <STRINGNAME> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as "wrote" or its translation according to user’s locale.

Please note that only tokens listed below are able to be used within custom BBCodes.
Token What can it be?
{TEXT} Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER or SIMPLETEXT.
{SIMPLETEXT} Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore
{IDENTIFIER} Characters from the latin alphabet (A-Z), numbers, hyphen and underscore
{NUMBER} Any series of digits
{EMAIL} A valid e-mail address
{URL} A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, "http://" is prefixed to the string.
{LOCAL_URL} A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol.
{COLOR} A HTML colour, can be either in the numeric form #FF1234 or a CSS colour keyword such as fuchsia or InactiveBorder
 
For this you won't actually need any complicated tokens. Just use:

[right]{TEXT}[/right]
[center]{TEXT}[/center]

and then as the replacements, use

<div style="text-align:right">{TEXT}</div>
<div style="text-align:center">{TEXT}</div>

As for a random BBCode, that system doesn't look like you can make your own PHP for it, though it might be possible. Does it say anywhere?
 
Thankyou very much, Butterfree - worked perfectly

I can't see anything else concerning BBCode
 
Back
Top Bottom