Links with target=_top? (General)

by Michael @, Wednesday, April 16, 2008, 11:39 (5853 days ago)

Dear friends, we are trying to establish a forum that runs within a Frame.
But we want all links in the entrys to open outside the frame (HTML code target="_top").
As I am a PHP newby I have no Idea what and where to modify that in the PHP-Code. I tried it in the entry.inc.php, but it didn't work well.
Anyone got an idea?
thanx
Michael

locked
5570 views

Links with target=_top?

by Michael @, Friday, April 18, 2008, 13:21 (5851 days ago) @ Michael

... well, while searching around, I had to learn that specialists see these target=_"blank" links as an annoyance. But I could not see why. For me it's an annoyance to go back all the time after following a link to somewhere ... But: Anyway.

Somone in a former thread traced a way to define links as opening in a blank:

Change the (X)HTML-variant from 'Strict'......to 'Transitional':

Change all scripts/templates to generate links of the form

a href="http://domain.tdl/foo.htm" target="_blank"

... can anyone explain in which files these changes should be done? I tried it with the functions.inc.php but it gave me lots of errors.

Thanx in advance, I don't want to annoy anyone, but me and my friends would love to have extra-opening windows ....

locked
5531 views
Avatar

Links with target=_top?

by Alfie ⌂, Vienna, Austria, Friday, April 18, 2008, 23:04 (5851 days ago) @ Michael

Somone...

Yes, me :cool:

... in a former thread traced a way to define links as opening in a blank...

Not in 'a blank' but in a new browser window ...

... can anyone explain in which files these changes should be done? I tried it with the functions.inc.php but it gave me lots of errors.

I don't want to do your homework, but you have to look for potential links not only in *.inc.php but also in *.tpl.inc

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

locked
5442 views

Links with target=_top?

by Michael @, Saturday, April 19, 2008, 09:21 (5850 days ago) @ Alfie

I don't want to do your homework, but you have to look for potential links not only in *.inc.php but also in *.tpl.inc


thanks a lot for the reply, and of course I don't want anyone to do my homework.
But I'm trying to learn from your experience.

OK, I'll try to do the changes in all *.tpl.inc

Adding target="_blank" to all a href that are supposed to open in a new window? Is that right?

thx
Michael

locked
5305 views
Avatar

Links with target=_top?

by Alfie ⌂, Vienna, Austria, Saturday, April 19, 2008, 11:28 (5850 days ago) @ Michael

Adding target="_blank" to all a href that are supposed to open in a new window? Is that right?

Yes, the link's target will open in a new browser window. The forum (part of a frameset in you case) will stay in the background.

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

locked
5361 views

Links with target=_top?

by Michael @, Monday, April 21, 2008, 19:59 (5848 days ago) @ Alfie

... now I managed to change some href: the hompage-link is opening in a new window, and a link to the mylittleforum homepage.
But what is most important: I did not find a way to add target="_blank" to links in the entries. That's what is most important. Can't anyone tell me where I can find that definition? I searched the entry.tpl.inc, but I didn't succeed.
I don't want anyone to do my homework. It's no homework anyway ...
But maybe someone can give ma a hint.
Thanx
Michael

locked
5352 views

Links with target=_top?

by Michael @, Tuesday, April 22, 2008, 09:28 (5847 days ago) @ Michael

For my (little) understanding I should add target_"blank" in functions.inc.php, somewhere here:

function make_link($string)
{
$string = ' ' . $string;
$string = preg_replace_callback("#(^|[n ])([w]+?://.*?[^ "nrt<]*)#is", "shorten_link", $string);
$string = preg_replace("#(^|[n ])((www|ftp).[w-]+.[w-.~]+(?:/[^ "tnr<]*)?)#is", "$1< a href="http://$2" target=_blank">$2</a>", $string);
#$string = preg_replace("#(^|[n ])([a-z0-9&-_.]+?)@([w-]+.([w-.]+.)*[w]+)#i", "1< a href="mailto:2@3" target=_blank">2@3</a>", $string);
$string = substr($string, 1);
return $string;
}

But that leads to no visible result. What am I doing wrong?

locked
5358 views

Links with target=_top?

by Steve K @, Woburn, MA, Thursday, June 05, 2008, 01:05 (5804 days ago) @ Michael
edited by Steve K, Thursday, June 05, 2008, 01:22

Michael: I've been "toying" with this same idea (popup pages) for a while, and bgy pure "luck" I finally got it working today in version 1.7.6

OF INTEREST: This will make a popup window open up ONLY if the link in the post are enclosed in the [link][/link] like via the blue underlined "link" button to the right. If the links are not enclosed the window will not popup. So you have the best of both worlds... I'm not smart. That too just happened...

Copy your original "functions.php" and/or rename it something like "functions-orig.php in case you need to revert back to it.

In your new copy of "functions.php", using Notepad, or something similar simply find this area and replace it with what is on the below PRINT SCRN picture.
[image]

It should look exactly like my PRINT SCRN & paste picture above:
You can also see it here:
http://69.89.31.243/~apprais7/window-blank.htm

Here is a text file you can copy to paste into your functions.php:
http://69.89.31.243/~apprais7/window-blank.txt

locked
5637 views

Links with target=_top?

by michael @, Thursday, June 05, 2008, 07:03 (5803 days ago) @ Steve K

Thanx a lot, Steve,
I'll try that. It looks fine!

locked
5014 views

Links with target=_top?

by Michael Geiger ⌂ @, Germany, Friday, June 06, 2008, 08:11 (5802 days ago) @ Steve K

Hi Steve,

unfortunately I can not open any of your links and also the photograph (screenshot) is not displayed on my computer. Either your IP address used for the picture / link has changed, or it is blocked here on my PC. Could you please send me the screenshot by email?

Thanks a lot!

Best regards,
Michael

locked
5075 views

Links/pics back RE: Links with target=_top?

by Steve K @, Woburn, MA, Friday, June 06, 2008, 14:00 (5802 days ago) @ Michael Geiger

Sorry: Link to my post above is working again. I changed servers yesterday and these were left off. I wish the "edit" functions were working for me on this message board. Here are the links again - just in case... Change in the "functions.php" file. Backup or rename your "functions.php" file first.

[image]

TO LOOK LIKE WHAT'S IN THIS:
http://appraisercom.com/window-blank.htm

Copy & paste from here:
http://appraisercom.com/window-blank.txt

locked
5340 views

RSS Feed of thread