';
echo '';
if ($pretty_url) {
echo '';
}
else {
}
// TODO: Verify if Tumblr adds this timezone back into the API else will need to be a new setting
$timezone = isset($tumblrJson['blog']['timezone']) ? $tumblrJson['blog']['timezone'] : 'America/New_York';
date_default_timezone_set($timezone);
if(is_array($tumblrJson['posts'])) {
foreach($tumblrJson['posts'] as $post) {
if(!array_key_exists('id',$post)) {
// Strip the ID from the URL
preg_match(':\S+/post/(\d+)(/\S)*:', $post['post_url'], $post_id_matches);
$post['id'] = $post_id_matches[1];
}
$post['local-page-url'] = $url_string['post_url'] . $post['id'];
$post['external-page-url'] = $url_string['ext_post_url'] . $post['id'];
$post['tag-url'] = $url_string['tag_url'];
$post['comment-username'] = $comment_username;
$post['comment-type'] = $comment_type;
$post['social-buttons'] = $social_buttons;
$post['text-comment'] = $text_comment;
$post['blog-title'] = $tumblrJson['blog']['title'];
$post['text-posted'] = $text_posted;
$post['lang'] = substr($local_lang, 0, 2);
// Set the global variable to Post Title. Since this is only used when one post is defined, we can do it here.
$post_title = get_title($post);
$post_url = $post['external-page-url'];
echo '
';
echo get_post_date($post,$date_position);
switch ($post['type']) {
case 'text':
echo get_text_post($post);
break;
case 'photo':
if (count($post['photos']) > 1) {
if (false === true) {
echo get_photoset_gallery_post($post);
}
else {
echo get_photoset_show_post($post);
}
}
else {
echo get_single_photo_post($post);
}
break;
case 'link':
echo get_link_post($post);
break;
case 'video':
echo get_video_post($post);
break;
case 'quote':
echo get_quote_post($post);
break;
case 'audio':
$post['plays-text'] = $text_plays;
$post['assetpath'] = $assetpath.'/tumblr-images';
echo get_audio_post($post);
break;
case 'chat':
echo get_chat_post($post);
break;
case 'answer':
$post['asking-from'] = $text_from;
echo get_answer_post($post);
break;
default:
echo get_text_post($post);
break;
}
echo get_reblog_info($post, $text_reblog);
echo get_post_footer($post);
echo '
';
}
if ($post_id) {
// Would prefer to do this with PHP, if I can find a way. This will have to do for now.
echo '';
}
echo '
';
if (isset($url_string['old_post_url'])) { echo '