Example #1
0
                    $this->category('、');
                } else {
                    echo "未分类";
                }
                ?>
</span> &bull; <a href="<?php 
                $this->permalink();
                ?>
#comments" class="comments-link"  title="《<?php 
                $this->title();
                ?>
》上的评论"><?php 
                $this->commentsNum('0', '1', '%d');
                ?>
 条评论</a> &bull; <span class="entry-views"><?php 
                echo number_format(MyTypechoTheme_Plugin::postViews($this->cid, $isPost));
                ?>
&nbsp;Views</span></div><?php 
            }
            ?>
			</header><?php 
            if ($type != "gallery" && $type != "image") {
                ?>
			<div class="entry-<?php 
                echo $isPost ? "content" : "summary";
                ?>
"><?php 
                if ($isPost) {
                    echo $this->content;
                } else {
                    $word_excerpt = $this->excerpt;
Example #2
0
        echo "</div>";
    } elseif ($type == "readers") {
        $page = MyTypechoTheme_Plugin::$_cache[0]["p_readers"];
        if (!$page) {
            $page = readerWall($this->db, $this->options);
            MyTypechoTheme_Plugin::setcache("p_readers", $page);
        }
        echo "<div class=\"entry-content\">";
        $this->content();
        echo $page;
        echo "</div>";
    } elseif ($type == "tags") {
        $page = MyTypechoTheme_Plugin::$_cache[0]["p_tags"];
        if (!$page) {
            $page = TagArchive($this->db);
            MyTypechoTheme_Plugin::setcache("p_tags", $page);
        }
        echo "<style type=\"text/css\">#tag-nav ul li{display:inline-block;margin:10px}#tag-nav ul li a{border:1px solid #ddd;color:#3b5998;padding:5px 6px;text-align:center;width:20px;display:inline-block}#tag-nav ul li .noclick{background-color:#fafafa;border:1px solid #eee;color:#eee}.tags-all-list{margin:10px 20px}.tags-all-list dl{border-bottom:1px dashed #ccc;margin:20px 0;padding:10px 0}.tags-all-list dt{float:left;font-size:28px;line-height:23px;text-align:center;width:70px;font-style:oblique;margin-left:38px}.tags-all-list dd{margin-left:70px}ul.inline,ol.inline{list-style:none outside none;margin-left:0}.tags-all-list dd li a{color:#e74c3c}ul.inline>li,ol.inline>li{display:inline-block;padding-left:5px;padding-right:5px}.tags-all-list .set-tags{margin-left:5px;position:relative;top:-6px}</style>";
        echo $page;
    } else {
        echo "<div class=\"entry-content\">";
        $this->content();
        echo "</div>";
    }
    ?>
		</article>
		<?php 
}
if ($allowComment && $this->allow("comment")) {
    if (!$isAjax) {
        ?>
Example #3
0
function SB_popularpost($param)
{
    return '<aside class="widget widget_minty_popularposts clearfix"><h3 class="widget-title"><span>热门文章</span></h3><ul>' . MyTypechoTheme_Plugin::getMostViewed(intval($param['max']) ? intval($param['max']) : 5) . '</ul></aside>';
}
Example #4
0
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;
}
Example #5
0
} else {
    $links = explode("\n", str_replace(array("\r"), "", $this->options->links));
    $linktext = "";
    foreach ($links as $link) {
        $link = explode('|', $link);
        if (count($link) != 2) {
            continue;
        }
        $linktext .= "<a href=\"" . $link[1] . "\" target=\"_blank\">" . $link[0] . "</a>";
    }
    echo $linktext;
}
?>
</nav>
  <div class="copyright">Loading in <?php 
echo MyTypechoTheme_Plugin::stopTimer();
?>
 second(s). Theme By <a href="http://my-typecho.tk">MyTypecho</a>. Powered By Typecho))).</div>
  <a id="rocket" href="#top" title="返回顶部"><i></i></a>
</footer>
<script type="text/javascript">var MINTY = {"url":"<?php 
$this->options->index("ajax/");
?>
","stickySidebar":"<?php 
echo $this->options->stickysidebar;
?>
","keyboardNavigation":<?php 
echo $this->options->kbnav ? $this->options->kbnav : "false";
?>
,"infiniteScroll":<?php 
echo $this->options->infsc ? $this->options->infsc : "0";
Example #6
0
            if (apc_clear_cache() && apc_clear_cache("user") && apc_clear_cache("opcode")) {
                $status = "APC缓存清除成功";
            } else {
                $status_code = "failed";
                $status = "APC缓存清除失败";
            }
        } else {
            $status_code = "notice";
            $status = "APC缓存未安装";
        }
        $this->widget('Widget_Notice')->set(_t($status), $status_code);
        $this->response->goBack(NULL, $this->options->adminUrl);
    } elseif ($pi == "cache") {
        $this->response->setStatus(200);
        MyTypechoTheme_Plugin::clearCache(array("featured", "sidebar", "post", "field"));
        MyTypechoTheme_Plugin::finalize();
        $this->widget('Widget_Notice')->set(_t("缓存清除成功!"), 'success');
        $this->response->goBack(NULL, $this->options->adminUrl);
    }
}
if ($pi == "ajax") {
    $this->response->setStatus(200);
    if (empty($_POST['u']) || empty($_POST['p'])) {
        exit('请填写用户名及密码');
    }
    if ($this->user->login($_POST['u'], $_POST['p'], false, empty($_POST['rem']) ? 0 : 7 * 86400)) {
        exit('success');
    }
    @sleep(3);
    exit('用户名或密码错误');
} elseif ($pi == "random") {
Example #7
0
 public static function finalize()
 {
     if (self::$_cache_mod) {
         self::$_cache_mod = false;
         @file_put_contents(self::$_cache_file, self::SAFETY_HEAD . @Json::encode(self::$_cache));
     }
 }