hey all:
i am using the wordspew shoutbox plugin for wordpress (at http://bthaxor.com), and have it customised exactly the way i want it except for one little problem.
inbuilt is a function which converts text beginning with http, ftp, https etc. to links in the shoutbox. i have one problem: it does not convert links beginning with 'www.', where the user has forgotten to place a 'http://', because they are recognised as relative links.
here are the three lines of code that do the replacing in wordspew:
$theLink=__("link",wordspew); $theMail=__("email",wordspew);
$r->text = preg_replace("`(http|ftp)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?`i", "<a href=\"\\0\" title=\"\\0\"$target>» $theLink «</a>", $r->text);
$r->text = preg_replace("`([-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6})`i","<a href=\"mailto:\\1\" title=\"mailto:\\1\">» $theMail «</a>", $r->text);
i do not know php: can someone please incorportate 'www.' conversion as well?
thanks.