Does anyone know how?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
KRB99
Registered User
Posts: 392
Joined: Sun Jan 20, 2008 1:24 am
Location: Canada
Name: Kyle

Does anyone know how?

Post by KRB99 »

How to do the #'s that you click on and it highlights part of the page?
Attachments
how.JPG
how.JPG (55.04 KiB) Viewed 895 times
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Does anyone know how?

Post by karlsemple »

It is done using two custom anchor bbcodes to create in page anchors.

BBcode

Code: Select all

[goto={TEXT1}]{TEXT2}[/goto]
HTML replacement

Code: Select all

<a href="#{TEXT1}">{TEXT2}</a>
BBcode

Code: Select all

[anchor={TEXT1}]{TEXT2}[/anchor]
HTML Replacement

Code: Select all

<a id="{TEXT1}">{TEXT2}</a>

Then use by creating a link for example

Code: Select all

[goto=1]Go to point in post[/goto]
and the point to go to

Code: Select all

[anchor=1][/anchor]
Image
KRB99
Registered User
Posts: 392
Joined: Sun Jan 20, 2008 1:24 am
Location: Canada
Name: Kyle

Re: Does anyone know how?

Post by KRB99 »

Thanks Karl

thought it was a bbcode just wasnt sure
User avatar
Canis-Lupus
Registered User
Posts: 91
Joined: Wed May 21, 2008 4:49 pm

Re: Does anyone know how?

Post by Canis-Lupus »

Sorry I don't understand how that should look when it is finished. Can you give an example? Is that one above I should look at?
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Does anyone know how?

Post by karlsemple »

Canis-Lupus wrote:Sorry I don't understand how that should look when it is finished. Can you give an example? Is that one above I should look at?

Have you added the bbocdes as explained above?
Image
User avatar
Canis-Lupus
Registered User
Posts: 91
Joined: Wed May 21, 2008 4:49 pm

Re: Does anyone know how?

Post by Canis-Lupus »

Yes, they are installed.
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Does anyone know how?

Post by karlsemple »

Then it would be something along these lines

Code: Select all

[goto=a]Click here to go to location[/goto]

Code: Select all

[anchor=a]This is the target location [/anchor]
Image
User avatar
Canis-Lupus
Registered User
Posts: 91
Joined: Wed May 21, 2008 4:49 pm

Re: Does anyone know how?

Post by Canis-Lupus »

Sorry to be thick and thanks for your efforts, but could you use those two codes for say the original post in this thread to show me how it would be done in the edit box ie.how the two of them combine to get the result?

So, if after you make your post, I can press the quote button here and see exactly who you formatted your post.
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Does anyone know how?

Post by karlsemple »

The first post of this topic is an example of it in action. The actual post looks like this
Image
artiprinted
Registered User
Posts: 52
Joined: Wed Aug 09, 2006 1:11 pm

Re: Does anyone know how?

Post by artiprinted »

Why do the anchor tags make the text look like a link when you put your mouse over it?
artiprinted
Registered User
Posts: 52
Joined: Wed Aug 09, 2006 1:11 pm

Re: Does anyone know how?

Post by artiprinted »

This is what the phpbb.com uses, i got this back in a PM.

Marshalrusty wrote:
artiprinted wrote:Thanks,

is [anchor] and [goto] standard bbcodes in phpbb3?

thanks,
matt
No, that's just something we have set up here for long stickies :)

Anchor
BBCode:

Code: Select all

[anchor]{IDENTIFIER}[/anchor]
HTML Replacement:

Code: Select all

<a id="{IDENTIFIER}"></a>
GOTO
BBCode:

Code: Select all

[goto={IDENTIFIER}]{TEXT}[/goto]
HTML Replacement:

Code: Select all

<a href="#{IDENTIFIER}">{TEXT}</a>
The use of {IDENTIFIER} means that some characters are not allowed within the anchor name. Only the following are allowed: "Characters from the latin alphabet (A-Z), numbers, hyphen and underscore". Using {TEXT} instead of {IDENTIFIER} opens up a vulnerability, so don't do it :)

Just limit yourself to the allowed characters in {IDENTIFIER}

Thanks,

- Yuriy
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: Does anyone know how?

Post by Phil »

artiprinted wrote:Why do the anchor tags make the text look like a link when you put your mouse over it?
They are links.
Moving on, with the wind. | My Corner of the Web
Locked

Return to “[3.0.x] Support Forum”