'smashmag',
'width' => '400',
'post_limit' => '5',
'link_target' => '_blank',
'display_attachment' => 'true',
'app_id' => '1438026419800246',
'app_secret' => '78f65b8644632e0c2d98e053ed39668f'
), $atts);
extract($atts);
/* Decode - Encode of the URLs Facebook Graph */
$graphUser = "https://graph.facebook.com/$facebook_id/?fields=name,picture&access_token=$app_id|$app_secret";
$graphPosts = "https://graph.facebook.com/$facebook_id/posts/?access_token=$app_id|$app_secret&date_format=U&limit=$post_limit";
$graphUserFeedsData = getDataObject($graphUser);
$graphPostsFeedsData = getDataObject($graphPosts);
?>
data as $d):
?>
-
type;
if($d->type == "status"){
if(isset($d->story))
echo $d->story;
}else{
if(isset($d->message))
echo addLink($d->message);
}
?>
type != "status" || isset($d->picture)): ?>
picture . "' class='adv_status_attachment_image'/>";
?>
type == "link"): ?>
link) && isset($d->name)): ?>
name; ?>
caption)): ?>
caption; ?>
description)): ?>
description; ?>
Posted - created_time);?> ago
$1';
$string = preg_replace($pattern, $replacement, $string);
return $string;
}
function timeAgo($timestamp){
$time = time() - $timestamp;
if ($time < 60)
return ( $time > 1 ) ? $time . ' seconds' : 'a second';
elseif ($time < 3600) {
$tmp = floor($time / 60);
return ($tmp > 1) ? $tmp . ' minutes' : ' a minute';
}
elseif ($time < 86400) {
$tmp = floor($time / 3600);
return ($tmp > 1) ? $tmp . ' hours' : ' a hour';
}
elseif ($time < 2592000) {
$tmp = floor($time / 86400);
return ($tmp > 1) ? $tmp . ' days' : ' a day';
}
elseif ($time < 946080000) {
$tmp = floor($time / 2592000);
return ($tmp > 1) ? $tmp . ' months' : ' a month';
}
else {
$tmp = floor($time / 946080000);
return ($tmp > 1) ? $tmp . ' years' : ' a year';
}
}
/**
* Register style sheet.
*/
function register_advanced_facebook_wall_shortcode_styles() {
wp_register_style( 'advancedFacebookWallShortcode', plugins_url( 'style.css' , __FILE__ ) );
wp_enqueue_style( 'advancedFacebookWallShortcode' );
}