external_blank seams to be temperamental

12 views
Skip to first unread message

Kye Etherton

unread,
May 2, 2012, 6:09:25 AM5/2/12
to diem-users
Hi all. I have half a dozen websites with Diem so far. And for some
reason half of them are having an issue with the external_blank
setting.

I've checked the scripts and they are both on the same version of
Diem. Both of them have the setting turned on. And yet
http://www.thecoachandhorses.com/ does NOT seam to allow it to to work
for some reason.

It seams to be failing the test dmFrontLinkTagUri - line 31:
0 !== strncmp($this->uri, $this->requestContext['prefix'],
strlen($this->requestContext['prefix']))

On tests $this->uri and $this->requestContext['prefix'] are both
empty.

Anyone have any ideas why this is? $this->uri being empty seams like a
huge problem. But it still makes the link.

Kye Etherton

unread,
May 7, 2012, 10:07:02 AM5/7/12
to diem-users
No one else having an issue with this?

Jörg Wegner

unread,
May 8, 2012, 3:51:12 AM5/8/12
to diem-...@googlegroups.com
Hi Kye,

I took a quick look at this.

In my Diem 5.1.3 installation external links aren't detected correctly,
too. I had to change the IF condition to get it work:

if($this->options['external_blank'] || 0 !== strncmp($this->uri,
$this->requestContext['absolute_url_root'],
strlen($this->requestContext['absolute_url_root'])))


I think the condition (line 31) for Diem Dev needs to be changed to:

if($this->options['external_blank'] || 0 !== strncmp($this->uri,
$this->requestContext['absolute_url_root'],
strlen($this->requestContext['absolute_url_root'])) || 0 !==
strncmp($this->uri, $this->requestContext['prefix'],
strlen($this->requestContext['prefix'])) )

I did not test it yet.


hth

Kye Etherton

unread,
May 8, 2012, 3:59:32 AM5/8/12
to diem-...@googlegroups.com
Hi Jorg,

Thank you, it works

Any idea why the code before doesn't though? I can't see whats changed
that might have caused a problem.

Yours Sincerely

Kye Etherton
Managing Director

Sugar Cube Productions Ltd

Company Registered in England and Wales, registration number: 07856043

Jörg Wegner

unread,
May 8, 2012, 4:56:12 AM5/8/12
to diem-...@googlegroups.com
Hi Kye,

I really don't know yet. To provide a solution was the first thing on my
mind ;)
--
J�rg Wegner

Freiherr-vom-Stein Stra�e 39
D-57627 Hachenburg

Fon: +49 (0) 2662 / 9 46 86 32

E-Mail: wegner...@gmx.de



Kye Etherton

unread,
Jun 13, 2012, 3:21:21 AM6/13/12
to diem-users
Pagers are providing links with _blank on them.

This could be an issue...

Kye Etherton

unread,
Jun 13, 2012, 3:32:22 AM6/13/12
to diem-users
if($this->options['external_blank'] && (0 !== strncmp($this->uri,
$this->requestContext['absolute_url_root'], strlen($this-
>requestContext['absolute_url_root'])) || 0 !== strncmp($this->uri,
$this->requestContext['prefix'], strlen($this-
>requestContext['prefix'])) ))

Jörg Wegner

unread,
Jun 14, 2012, 7:31:02 AM6/14/12
to diem-...@googlegroups.com
Hi,

This does not work for me. Target is set to _blank even for internal links.

This one works for me in Diem master:

if($this->options['external_blank']  ||
            0 !== strncmp($this->uri, $this->requestContext['absolute_url_root'], strlen($this->requestContext['absolute_url_root']))
)


The 'prefix' condition seems to fail in all cases because $this->uri always starts with 'http://....' whereas
requestContext['prefix'] contains sth. like '/<rel_path_to_diem_web_dir>'. It could be omitted or am i wrong?
Reply all
Reply to author
Forward
0 new messages