link target

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Helpit
Posts: 2
Joined: Sun Nov 18, 2012 12:06 am

link target

Post by Helpit »

Script URL: http://www.helpmecomputers.com.au/workshop.html
Version of script:
Hosting company: Digital Pacific
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: link, url, target, page, KB, article

Write your message below:

If a user searched KB and finds result then click result it opens in a new window can this be altered to open in the parent or self etc.?
I should add that the script is being run inside a frame on our site works well except for above issue, great product.
Helpit
Posts: 2
Joined: Sun Nov 18, 2012 12:06 am

Re: link target

Post by Helpit »

Disregard problem solved....
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: link target

Post by Klemen »

For those having the same question, try this:

1. backup existing files
2. open inc/common.inc.php in a text editor
3. find

Code: Select all

'<a href="' . $completeUrl . '">'
and modify it to

Code: Select all

'<a href="' . $completeUrl . '" target="_blank">'
4. save, upload and test

* Note * This will only effect new tickets and articles, not existing ones.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
IgorHS
Posts: 2
Joined: Mon Jul 07, 2014 5:16 am

Re: link target

Post by IgorHS »

This is does not work for Hesk 2.5.3, since inc/common.inc.php does not contain the $completeUrl variable.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: link target

Post by Klemen »

In 2.5.x find this code instead in inc/common.inc.php:

Code: Select all

"$whitespace<a href=\"$url\"$class>$text</a>$append";
Replace it with:

Code: Select all

"$whitespace<a target=\"_blank\" href=\"$url\"$class>$text</a>$append";
Also, for the short links function find

Code: Select all

"<a href=\"$1$2\">$2</a>"
and change it to

Code: Select all

"<a target=\"_blank\" href=\"$1$2\">$2</a>"
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
IgorHS
Posts: 2
Joined: Mon Jul 07, 2014 5:16 am

Re: link target

Post by IgorHS »

Thank you, it works. But you should escape the " symbol in the code.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: link target

Post by Klemen »

Yes, correct, fixed now.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply