martes, 12 de enero de 2010

TwitterTools - open links in external window

Our site makes use of the Twitter Tools plugin, but with some minor tweaks

The only links that Twitter Tools displays with our set-up are the bit.ly links, the link to the specific tweet (e.g. "1 hr ago") and the "More Updates..." link. All of these links will open their target in the same window, but we wanted them to open an external window so the user remains on the site.

To do this, you need to locate the plugin's main coding. This is currently at:
wp-content/plugins/twitter-tools/twitter-tools.php

Now make the folllowing changes:

"More Updates Link": Change Line 812:

$output .= ' twitter_username).' '.__('More updates...', 'twitter-tools').''."\n";

To:

$output .= ' twitter_username).'" target="_blank '.__('More updates...', 'twitter-tools').''."\n";


"Time Display Link": Change Line 879:

$output .= ' '.aktt_status_url($aktt twitter_username, $tweet tw_id).'" class="aktt_tweet_time '.$time_display.'';

To:

$output .= ' '.aktt_status_url($aktt twitter_username, $tweet tw_id).'" class="aktt_tweet_time" target="_blank '.$time_display.'';


"Bit.ly links": Change Line: 881:

return $output;

To:

$output = str_replace('rel="nofollow ', 'target="_blank" rel="nofollow ', $output);
return $output;

1 comentario: