<?php
/*
Plugin Name: Dofollow Trackbacks
Plugin URI: http://www.turkhitbox.com/wordpress-seo/dofollow-trackbacks-plugin.html
Description: Dofollow Trackbacks plugin removes the rel="nofollow" attribute in Approved trackback links to share some link love!
Author: Turk Hit Box
Version: 1.0
Author URI: http://www.turkhitbox.com
*/

class trackback_dofollow
{
    function 
trackback_dofollow()
    {
    
remove_filter('pre_comment_content''wp_rel_nofollow'15);
    
add_filter('comment_text', array(&$this'nofollow_delete'), 16);
    
add_filter('get_comment_author_link', array(&$this'nofollow_delete'), 16);
    }

    function 
nofollow_delete($text)
    {
        global 
$comment;
        
apply_filters('get_comment_type'$comment->comment_type);
        
        if (
$comment->comment_approved == '1' && ( $comment->comment_type == 'pingback' || $comment->comment_type == 'trackback' ) )
        {
        
$text preg_replace("/(<a [^>]*( |\t|\n)rel=)('|\")(([^\3]*( [^ \3]*)*) )?nofollow/""$1$3$5"$text);
        
$text preg_replace("/(<a [^>]*)( |\t|\n)rel=(''|\"\")([^>]*>)/""$1$4"$text);
        return 
$text;
        }
        else
        {
        return 
$text;
        }
    }



$trackback_dofollow =& new trackback_dofollow();
?>