(2012-04-20, 04:32:51)mvlcek Wrote:Angryboy Wrote:But (for me at least) it makes all links open in a new window (not just the external ones) because if the field 'link' is empty, the field takes the value of the actual link of the page. So in theory the field is always filled; as my IF statement depends on 'link' being either empty or full, the statement serves no real purpose.
(2012-04-20, 14:15:35)andyash Wrote: [quote=mvlcek]global $SITEURL;
... echo substr($item->link,0,strlen($SITEURL)) == $SITEURL ? '_self' : '_blank'; ...mvlcek Wrote:<a href="<?php echo htmlspecialchars($item->link); ?>" target="_<?php if($item->link!=='') { echo 'blank'; } else {echo 'self'; } ?>">
How and where do I put these two to achieve my target?
I'm trying to get external links to open in a new window. Can anyone help with this method, where to use the global $SITEURL; bit?