I haven't seen this MOD posted, but I thought it could be valuable. As users often post links to their own websites, this prevents your forum from sharing your page rank with moochers.
In the file inc_func_common.asp, there is a JavaScript function at the very end of the file (this is the last 27 or so lines).
Replace the exisiting code with the following:
<script language="javascript1.2" runat="server">
function edit_hrefs(sURL, iType) {
sOutput = new String(sURL);
if (iType == 1) {
sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1<\/a>");
} else if (iType == 2) {
sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1<\/a>");
} else if (iType == 3) {
sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"http://$1\" rel=\"nofollow\" target=\"_blank\">$1<\/a>");
} else if (iType == 4) {
sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
"<a href=\"mailto\:$1\">$1<\/a>");
} else if (iType == 5) {
sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1<\/a>");
} else if (iType == 6) {
sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1<\/a>");
}
return sOutput;
}
</script>
If you look carefully, the only thing I have added is rel=\"nofollow\" to several of the links.
As far as I can tell, this only works for links posted in the message area and footer - if you allow users to post a Homepage in their profile, the homepage icon (displayed in their post) will not have this rel="nofollow" attribute.
I'd love some feedback on this MOD - let me know if there are more suggestions. My site's forum (http://www.whyilovechicago.com/forum) implements this MOD, so you can see it in action (although, since it's new, I don't think any users have posted links yet). I have also used this MOD on my former company's forum (http://www.fathomseo.com/forum).
Thanks!<