<?
function onpost($content){
$content = preg_replace( "`(http)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?`i", "<a href=\"#\" onclick=\"window.open('http://\\0','','')\"  onmouseover=\"window.status='\\0';return true\" onmouseout=\"window.status='';return true\">\\0</a>", $content);
return $content;
} 
?> 
of als je van de simpelere versie houd:

function onpost($content){
$content = preg_replace( "`(http)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?`i", ""<a href=\"\\0" target=\"_blank\">\\0</a>", $content);
return $content;
} 

?>