Exemplo n.º 1
0
function uppsite_process_post($with_content = false)
{
    $ret = array('id' => get_the_ID(), 'permalink' => get_permalink(), 'title' => html_entity_decode(get_the_title(), ENT_QUOTES, 'UTF-8'), 'member' => uppsite_get_member(), 'excerpt' => get_the_excerpt(), 'time' => apply_filters('the_time', get_the_time('m/d/y G:i'), 'm/d/y G:i'), 'unix_time' => apply_filters('the_time', get_the_time('U'), 'U'), 'comments_link' => get_comments_link(), 'comments_num' => get_comments_number(), 'comments_open' => comments_open());
    $post_content = null;
    if ($with_content) {
        ob_start();
        the_content();
        $post_content = ob_get_contents();
        ob_get_clean();
    }
    $ret['thumb_url'] = mysiteapp_extract_thumbnail($post_content);
    if ($with_content) {
        uppsite_process_body_filters($post_content);
        $ret['content'] = $post_content;
    }
    $maxChar = is_null($ret['thumb_url']) ? UPPSITE_MAX_TITLE_LENGTH + 15 : UPPSITE_MAX_TITLE_LENGTH;
    $maxChar += isset($_GET['view']) && $_GET['view'] == "excerpt" ? 0 : 22;
    $maxChar += $with_content ? +10 : 0;
    if (uppsite_is_homepage_carousel()) {
        $maxChar = 66;
    }
    $orgLen = uppsite_strlen($ret['title']);
    if ($orgLen > $maxChar) {
        $matches = uppsite_match("(.{0," . $maxChar . "})\\s", $ret['title']);
        $newTitle = rtrim($matches[1]);
        $newTitle .= uppsite_strlen($newTitle) == $orgLen ? "" : " ...";
    }
    if (!is_null($newTitle)) {
        $ret['title'] = $newTitle;
    }
    return $ret;
}
Exemplo n.º 2
0
?>
"
	comments_open="<?php 
echo comments_open() ? "true" : "false";
?>
"
	facebook_comments="<?php 
echo isset($options['fbcomment']) ? "true" : "false";
?>
">
	<permalink><![CDATA[<?php 
the_permalink();
?>
]]></permalink>
	<thumb_url><![CDATA[<?php 
echo mysiteapp_extract_thumbnail();
?>
]]></thumb_url>
	<title><![CDATA[<?php 
echo html_entity_decode(get_the_title(), ENT_QUOTES, 'UTF-8');
?>
]]></title>
	<time><![CDATA[<?php 
the_time('m/d/y G:i');
?>
]]></time>
	<unix_time><![CDATA[<?php 
the_time('U');
?>
]]></unix_time>
	<member>