1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
|
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($this->stripSlashes($title))."</a>";
}
else {
if (!preg_match("/[a-z]:\/\//si", $url)) $url = "http://$url";
return "<a href=\"$url\" target=\"_blank\">".$title."</a>";
}
} |