"score" Custom BBCode

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

"score" Custom BBCode

Post by Ant-Mann »

Hello I have a quick question. Sorry if its been answered already, but I can't find anything specifically for this in a forum search.

My problem is I want to add a custom BBCode button to forum posts using this

Code: Select all

tmtp://#score=
an example of a working link is

Code: Select all

tmtp://#score=tidhart:B12-Race:45350:A909ED5D
(The link will only work if you have the TrackMania game)

I have tried various methods, including this most recent attempt:
BBCode usage:

Code: Select all

[score]{SIMPLETEXT}[/score]
HTML Replacement:

Code: Select all

<a href>tmtp://#score={SIMPLETEXT}</a>
but I just can't get it to work properly !!

I have already added 2 buttons using tmtp links for manialinks and join server links which both work, and look like this.

Manialink:
BBCode usage:

Code: Select all

[manialink={SIMPLETEXT}]{SIMPLETEXT2}[/manialink]
HTML Replacement:

Code: Select all

<a href=tmtp:///:{SIMPLETEXT}>{SIMPLETEXT2}</a>
Server:
BBCode usage:

Code: Select all

[server={SIMPLETEXT}]{SIMPLETEXT2}[/server]
HTML Replacement:

Code: Select all

<a href=tmtp://#join={SIMPLETEXT}>{SIMPLETEXT2}</a>
I just really can't figure out how to get tmtp://#score= working !! Ideally it will look like this when typed in a post:

Code: Select all

[score]tmtp://#score=tidhart:B12-Race:45350:A909ED5D[/score]
and the displayed link will just show this:

Code: Select all

tmtp://#score=tidhart:B12-Race:45350:A909ED5D
Its really frustrating now, as i've tried a few methods all with no luck - obviously i'm just not getting it right. Does anyone have the answer to this please ?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51980
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Custom BBCodes

Post by Brf »

Ant-Mann wrote:

Code: Select all

<a href>tmtp://#score={SIMPLETEXT}</a>
but I just can't get it to work properly !!
Did you forget how links work?

Code: Select all

<a href=url>link text</a>

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: Custom BBCodes

Post by Ant-Mann »

Brf wrote:
Ant-Mann wrote:

Code: Select all

<a href>tmtp://#score={SIMPLETEXT}</a>
but I just can't get it to work properly !!
Did you forget how links work?

Code: Select all

<a href=url>link text</a>
Well I tried this approach before as well, you can see from the 2 working examples in my previous post - but this link won't work in the same way for some reason. I've tried this now as the html replacement, which also didn't work.

Code: Select all

<a href=tmtp://#score=>{SIMPLETEXT}</a>
could it be because of the colons in the link ? Again, an example link would be

Code: Select all

tmtp://#score=tidhart:B12-Race:45350:A909ED5D
Please forgive any ignorance, i'm relatively new to this.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51980
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Custom BBCodes

Post by Brf »

Ant-Mann wrote:

Code: Select all

<a href=tmtp://#score=> 
Your URL is not complete.

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: Custom BBCodes

Post by Ant-Mann »

Ok, if I make this the html replacement

Code: Select all

<a href=tmtp://#score=tidhart:B12-Race:45350:A909ED5D>{SIMPLETEXT}</a>
and have the bbcode usage as

Code: Select all

[score]{SIMPLETEXT}[/score]
that will make it work as long as everyone else wants their score to link to that exact url. What i'm trying to do is have tags like this

Code: Select all

[score][/score]
and when someone places their tmtp://#score= link inside those tags, it appears in the post as a link to that score.
Basically its like this

Code: Select all

tmtp://#score=Nickname:Challenge:Time

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

Re: Custom BBCodes

Post by Pony99CA »

Brf wrote:
Ant-Mann wrote:

Code: Select all

<a href>tmtp://#score={SIMPLETEXT}</a>
but I just can't get it to work properly !!
Did you forget how links work?

Code: Select all

<a href=url>link text</a>
Actually, it should be:

Code: Select all

<a href="url">link text</a>
The URL should be inside quotation marks. (In XHTML, all attributes are required to be in quotes, too.)

The OP doesn't seem to be enclosing his TNT URLs in quotes. I don't know if that will matter, but it can't hurt to try.

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.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 »

izojoe wrote:...
I had the problem then?
Yes.

Code: Select all

<a href=tmtp://#score=tidhart:B12-Race:45350:A909ED5D>{SIMPLETEXT}</a>
should have been

Code: Select all

<a href="tmtp://#score=tidhart:B12-Race:45350:A909ED5D">{SIMPLETEXT}</a>
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: Custom BBCodes

Post by Ant-Mann »

ric323 wrote:

Code: Select all

