If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
getting links to open in new window  XML
Forum Index » Advanced Guestbook Forum
Author Message
CHwebby
Beginner

Joined: 12/04/2006 13:03:04
Messages: 15
Offline

I have my guestbook set up in frames. Clicking on the home icon within posts works and opens in a new window just fine. But where can I add code (maybe base target code) so when someone posts a link in their guestbook entry that that also will open in a new window. Right now it gets stuck in my frames.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

You'd have to edit the AGcode eregi_replace function in vars.class.php.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
CHwebby
Beginner

Joined: 12/04/2006 13:03:04
Messages: 15
Offline

thanx I'm a php n00b. I tried the below following to no avail. Am I missing something here?



function AGCode($string) {
$string=eregi_replace("\\[img\\](http://[^\\[]+)\\[/img\\]","<img src=\"\\1\" border=0>",$string);
$string=eregi_replace("\\[b\\]([^\\[]*)\\[/b\\]","<b>\\1</b>",$string);
$string=eregi_replace("\\[i\\]([^\\[]*)\\[/i\\]","<i>\\1</i>",$string);
$string=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$string);
$string=eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]","<a href=\"http://www.\\1\" target=\"new\">\\1</a>",$string);
$string=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"new\">\\1</a>",$string);
$string=eregi_replace("\\[url=http://([^\\[]+)\\]([^\\[]*)\\[/url\\]","<a href=\"http://\\1\" target=\"new\">\\2</a>",$string);
return $string;
}
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

target=\"_blank\"

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
CHwebby
Beginner

Joined: 12/04/2006 13:03:04
Messages: 15
Offline

thanx... target blank was what was originally there but it still didn't open up in a new window.

Hmmmmm weird
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum