What a brilliant idea! I’ve included it in the development version.
I’ve adjusted it a bit to add in other possible display variables:
case 'custom':
# This first option lets you use your own function to display tweets
if (function_exists('rotatingtweets_display_override')) {
$result .= rotatingtweets_display_override(
$args, $tweetuser, $main_text, $twitter_object, $twitterlocale, $targetvalue, $retweeter = array(), $show_media='', $nextprev='' );
break;
}
I’ve also changed the function name to be slightly more consistent with other RT functions.
The one thing that may be different vs. your version is how retweets are handled. To get an ‘old style’ retweet, you will need some code like:
if(isset($retweeter)):
$main_text = "RT @".$tweetuser['screen_name'] . " " . $main_text;
$tweetuser = $retweeter;
endif;
to convert back to that format of display.
Martin,
that’s kind of you. I’ll try the development version shortly.
thanks,
John
Martin,
Your new code eliminates the nextprev links, among other things. I think it should look something like this:
if (function_exists('rotatingtweets_display_override')) {
$retweeter = isset($retweeter)? $retweeter : array();
$show_media = isset($show_media)? $show_media : '';
$nextprev = isset($nextprev)? $nextprev : '';
$result .= rotatingtweets_display_override(
$args, $tweetuser, $main_text, $twitter_object, $twitterlocale, $targetvalue, $retweeter, $show_media, $nextprev );
Otherwise, it works fine.
Good stuff – although it shouldn’t have been resetting the values – just setting default argument values.
It should all be fine now – and I’ve also (in theory) added it as an option to the widget! (Does this work?)
Incidentally, the old-style retweet should probably be:
if(isset($retweeter)):
$main_text = "RT " . rotatingtweets_user_intent($tweetuser,$twitterlocale,'screen_name',$targetvalue) . " " . $main_text;
$tweetuser = $retweeter;
endif;