WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Sociable] NoFollow (5 posts)

  1. videoazzurri
    Member
    Posted 5 years ago #

    I use Sociable 3.2.3 with WordPress 2.8.
    Is it possible to set the links of Sociable without rel="nofollow"?
    What to do?

    Thanks!

  2. tarrero
    Member
    Posted 5 years ago #

    it's possible and easy.
    But you have to add a few code (that will be overwritten when you update the plugin).

    There are (at least :) two ways:
    - hard coded (nofollow will be output, always)
    - prety cool upgrade (selectable option in the backend)

    [The Hard coded way]
    around line 588, you will find

    $link .= "<a rel=\"nofollow\"";

    replace it with:

    $link .= "<a";

    and you have it! maybe next time you'll try by yourself! :)

    [The pretty cool way]
    do the Hard Coded method, and continues:

    around line 592, after:

    if (get_option('sociable_usetargetblank')) {
    	$link .= " target=\"_blank\"";
    }

    write the following:

    if (get_option('sociable_usenofollow')) {
    	$link .= " rel=\"nofollow\"";
    }

    around line 782, after:

    } else {
    	update_option('sociable_usetargetblank',false);
    }

    add this:

    if (isset($_POST['usenofollow']) && $_POST['usenofollow']) {
    	update_option('sociable_usenofollow',true);
    } else {
    	update_option('sociable_usenofollow',false);
    }

    around line 834, after:
    $usetargetblank = get_option('sociable_usetargetblank');
    write:
    $usenofollow = get_option('sociable_usenofollow');

    and finally, around line 924, after:

    <input type="checkbox" name="usetargetblank" <?php echo (get_option('sociable_usetargetblank')) ? ' checked="checked"' : ''; ?> /> <?php _e("Use <code>target=_blank</code> on links? (Forces links to open a new window)", "sociable"); ?>
    		</td>
    	</tr>

    write:

    <tr>
    		<th scope="row" valign="top">
    			<?php _e("Use 'nofollo' rel tag:", "sociable"); ?>
    		</th>
    		<td>
    			<input type="checkbox" name="usenofollow" <?php echo (get_option('sociable_usenofollow')) ? ' checked="checked"' : ''; ?> /> <?php _e("Use <code>rel=nofollow</code> on links? (Forces search engines to 'not follow this link' because it's outside our site)", "sociable"); ?>
    		</td>
    	</tr>

    and you will have the 'followed' ;) option in your Backend.

    do backups, and let the force be with you :)
    t

  3. videoazzurri
    Member
    Posted 5 years ago #

    Dear tarrero, really thanks for your answer!
    Now I will try your code.

    Bye
    VideoAzzurri

  4. videoazzurri
    Member
    Posted 5 years ago #

    Really perfect!
    I used your code and now I have the nofollow option in my backend.
    All function perfectly!
    Only 2 little statements for the other users who will read your code:
    1) My numbers of code's lines are different (I use WordPress 2.8 and Sociable 3.3);
    2) In your last grey window I corrected "Use 'nofollo' rel tag;" with "Use 'nofollow' rel tag;".

    Thanks again!
    VideoAzzurri

  5. videoazzurri
    Member
    Posted 5 years ago #

    All OK in Sociable 3.3.1 also.
    This code works good!

    Bye
    http://www.videoazzurri.com/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags