Changing the beahviour of links in messages

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
[D]J
Registered User
Posts: 28
Joined: Sat Sep 20, 2003 3:28 pm

Changing the beahviour of links in messages

Post by [D]J »

Hi, I tried modifying by myself the file includes/bbcode.php to achieve this but with no success so I wonder if anyone can help me to do this little modify...

I need that a link like www.yourforumdomain.com/blah is opened in the SAME window and only links to other domains (like www.google.com) are opened in a new window. I tried doing something like this in function make_clickable() :

$checkdomain = strpos($ret, "www.mydomain.com")

and then, before converting the text to a link, an if to check if the text was there. But that doesn't seem to work... any help? Thank you!
[D]J
tsjakkaa
Registered User
Posts: 261
Joined: Sat Mar 27, 2004 1:25 pm
Location: belgium
Contact:

Post by tsjakkaa »

I'm not very familiar with bbcode, but I'll give it a try

you probably would add something to your bbcode.tpl so your url-template is split into the 2 different possibilities

so you'll end up with something like this in bbcode.tpl (second tag has no "target=_blank"-attribute)

Code: Select all

<!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->
<!-- BEGIN url-local --><a href="{URL}"  class="postlink">{DESCRIPTION}</a><!-- END url-local -->
but then you'll still have to change your bbcode.php. when $checkdomain == true , the [url]-tag needs to be changed in a [url-local]-tag
Locked

Return to “2.0.x Support Forum”