function externallink($match, $state, $pos)
{
$url = $match;
$title = null;
// add protocol on simple short URLs
if (substr($url, 0, 3) == 'ftp' && substr($url, 0, 6) != 'ftp://') {
$title = $url;
$url = 'ftp://' . $url;
}
if (substr($url, 0, 3) == 'www' && substr($url, 0, 7) != 'http://') {
$title = $url;
$url = 'http://' . $url;
}
$this->_addCall('externallink', array($url, $title), $pos);
return true;
}