future home of plugins

priss themes for wordpress

Okay, here's the deal. The original blank target comments plugin isn't here BUT, listed below is a puported fix of it.

~~~~~~~~~~~~~~~~installation instruction:

Plugin Name: Comment Link Target Blanker (CLTB)
Plugin URI: http://wp-plugins.net/plugin/comment-target-blank/
Description: This plugin will add target="_blank" to URLs in comments so they open in new windows. It is simply a bug-fixed clone of the most important feature of the Blank Target Comments plugin so that it can be installed and run with the otherwise mutually incompatible Link Truncator, and generates valid markup under WP2. Intended especially to be run in conjunction with the AutoLink in Posts & Excerpts plugin. Unlike BTC, it does not mess with comment author URL targets/nofollows (features of BTC that I don't find useful). Only tested on WP 2.0.
Version: 1.0b
Author: Stanton McCandlish
Author URI: http://www.McCandlishConsulting.com/INSTALLATION:
Just drop zzz-comment-target-blank.php (or its whole zzz-comment-target folder) into your plugins directory, make SURE that the Blank Target Comments plugin (wp-blank-target.php) is disabled or deleted, and enable Comment Link Target Blanker on your Plugins admin page. I recommend also installing Link Truncator and AutoLink in Posts & Excerpts. The former will do some additional smart and useful link-related stuff, and the latter will apply ALL of this great link handling to links in posts as well as comments (and even in excerpts of both posts and comments).
NOTE: This Comment Link Target Blanker plugin MUST load AFTER Link Truncator and BEFORE Autolink in Posts & Excerpts. This is why the .php file has the "zzz-..." name that it does, so that it is loaded later than the one and before the other, due to the alphabetical order. You can rename it, as long as the load order of this plugin in relation to those other two is not affected.
NOTE: CLTB is *not* compatible with the Blank Target Comments plugin, but is a replacement for it (thought not all of its functionality, some of which I found to be a little pointless in my view, nor all of it problems - I fixed a bug in it). In particular: A) It does not turn off rel="nofollow" on author links - why would you want Google indexing useless trivia about your users? B) It does not turn on target="_blank" for author links - why would you want to open links on the same site in a new window? C) it fixes a WP2.x-only bug in the original BTC code, which caused links in comments to get two rel="nofollow" attributes/values (one inserted by BTC, one by WP itself; apparently WP didn't do this in ver. 1.x, and BTC has not been updated since the release of WP2.)
IF USING WP 1.x: You will need to uncomment the line just mentioned in "C)", above.
NOTE: This has NOT been tested with Auto-hyperlink URLs
<http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/>,
Shrinky Link <http://nymb.us/?p=54>, AutoHyperlink <http://journalphoenix.com/40/autohyperlink>, or MightyLinker <http://mightyhitter.com/main-page/plugins/mightylinker/>. Compatibilitity is somewhat questionable. Looking into it for version 1.1. PLEASE REPORT ANY COMPATIBILITY PROBLEMS you encounter, with any version of WP from 2.0.1 onward, and with any plugin.[eof]

 

 

 

 

<?php
/*
Plugin Name: Comment Link Target Blanker (CLTB)
Plugin URI: http://wp-plugins.net/plugin/comment-target-blank/
Description: This plugin will add <code>target="_blank"</code> to URLs in comments so they open in new windows. It is simply a bug-fixed clone of the most important feature of the <a href="http://www.techwench.com/05-2005/plugin-blank-target-comments/" target="_blank">Blank Target Comments plugin</a> but which, unlike BTC, is compatible with (and detects) the <a href="http://minglewithingle.com/index.php?s=link+truncator" target="_blank">Link Truncator plugin</a>, and generates valid markup under WP2. Intended especially to be run in conjunction with the <a href="http://wp-plugins.net/plugin/posts-autolink/">AutoLink &amp; More in Posts &amp; Excerpts plugin</a>. Unlike BTC, it does not mess with comment author URL targets/nofollows (features of BTC that I don't find useful). Only tested on WP 2.0.
Version: 1.0b
Author: Stanton McCandlish (nominally)
Author URI: http://www.McCandlishConsulting.com/
*/

/* Installation: Read the readme file! */

/* ** THIS FILE *MUST* LOAD *AFTER* LT, if LT is installed! Thus the filename
of this script, which pushes it down toward bottom of the plugin list. */

/* Creative Commons Section

Copyright 2006 Stanton McCandlish; some rights reserved.

This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. */


if (function_exists('wp_rel_nofollow_blanktarget')) {
remove_filter('comment_text', 'wp_rel_nofollow_blanktarget');
add_filter ('comment_text', 'wp_rel_nofollow');
}
if (function_exists('get_comment_author_link_blanktarget')) {
remove_filter ('get_comment_author_link', 'get_comment_author_link_blanktarget');
add_filter ('get_comment_author','get_comment_author_link');
}
if (function_exists('make_clickable_blanktarget')) {
remove_filter ('comment_text', 'make_clickable_blanktarget');
add_filter ('comment_text', 'make_clickable');

}
/* The point of that is to detect if BTC is also accidentally installed too,
and undo what it does back to a clean slate. */

/* Now reroute LT's behavior through a new function that integrates it
with the code we've ripped from BTC; if LT not installed we still want
the BTC-type behavior to get processed by our new function anyway. */
if (function_exists('make_more_clickable')) {
remove_filter ('comment_text', 'make_more_clickable');
add_filter ('comment_text','make_more_clickable2');
} elseif (function_exists('make_clickable')) {
remove_filter ('comment_text', 'make_clickable');
add_filter ('comment_text','make_more_clickable2');
}

function make_more_clickable2($ret)
{
if (function_exists('make_more_clickable')) {
$ret = make_more_clickable($ret); # If LT is installed, use it...
} elseif (function_exists('make_clickable')) {
$ret = make_clickable($ret); # else use the default; either way...
}
$ret = wp_rel_nofollow_blanktarget2($ret); # use the func. below on it.
return $ret;
}

/* [end Creative Commons Section] */


/*
I would have just combined the compatible features of both BTC and LT plugins, but their licenses are also mutually incompatible, so I've chosen to just strip BTC down to what it needs. Every line of actual code below this point was written by "Tech Wench", author of BTC. If the authors of BTC and LT want to work out compatibility between ALL of their features, I'll happily remove this kluge from distribution.

/* GPL Section */

/* License Information:
==============================================================

Copyright (C) 2005 - Priss's House of Crap - www.prissed.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Full text found here: http://www.gnu.org/licenses/gpl.html
*/

remove_filter ('comment_text', 'wp_rel_nofollow');
#add_filter ('comment_text', 'wp_rel_nofollow_blanktarget2');

function wp_rel_nofollow_blanktarget2( $text ) {
$text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text);
return $text;
}

/* [end GPL Section] */

/* Note: I removed the rel="nofollow" from the above function; WP2 already
handles this automatically. It was causing invalid duplicate attributes
& values in WP2.0. If you use WP1.x, you can uncomment the add_filter
line above. And I renamed wp_rel_nofollow_blanktarget to
wp_rel_nofollow_blanktarget2 just in case someone daft tries to run
this plugin and BTC at the same time! - S.McC. */


?>