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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 I want to add “nofollow” to combat link spam.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

corinaw
Starting Member

USA
22 Posts

Posted - 03 February 2006 :  14:04:42  Show Profile
First of all, I want to say how VERY IMPRESSED I am with Snitz Forums. I got the whole thing up and running in just a few hours. Thanks to all involved in the coding. It’s very complete!


I am concerned with people dropping link spam in my forum. There is a risk being “banned” or de-indexed by the search engines if you have links to what is commonly referred to as a “bad-neighborhood”, or unethical, deceptive sites.

One way to combat this is to add the nofollow meta tag.

If this meta code is in the header: <meta name="robots" content="index,nofollow" />, the content of your forum will be indexed by the search engines, but the nofollow indicates that you cannot vouch for the integrity of any links posted on the page, so there will be no risk of being penalized.

So, I would like to add the nofollow meta ONLY to topics.asp as this is where any linkspam would be located. I see inc_header.asp and inc_header_short.asp has the meta info, but any change to it applies to every page.

Can anyone help me with some kind of if-then statement so I can add page specific meta?

Sorry for the longish post- But it really is a serious issue and I wanted to make sure I explained it thoroughly for any visitor that happen upon this post. It’s also a good idea to add noindex, nofollow to all the admin pages.

corinaw
Starting Member

USA
22 Posts

Posted - 06 February 2006 :  12:27:06  Show Profile
Shouldn't there be more than that? Sorry if I'm being dense but I'm really new to asp.

Thank you,
Corina
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 06 February 2006 :  17:57:25  Show Profile  Visit dayve's Homepage
First of all, only Google spiders recognize the nofollow atrribute. You should be able to add the following in inc_func_common.asp. Look for this:

	roTag = "<a href="""
	rc1Tag = """ target=""_blank"">"
	rc2Tag = "</a>"

Modify it to look like this:

	roTag = "<a href="""
	rc1Tag = """ target=""_blank"" rel=""nofollow"">"
	rc2Tag = "</a>"

I haven't test this yet but I will later. More info about the nofollow attribute can be found here:

http://googleblog.blogspot.com/2005/01/preventing-comment-spam.html


Edited by - dayve on 06 February 2006 18:02:56
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 07 February 2006 :  00:50:45  Show Profile  Visit dayve's Homepage
Okay... had to look at the file to remember. These are the changes you need to make in inc_func_common.asp:

<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\" target=\"_blank\" rel=\"nofollow\">$1<\/a>");
	} else if (iType == 2) {
		sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1<\/a>");
	} else if (iType == 3) {
		sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"http://$1\" target=\"_blank\" rel=\"nofollow\">$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\" target=\"_blank\">$1<\/a>");
	} else if (iType == 6) {
		sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
		  	"<a href=\"$1\" target=\"_blank\">$1<\/a>");
	}

	return sOutput;
}
</script>

Go to Top of Page

corinaw
Starting Member

USA
22 Posts

Posted - 07 February 2006 :  17:25:04  Show Profile
Thanks very much Dayve.
This is perfect and works like a charm!

I also added this code to the topic.asp page <meta name="robots" content="index,nofollow" > by adding this to default.asp right before the snitz copyright line. This adds nofollow to the topic.asp page meta, which all robots recognize. (or should anyway) You are right about googlebot only recognising nofollow in the href link.

If you see anything wrong with this please let me know-

Thanks again

if (Instr(Request.ServerVariables("Path_Info"), "topic.asp") > 0) then
Response.Write "<meta name=""robots"" content=""index,nofollow"">" & vbNewline
else
Response.Write "<meta name=""robots"" content=""index,follow"">" & vbNewline
end if


Go to Top of Page

corinaw
Starting Member

USA
22 Posts

Posted - 19 March 2006 :  01:52:06  Show Profile
Hi Snitz,
I just wanted to post an update to the link attribute called nofollow.

I was just on yahoo answers here:
http://answers.yahoo.com/question/index;_ylt=Ah35AtjHmM89Q50fUbbuPR3zy6IX?qid=1006031813180
and yahoo is using the link nofollow attribute too.
Go to Top of Page
  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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07