Hallo.
Habe den "Link Tracker" eingebaut, d.h. jede Seite die "nach draußen führt" also verwendete URLs in Beiträgen kriegen ein http://www.was-ich.will.de/? vorgehängt. Das Problem ist, wenn ich den "weiterlesen..." Tag verwende, wird ebenfalls hierführ die "Weiterleit" Seite gezeigt.. versteht ihr?
Also obwohl ich nur den Weiterleiten link klicke, denkt LinKTracker das die Seite außerhalb der Seite führt und setzt den link davor.. wie kann ich nun einstellen dass er dies bei links von "http://meine.domain.de/ nicht macht?
Das Plugin:
PHP
<?php
/*
Plugin Name: Link Tracker
Plugin URI: http://www.andrewferguson.net/wordpress-plugins/
Plugin Description: Allows you to prepend outside links on-the-fly
Version: 0.3
Author: Andrew Ferguson
Author URI: http://www.andrewferguson.net
*/
/*
Link Tracker allows you to prepend links not contained within your domain.
This allows you to use features such as AWStats tracker to find out what outside
links users are clicking on.
/*
Link Tracker - Allows you to prepend outside links on-the-fly
This code is licensed under the MIT License.
http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2005 Andrew Ferguson
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function afdn_linkTracker_my_options_subpanel(){
if (isset($_POST['info_update']) && (!empty($_POST['prepend'])))
{
update_option("afdn_linkTracker", $_POST['prepend']);//Update Data
}
$prependURL = get_option("afdn_linkTracker"); //Get Data
?>
<div class=wrap>
<form method="post">
<h2>Link Tracker</h2>
<p>URL you would like to prepend to outside links. For AWStats, it's usually something like <code>http://www.yourdomain.com/cgi-bin/awredir.pl?url=</code></p>
<fieldset name="set1">
<legend><?php _e('URL to Prepend', 'Localization name') ?></legend>
<input name="prepend" value="<?php echo $prependURL; ?>" size="80" />
</fieldset>
<div class="submit"><input type="submit" name="info_update" value="<?php
_e('Update', 'Localization name')
?>»" /></div>
</form>
</div> <?
}
function afdn_linkTracker_optionsPage(){
if(function_exists('add_options_page')){
add_options_page('Link Tracker', 'Link Tracker', 10, basename(__FILE__), 'afdn_linkTracker_my_options_subpanel');
}
}
function afdn_linkTracker($content = ''){
$prependURL = get_option("afdn_linkTracker");
$content = preg_replace("#<a href.?=.?(\"|')http://(.+?)(\"|')#is", "<a href = \"".$prependURL."http://$2\" title = \"Opens http://$2 in a new window\" target = \"_blank\"", $content);
return $content;
}
add_action('admin_menu', 'afdn_linkTracker_optionsPage');
add_filter('the_content', 'afdn_linkTracker', 1, 1);
?>
Alles anzeigen