<a href=tmtp://#score=tidhart:B12-Race:45350:A909ED5D>{SIMPLETEXT}</a>
should have been

Code: Select all

<a href="tmtp://#score=tidhart:B12-Race:45350:A909ED5D">{SIMPLETEXT}</a>
Well in that case I should try
BBCode usage:

Code: Select all

[score]{SIMPLETEXT}[/score]
HTML replacement:

Code: Select all

<a href="tmtp://#score={SIMPLETEXT}">{SIMPLETEXT}</a>
and have that user do

Code: Select all

[score]tidhart:B12-Race:45350:A909ED5D[/score]
so it shows tidhart:B12-Race:45350:A909ED5D as a link into the game to challenge that score (as the normal full tmtp link would) but that still doesn't work, and it also doesn't work trying the link inside URL tags. By the way, tidhart:B12-Race:45350:A909ED5D is just an example link of someones score in the game that can be linked to. I don't want to always just go to that particular score, everyone else will have different links after the tmtp://#score= url. I'm just not sure exactly of the right bbcode for it.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 »

Try this:

BBCode usage

Code: Select all

[score]{SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}[/score]
HTML replacement

Code: Select all

<a href="tmtp://#score={SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}">{SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}</a>
Help line (fix whatever the 4th parameter should be called)

Code: Select all

[score]Nickname:Challenge:Time:???[/score]
Example usage

Code: Select all

[score]tidhart:B12-Race:45350:A909ED5D[/score]
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: Custom BBCodes

Post by Ant-Mann »

Thank you very much Ric, that works perfectly :D I'm sure I tried something very similar to that before too, but never got it quite right.

I have one more quick question though, say I wanted the user to do this:

Code: Select all

[score]tmtp://#score=tidhart:B12-Race:45350:A909ED5D[/score]
so that the whole tmtp link is displayed, how could that be done?

I know the other way you showed me works, and I am very grateful for that, I just need to try and get it working like this now if its possible.

Thanks again for all your help.

Edit: Its ok now, A forum Admin from the TM-Forum has shown me this way as well which works nicely:

BBCode usage:

Code: Select all

[score]{TEXT1}[/score]
HTML replacement:

Code: Select all

<a href={TEXT1}>{TEXT1}</a>
Help line:

Code: Select all

Score challenge: Place the tmtp://#score=nick:challenge:time between these tags
Example usage:

Code: Select all

[score]tmtp://#score=tidhart:B12-Race:45350:A909ED5D[/score]
The only thing is, in the ACP when I submit this, it gives this message:
Warning
The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.
But this shouldn't be a problem should it ?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 »

Ant-Mann wrote:...
The only thing is, in the ACP when I submit this, it gives this message:
Warning
The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.
But this shouldn't be a problem should it ?
Yes, that most definitely IS a problem, which is why I didn't do it that way.
Don't do it the way that person advised, that is opening up a security risk on your board.
As the message advises, you should NEVER place a "TEXT" token INSIDE an HTML tag in your "HTML replacement" box.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 »

Try just changing the "BBCode usage" to:

Code: Select all

[score]tmtp://#score={SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}[/score]
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: Custom BBCodes

Post by Ant-Mann »

Oh right, I didn't realise it would be a big problem !! I'll change it back again, but do you know how I can eventually have this ?

Example usage:

Code: Select all

[score]tmtp://#score=tidhart:B12-Race:45350:A909ED5D[/score]
Edit: I just saw the post above (you're quick !) but surely that can't work if the user starts their link with tmtp://#score= inside these tags.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: "score" Custom BBCode

Post by ric323 »

Try it. :)

You'll see the whole point of the changes is to get the "illegal" characters outside the tokens, to prevent the user being able to input them.
Note, this discussion has got so long, I've split it out of the custom bbcode topic.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
Ant-Mann
Registered User
Posts: 9
Joined: Tue Aug 17, 2010 12:26 am

Re: "score" Custom BBCode

Post by Ant-Mann »

Oh you legend !! It does work as well - I won't doubt you again now :)

So now i'm using this:

BBCode usage:

Code: Select all

[score]tmtp://#score={SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}[/score]
HTML replacement:

Code: Select all

<a href="tmtp://#score={SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}">{SIMPLETEXT1}:{SIMPLETEXT2}:{SIMPLETEXT3}:{SIMPLETEXT4}</a>
Help line:

Code: Select all

Score challenge: Place the tmtp://#score=nick:challenge:time between these tags
and the example usage would be this:

Code: Select all

[score]tmtp://#score=tidhart:B12-Race:45350:A909ED5D[/score]
This works perfectly with no warnings, so thanks again I am very grateful for your excellent help and advice :D

Locked

Return to “[3.0.x] Support Forum”