function formaturl($url, $title = '', $maxwidth = 60, $width1 = 40, $width2 = -15) { if (!wbb_trim($title)) { $title = rehtmlconverter($url); if (!preg_match("/[a-z]:\/\//si", $url)) $url = "http://$url"; if ($this->cuturls == 1 && wbb_strlen($title) > $maxwidth) $title = wbb_substr($title, 0, $width1)."...".wbb_substr($title, $width2); return "<a href=\"$url\" target=\"_blank\">".htmlconverter(str_replace("\\\"", "\"", $title))."</a>"; } else { if (!preg_match("/[a-z]:\/\//si", $url)) $url = "http://$url"; return "<a href=\"$url\" target=\"_blank\">".$title."</a>"; } } |