1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00
2006-12-17 17:26:44 +00:00

27 lines
952 B
BlitzBasic

global $pref;
$parm = trim($parm);
$external = (($pref['links_new_window'] || strpos($parm, 'external') === 0) && substr($parm,0,1) != "#") ? " rel='external'" : "";
if(strpos($parm,"{e_")!==FALSE){
$external = "";
}
if(substr($parm,0,6) == "mailto")
{
list($pre,$email) = explode(":",$parm);
list($p1,$p2) = explode("@",$email);
return "<a class='bbcode' rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\";self.close();' onmouseover='window.status=\"mai\"+\"lto:\"+\"$p1\"+\"@\"+\"$p2\"; return true;' onmouseout='window.status=\"\";return true;'>".$code_text."</a>";
}
if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
{
$parm = preg_replace('#^external.#is', '', $parm);
return "<a class='bbcode' href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
}
else
{
return "<a class='bbcode' href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
}