FR: Twitter-style time diff
-
Needed the ‘ago’ readouts to be exactly like Twitter’s—had to modify the plugin a bit. Hoping you will include something like this in next update.
Function:
function twitter_time_diff( $from, $to = '' ) { $diff = human_time_diff($from,$to); $replace = array( ' hour' => 'h', ' hours' => 'h', ' day' => 'd', ' days' => 'd', ' minute' => 'm', ' minutes' => 'm', ' second' => 's', ' seconds' => 's', ); return strtr($diff,$replace); }
Modified line:
<a href="https://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]"><?php echo short_time_diff($t['time'], current_time('timestamp')); ?></a>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘FR: Twitter-style time diff’ is closed to new replies.