MrRundog
03-28-2005, 08:40 AM
Hi, This is a small mod that will give visitors the option to stay connected to your site when using the links pages - You will need a small gif image of new window icon - saved into the linksDirectory/images folder - Call the image "window" This is how it goes -
Find in lib\smarty\plugins\modifier.linkalize
Find line-
function smarty_modifier_linkalize($url, $text, $target = '_top')
Replace with
function smarty_modifier_linkalize($url, $text,$target = '_top', $targetnew = '_new', $title = 'Opens in a new window' )
Find line-
return linkalize($url, $text, $target);
Replace with
return linkalize($url, $text, $target,$targetnew, $title);
Find line-
function linkalize($url, $text, $target) {
Replace with
function linkalize($url, $text, $target,$targetnew, $title) {
Find line-
$url = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"$target\" href=\"$1\" class=link>" . (is_null($text) ? '$1' : $text) . "</a>$url);
Replace with
$url = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"$target\" href=\"$1\" class=link>" . (is_null($text) ? '$1' : $text) . "</a> <a target=\"$targetnew\" href=\"$1\" class=link title=\"$title\"><img src=\"images/window.gif\" border=0></a>", $url);
Save & Upload.
Go to mysite [COLOR=darkred]to see what I mean & (grab the window icon)
Sometime in the future...HTML 4.0 Strict and XHTML 1.0 Strict recommendations of the W3C no longer include the target attribute of the <a> tag - To find out more go here... http://www.sitepoint.com/article/standards-compliant-world
I will rewrite all the above mod (for compliency) when i get a chance, but for now it's fine.
Find in lib\smarty\plugins\modifier.linkalize
Find line-
function smarty_modifier_linkalize($url, $text, $target = '_top')
Replace with
function smarty_modifier_linkalize($url, $text,$target = '_top', $targetnew = '_new', $title = 'Opens in a new window' )
Find line-
return linkalize($url, $text, $target);
Replace with
return linkalize($url, $text, $target,$targetnew, $title);
Find line-
function linkalize($url, $text, $target) {
Replace with
function linkalize($url, $text, $target,$targetnew, $title) {
Find line-
$url = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"$target\" href=\"$1\" class=link>" . (is_null($text) ? '$1' : $text) . "</a>$url);
Replace with
$url = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"$target\" href=\"$1\" class=link>" . (is_null($text) ? '$1' : $text) . "</a> <a target=\"$targetnew\" href=\"$1\" class=link title=\"$title\"><img src=\"images/window.gif\" border=0></a>", $url);
Save & Upload.
Go to mysite [COLOR=darkred]to see what I mean & (grab the window icon)
Sometime in the future...HTML 4.0 Strict and XHTML 1.0 Strict recommendations of the W3C no longer include the target attribute of the <a> tag - To find out more go here... http://www.sitepoint.com/article/standards-compliant-world
I will rewrite all the above mod (for compliency) when i get a chance, but for now it's fine.