I have a similar question. A site that I visit uses an old version of WWWThreads, and when you paste or type a link without using the URL tag, it will automatically convert the link, but it will show up as "The Link" instead of the entire URL. I'd like to do that with 6.5, but the solution is not obvious.
This is the section of code I'm looking at (from ubbt.inc.php):
// Convert www -> html<br /> $Body = " " . $Body;<br /> $Body = preg_replace("#([\n\r ])([a-z]+?)://([^, \n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $Body);<br /> $Body = preg_replace("#([\n\r ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $Body);<br /> $Body = preg_replace("#([\n\r ])([a-z0-9\-_.]+?)@([^, \n\r]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $Body);<br /> $Body = substr($Body, 1);
Is it as easy as changing the first two preg_replace's to the following?
$Body = preg_replace("#([\n\r ])([a-z]+?)://([^, \n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">The Link</a> ", $Body);<br /> $Body = preg_replace("#([\n\r ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">The Link</a> ", $Body);
Any help would be appreciated.