Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: Changing .com's into HREF's
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

guinsu
Starting Member

9 Posts

Posted - 21 March 2001 :  13:00:42  Show Profile
I've made a mod that will turn text ending in .com (such as snitz.com) into an href. As far as I can tell, this won't conflict with the changes the software currently makes to www's and http's. Here are the changes to make in inc_functions.asp:

In FormatStr, change the end of the function to:
fString = edit_hrefs(fString, 6)
FormatStr = replace_affiliate_urls(fString)

In edit_hrefs:

if (type == 6) {
var dot_com_match=/\b(http:\/\/)?(www\.)?([-\w\.]+\.com)\b/gi;
s_str = s_str.replace(dot_com_match,
function ($0,$1,$2,$3)
{
return check_domain($0,$1,$2,$3)
}
);
}//end if

And add this function in the Javascript section:

function check_domain(full,http,www,domain)
{
if(!http&&!www)
return "<a href=\"http://"+domain+"\" target=\"_blank\">"+domain+"</a>";
else return full;

}






Edited by - guinsu on 22 March 2001 13:56:59
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07