Show date/time ago with latest network posts

Hi.

I am using this code below in a plugin, to show the recent posts on the network on my network in a shortcode. Ash from WPMU Dev actually created the code.

The code is already showing blog name and post title, but now i want to show a date from when the post is posted, or time since it was posted.

Is it possible to do out of the box?

Website: http://www.bloggerspoint.dk

Code:

<?php

class recentproshortcode {

var $build = 1;

var $db;

function __construct() {

global $wpdb;

$this->db =& $wpdb;

if($this->db->blogid == 1) {
// Only add the feed for the main site
add_action('init', array(&$this, 'initialise_recentproshortcode') );
}

add_shortcode( 'globalproposts', array( &$this, 'display_pro_posts_shortcode') );

}

function recentproshortcode() {
$this->__construct();
}

function initialise_recentproshortcode() {
// In case we need it in future :)
}

function display_pro_posts($pro_level, $tmp_number,$tmp_title_characters = 0,$tmp_content_characters = 0,
$tmp_title_content_divider = '<br />',$tmp_title_before,$tmp_title_after,$tmp_global_before,
$tmp_global_after,$tmp_before,$tmp_after,$tmp_title_link = 'no',$tmp_show_avatars = 'yes',
$tmp_avatar_size = 16, $posttype = 'post', $output = true) {

global $network_query, $network_post, $wpdb;

// https://premium.wpmudev.org/forums/topic/restricting-specific-page-templates-within-prosites#post-652329

$network_query = network_query_posts( array( 'post_type' => $posttype, 'posts_per_page' => $tmp_number ));

$html = '';

global $wpdb;
$blog_id = $wpdb->blogid;
$sql = "SELECT level FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'";
$level = $wpdb->get_var( $sql );
if( $pro_level == 'all' ){
$pro = $wpdb->get_results("SELECT * FROM {$wpdb->base_prefix}pro_sites");
}else{
$pro = $wpdb->get_results("SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE level = {$pro_level}");
}

$temp = array();
foreach( $pro as $p ){
array_push( $temp, $p->blog_ID );
}

// if ( $level == 2 ) {

$html .= $tmp_global_before;

while( network_have_posts() ) {

network_the_post();

if( ! in_array( $network_post->BLOG_ID, $temp ) ) continue;

switch_to_blog( $network_post->BLOG_ID );

//Get network blog post featured image
$n_post = network_get_post();
// }
$featured_image = get_the_post_thumbnail( $n_post->ID, 'misc-thumb-front' );
//Network blog name
$blogname = get_blog_option( $network_post->BLOG_ID, 'blogname' );

restore_current_blog();
$html .= $tmp_before;

$html .= $tmp_title_before . '<a href="' . network_get_permalink() . '"target="_blank" class="crop">';

$the_title = network_get_the_title();

$html .= '<div id="npost-meta"><div class="blog-name">' . $blogname . '</div> <hr> <div id="net-post-title">' . substr($the_title,0,$tmp_title_characters) . '</div></div>';

$tile_img = '';

if(!empty($featured_image)) {
$tile_img = $featured_image;

} else {
$options = get_option( 'bpb_settings' );
$tile_img = '<img src="' . plugins_url( '/images/wparm33w.png', dirname(__FILE__) ) . '" >';
$tile_img = '<img src="' . get_option( $bpb_placehold_it , plugins_url( '/images/wparm33w.png', dirname(__FILE__) ) ). '" >';
$tile_img = '<img src="' . $options['bpb_btn_6'] . '" >';
}

if ( $tmp_title_characters > 0 ) {
$html .= $tile_img;

$html .= $tmp_title_after;
}

$html .= $tmp_after;

}
$html .= $tmp_global_after;
// }

if($output) {
echo $html;
} else {
return $html;
}

}

function display_pro_posts_shortcode($atts, $content = null, $code = "") {

$defaults = array( 'number' => 50,
'title_characters' => 35,
'content_characters' => 50,
'title_content_divider' => '<br />',
'title_before' => '<div>',
'title_after' => '</div>',
'global_before' => '<ul>',
'global_after' => '</ul>',
'before' => '<li class="crop-square">',
'after' => '</a></li>',
'title_link' => 'yes',
'show_avatars' => 'no',
'show_images' => 'no',
'avatar_size' => 16,
'posttype' => 'post',
'pro_level' => 'all'
);

extract(shortcode_atts($defaults, $atts));

$html = '';

$html .= $this->display_pro_posts( $pro_level, $number, $title_characters, $content_characters, $title_content_divider, $title_before, $title_after, $global_before, $global_after, $before, $after, $title_link, $show_avatars, $avatar_size, $posttype, false);

return $html;

}

}

function display_pro_posts($pro_level, $tmp_number,$tmp_title_characters = 0,$tmp_content_characters = 0,$tmp_title_content_divider = '<br />',$tmp_title_before,$tmp_title_after,$tmp_global_before,$tmp_global_after,$tmp_before,$tmp_after,$tmp_title_link = 'no',$tmp_show_avatars = 'yes', $tmp_avatar_size = 16, $posttype = 'post', $output = true) {
global $recentproshortcode;

$recentproshortcode->display_pro_posts( $pro_level, $tmp_number, $tmp_title_characters, $tmp_content_characters, $tmp_title_content_divider, $tmp_title_before, $tmp_title_after, $tmp_global_before, $tmp_global_after, $tmp_before, $tmp_after, $tmp_title_link, $tmp_show_avatars, $tmp_avatar_size, $posttype, $output );
}

$recentproshortcode = new recentproshortcode();