type == 'photo') { return '...'; } if ($post->type == 'video') { return ''; } return ''; } // A post's type-specific body. function post_content($post) { switch ($post->type) { case 'photo': return not_blank($post->caption) ? '

' . $post->caption . '

' : ''; case 'text': $out = ''; if (not_blank($post->title)) { $out .= '
' . $post->title . '
'; } if (not_blank($post->body)) { $out .= '

' . $post->body . '

'; } return $out; case 'answer': return '

' . $post->asking_name . ': ' . $post->question . '


' . $post->answer; case 'quote': return '
' . $post->summary . '

' . $post->reblog->comment . '
'; case 'chat': $out = ''; for ($i = 0; $i < count($post->dialogue); $i++) { $out .= '
' . (not_blank($post->dialogue[$i]->name) ? ('' . $post->dialogue[$i]->name . ': ') : "") . $post->dialogue[$i]->phrase . '
'; } return $out; } return ''; } // The card's opening and header rows: the posting blog, where it was reblogged // from, and the root blog, with follow buttons for blogs not yet followed. function post_header($client, $post) { $out = '
'; $out .= '
'; $out .= '' . $post->blog_name . ''; if (not_blank($post->reblogged_from_name)) { $out .= '' . $post->reblogged_from_name . ''; if (!$post->reblogged_from_following) { $out .= 'Follow'; } } $out .= '
'; // Add 'follow user' button if not following blog if ($post->followed) { $out .= '
'; } else { $out .= '
'; } // Add root blog (original poster) $out .= '
'; $out .= ''; $out .= '' . $post->reblogged_root_name . '
'; if (!$post->reblogged_root_following && strpos($post->reblogged_root_name, 'deactivated') === false) { $out .= ''; } $out .= '
'; return $out; }