Exemple #1
0
        ?>
" class="ispost hentry<?php 
        if ($type) {
            echo " format-" . $type;
        }
        if ($isAjax) {
            echo " fadein";
        }
        ?>
">
			<?php 
        $usual = $type != "status" && $type != "quote";
        if (empty($fields['nothumb']) && $usual) {
            $thumb = isset($fields['thumb']) ? $fields['thumb'] : MyTypechoTheme_Plugin::getThumb($this->cid);
            if ($thumb !== false) {
                $thumb = scaleThumb($thumb, 700, 220);
                echo $isPost ? '<div class="entry-cover">' : '<a class="entry-cover" href="' . $this->permalink . '">';
                echo '<img width="700" height="220" src="' . $thumb . '" alt="' . $this->title . '" class="lazy" onerror="this.onerror=null;this.src=\'' . Typecho_Common::url('img/blank.gif', $this->options->themeUrl) . '\'" />';
                echo $isPost ? '</div>' : '</a>';
            }
        }
        if ($type) {
            echo "<i class=\"entry-icon\"></i>";
        }
        if (!$usual) {
            ?>
<a href="<?php 
            $this->permalink();
            ?>
"><div class="entry-content"><?php 
            echo $isPost ? $this->content : $this->excerpt;
function FeaturedSlider()
{
    if (isset(MyTypechoTheme_Plugin::$_cache[0]["featured"])) {
        return MyTypechoTheme_Plugin::$_cache[0]["featured"];
    }
    if (empty(MyTypechoTheme_Plugin::$_options->featured)) {
        return false;
    }
    $posts = MyTypechoTheme_Plugin::matchPost(@explode("\n", str_replace("\r", "", MyTypechoTheme_Plugin::$_options->featured)));
    if (empty($posts)) {
        return false;
    }
    $output = "";
    $counter = 1;
    foreach ($posts as $cid => $post) {
        //Field
        $thumb = MyTypechoTheme_Plugin::getField($cid, 'featured');
        if (empty($thumb)) {
            $thumb = scaleThumb($post[2], 960, 290);
        }
        if ($thumb) {
            $output .= '<li class="slide-' . $counter . '"><a href="' . $post[1] . '"><img src="' . $thumb . '" alt="' . $post[0] . '" /></a></li>';
        }
    }
    MyTypechoTheme_Plugin::setcache("featured", $output);
    return $output;
}