'140', 'follow_js' => '1') ); } } /* * @brief Removes the 140follow options from WP database */ function wp_140follow_uninstall() { // Delete 140follow options delete_option('dbfollow_options'); } /* * @brief Ads options page in the admin section */ function wp_140follow_admin_menu() { add_submenu_page('options-general.php', '140follow', '140follow', 8, '140follow', 'wp_140follow_options'); } /* * @brief Manages 140follow options */ function wp_140follow_options() { global $wpdb, $dbfollow_options; if (!empty($_POST['followsave'])) { check_admin_referer('140follow'); $dbfollow_options['follow_count'] = trim($_POST['followcount']); $dbfollow_options['follow_js'] = trim($_POST['followjs']); update_option('dbfollow_options', $dbfollow_options); echo '

' . __('Settings saved successfully.', '140follow') . '

' . "\n"; } $dbfollow_options = get_option('dbfollow_options'); ?>

140follow Settings

Character Count: How many characters to make the link DoFollow?
Use JavaScript: If you use the javascript character counter, you have to modify your theme a little bit ;)

Usage

JavaScript Enabled

  1. Go to your theme directory and open "comments.php"
  2. Find <form action="<?php echo get_option('siteurl');
  3. Add on the end of this line (before last ">"):
    • name="commentform"
  4. Find <p><textarea name="comment" id="comment"
  5. Add after this line the following code:
    • <p><script>displaylimit("document.commentform.comment",<?php $followopt = get_option('dbfollow_options'); echo $followopt['follow_count']; ?>)</script></p>

JavaScript Disabled

Donation

Does this plugin make you happy? Do you find it useful?
If you think this plugin helps you, please consider donating.
Thank you for your support!
140follow Plugin by NetReview.de
'."\n"; echo ''; echo "\n".''."\n"; } else { echo "\n".''."\n"; } } function wp_140follow_make_dofollow($ret) { global $wpdb, $comment; $dbfollow_options = get_option('dbfollow_options'); if (eregi('dontfollow', $ret)) { $ret = preg_replace("/\/dontfollow'/","' ", $ret); $ret = preg_replace("/\/dontfollow\"/","\" ",$ret); } else { $chars = strlen($comment->comment_content); if ($chars >= intval($dbfollow_options['follow_count'])) { $ret = preg_replace("/ rel='external nofollow'/"," rel='external'",$ret); $ret = preg_replace("/ rel=\"external nofollow\"/"," rel='external'",$ret); } } return $ret; } /**** HOOKS ****/ add_action('wp_head', 'wp_140follow_js'); add_filter('get_comment_author_link', 'wp_140follow_make_dofollow'); ?>