Exemplo n.º 1
0
 function ReturnOption($option, $sep)
 {
     switch ($option) {
         case 'A':
             if ($this->default_author == '') {
                 $ret = "\n\t" . '<li>' . get_author_name($this->post->post_author) . $sep . '</li>';
             } else {
                 $ret = "\n\t" . '<li>' . $this->default_author . $sep . '</li>';
             }
             break;
         case 'D':
             if ($this->default_date == '') {
                 $ret = "\n\t" . '<li>' . substr($this->post->post_date, 0, 10) . $sep . '</li>';
             } else {
                 $ret = "\n\t" . '<li>' . substr($this->default_date, 0, 10) . $sep . '</li>';
             }
             break;
         case 'E':
             $ret = "\n\t" . '<li>' . excerpt_revisited($this->post->post_content, 40, $this->post_url) . $sep . '</li>';
             break;
         case 'T':
             $ret = "\n\t" . '<li><a href="' . $this->post_url . '">' . $this->title . '</a>' . $sep . '</li>';
             break;
     }
     return $ret;
 }
function get_the_excerpt_revisited($excerpt_length = 120, $more_link_text = "...", $no_semiologic = false, $showdots = true, $more_tag = 'div', $no_more = false)
{
    global $post;
    $ellipsis = 0;
    $output = '';
    // if there's a password, return there.
    if (!empty($post->post_password)) {
        if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
            // and it doesn't match cookie
            // if this runs in a feed
            if (is_feed()) {
                $output = __('There is no excerpt because this is a protected post.');
            } else {
                $output = get_the_password_form();
            }
        }
        return $output;
    }
    $output = excerpt_revisited($post->post_content, $excerpt_length, get_permalink($post->ID), $more_link_text, $no_semiologic, $showdots, $more_tag, $no_more);
    return $output;
}
 function Get_Title($title = '')
 {
     $arg = strtoupper($title);
     switch ($arg) {
         case 'C':
             $ret = htmlspecialchars(excerpt_revisited($this->post->post_content, -1));
             break;
         case 'E':
             $ret = htmlspecialchars(excerpt_revisited($this->post->post_content, 40));
             break;
         case 'T':
             $ret = htmlspecialchars($this->post->post_title);
             break;
     }
     return $ret;
 }