User Tools

Site Tools


nonofollow

NP_NoNoFollow.php

In order to combat comment spam Nucleus 3.2 introduced support for the 'nofollow' standard. This standard was created by Google, Yahoo and MSN and makes sure that any link which has the rel attribute set to 'nofollow' is not counted when calculating Pagerank. As of version 3.2, Nucleus will set this attribute to 'nofollow' on every comment by default.

Unfortunately this behavoir can also do harm. The NoNoFollow website has detailed information. For this reason we now have the NoNoFollow plugin which will remove the 'nofollow' value from links inside comments.

Warning: If you do not have a proper anti-spam solution on your weblog you should not install this plugin.

General Plugin info
Current Version: 0.1
Download: NP_NoNoFollow.zip [1Kb]
Author: Rakaz

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Install the plugin…

How to use the plugin

There is nothing to configure, simply install the plugin and your done!

Bugs

1 : [By Winnie] For some reason, as of January 30th, 2006, this plugin doesn't work for at least my installations on any 3.22 version of Nucleus. Here's a work around, requiring you to edit your files manually. You don't need the nofollow plugin if you use this workaround. This bug was first discussed on the Nucleus forums.

You have to edit 3 files in your “NUCLEUS\LIBS” folder. These files are listed below, along with the lines that need editing and the lines after editing. Keep a backup of everything, or put a comment before each edited line that includes the original unedited line in case you wish to change it back for some reason.

Basically, you're finding any mention of rel=“nofollow” in one form or another, and removing it.

1 : Admin.php

Find $comment['body'] = eregi_replace("<a href=['\"]([^'\"]+)['\"]( rel=\"nofollow\")?>[^<]*</a>","\\1",$comment['body']);

Change it to $comment['body'] = eregi_replace("<a href=['\"]([^'\"]+)['\"]?>[^<]*</a>","\\1",$comment['body']);

2 : Comment.php

Find return $pre . '<a href="'.$linkedUrl.'" rel="nofollow">'.shorten($displayedUrl,30,'...').'</a>' . $post;

change it to

return $pre . '<a href="'.$linkedUrl.'">'.shorten($displayedUrl,30,'...').'</a>' . $post;

3 : Comments.php

Find echo '<a href="'.$this->currentComment['userlinkraw'].'" rel="nofollow">'.$this->currentComment['user'].'</a>';

change it to

echo '<a href="'.$this->currentComment['userlinkraw'].'" >'.$this->currentComment['user'].'</a>';

That should solve the issue for now. After the above editing, I don't see the nofollow attribute on any comment, which is what I wanted.

History

  • [Version 0.1]
    • Initial concept
nonofollow.txt · Last modified: 2006/07/05 13:03 (external edit)