{LOCAL_URL} BBCode problem

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

{LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 7:23 am

I've installed phpBB v3.1.2 locally.

I've created a BBCode for relative path URLs like this:

Code: Select all

[localurl={LOCAL_URL}]{TEXT}[/localurl]
And the HTML replacement:

Code: Select all

<a href="{LOCAL_URL}">{TEXT}</a>
According to the {LOCAL_URL} token description:
A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “http://10.200.200.6/phpbb/
The website root is indeed at http://10.200.200.6/phpbb/. However, my links are not prefixed with http://10.200.200.6/phpbb/ but with http://10.200.200.6/ instead.

Any thoughts?

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 3:09 pm

try adding the directory name to the html replacement
like this:
<a href="phpbb/{LOCAL_URL}">{TEXT}</a>

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 3:45 pm

That would work, but I don't want to hardcode any path.

In ACP -> Forums -> Edit forum -> Forum link (the forum is a link type) I can type a relative path ./path and the prefix is applied correctly:

http://10.200.200.6/phpbb/path

I'd like to figure out why it is not applied when using {LOCAL_URL}. Could it be a phpBB bug?

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 3:55 pm

ok, I was not even thinking about it properly. it simply will not do what you are wanting the way you are using the bbcode.

exactly what are you wanting to do with this bbcode?

give examples please.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 4:05 pm

Lumpy Burgertushie wrote: exactly what are you wanting to do with this bbcode?

give examples please.
Alright, let's say the root is at http://10.200.200.6/phpbb/.

I have a "books" folder: http://10.200.200.6/phpbb/books

I want to be able to type [localurl=books/bookname.pdf]Book[/localurl] which will be converted to this link: http://10.200.200.6/phpbb/books/bookname.pdf (it will display "Book" of course).

Currently it doesn't. It is replaced with http://10.200.200.6/books/bookname.pdf. The "phpbb" part is missing.

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 4:51 pm

try this:
bbcode:

Code: Select all

[localurl={LOCAL_URL}{SIMPLETEXT}]{SIMPLETEXT2}[/localurl]
html:

Code: Select all

<a href="{LOCAL_URL}{SIMPLETEXT}">{SIMPLETEXT2}</a>
use:

Code: Select all

[localurl=books/book.pdf]book[/localurl]
that will allow you to put whatever the directory/filename path is and also the anchor text.


robert

EDIT: make a mistake above and corrected it.
Last edited by Lumpy Burgertushie on Sat Jan 10, 2015 6:16 pm, edited 1 time in total.
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 5:03 pm

It will not work because {LOCAL_URL} is replaced by http://10.200.200.6/ and not by http://10.200.200.6/phpbb/ as advertised.

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 5:26 pm

are you doing some type of redirect to get to the directory named phpbb?

when I just tested this on my server using the bbcode I posted above, it works perfectly.

did you test it? it is not the same as what you showed in your post above.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 6:02 pm

Lumpy Burgertushie wrote:are you doing some type of redirect to get to the directory named phpbb?

when I just tested this on my server using the bbcode I posted above, it works perfectly.

did you test it? it is not the same as what you showed in your post above.


robert
No redirects.

I tried it but it didn't work for me. It was expected as {LOCAL_URL} is not replaced by http://10.200.200.6/phpbb/.

Like I said before, the forum path settings for a Link Forum type get the prefix right. Which is weird. I can give ./books as the forum's url and it will correctly point to http://10.200.200.6/phpbb/books.

Why would the prefix be correct there and not correct for {LOCAL_URL}?

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 6:15 pm

I made a mistake in my post above. the bbcode should be:

Code: Select all

[localurl={LOCAL_URL}{SIMPLETEXT}]{SIMPLETEXT2}[/localurl]
I thought maybe it was because you are doing it on localhost so I tested it on my localhost and it works just fine for me.

what do you have for cookie settings?


make sure your server settings are correct for domain name and path.
if you have force server set to yes, set it to no.
if you have it set to no change it to yes.

purge cache and test.


roberrt
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 6:36 pm

Lumpy Burgertushie wrote: what do you have for cookie settings?


make sure your server settings are correct for domain name and path.
if you have force server set to yes, set it to no.
if you have it set to no change it to yes.

purge cache and test.
I have localhost for cookie domain and / for cookie path and my server settings are fine. I also tried what you suggested and switched to yes and back to no. No luck.

Thing is, that all that should not matter because according to the {LOCAL_URL} token description:
A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “http://10.200.200.6/phpbb/
It gets the prefix right. It knows the replacement for {LOCAL_URL} but it doesn't apply it.

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 6:58 pm

just trying to help you figure it out. it works on a standard board , it works on local and a remote server.

the problem is trying to figure out why it doesn't work on your setup. what style are you using?

at this point, I really don't know why it doesn't work for you.

sorry,
robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: {LOCAL_URL} BBCode problem

Post by Louis7777 » Sat Jan 10, 2015 9:33 pm

Lumpy Burgertushie wrote:just trying to help you figure it out. it works on a standard board , it works on local and a remote server.

the problem is trying to figure out why it doesn't work on your setup. what style are you using?

at this point, I really don't know why it doesn't work for you.

sorry,
robert
I know man, and I really appreciate it.

I don't really want to fix it for myself though. After all it's only a site for the LAN and I can hardcode the URL.

What I want is to determine whether it is a bug and then report it.

(I'm using the default style)

User avatar
Lumpy Burgertushie
Registered User
Posts: 64658
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: {LOCAL_URL} BBCode problem

Post by Lumpy Burgertushie » Sat Jan 10, 2015 9:47 pm

it apparently is not a bug or it would not work for me. so it must be something about your particular setup that is causing it. without access to your board it would be very difficult to troubleshoot it.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: {LOCAL_URL} BBCode problem

Post by Oyabun1 » Sat Jan 10, 2015 10:04 pm

Robert's BBCode here works for me as well.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Locked

Return to “[3.1.x] Support Forum”

Who is online

Users browsing this forum: No registered users and 14 guests