/** * treeViewCategories * * @param $categoryOptions 输出选项 * @access public * @return void */ public function listCategories($categoryOptions = NULL) { //初始化一些变量 $this->_categoryOptions = Typecho_Config::factory($categoryOptions); $this->_categoryOptions->setDefault(array('wrapTag' => 'ul', 'wrapClass' => '', 'itemTag' => 'li', 'itemClass' => '', 'showCount' => false, 'showFeed' => false, 'countTemplate' => '(%d)', 'feedTemplate' => '<a href="%s">RSS</a>')); // 插件插件接口 $this->pluginHandle()->trigger($plugged)->listCategories($this->_categoryOptions, $this); if (!$plugged) { $this->stack = $this->getCategories($this->_top); if ($this->have()) { echo '<' . $this->_categoryOptions->wrapTag . (empty($this->_categoryOptions->wrapClass) ? '' : ' class="' . $this->_categoryOptions->wrapClass . '"') . '>'; while ($this->next()) { $this->treeViewCategoriesCallback(); } echo '</' . $this->_categoryOptions->wrapTag . '>'; } $this->stack = $this->_map; } }
/** * 列出评论 * * @access private * @param mixed $singleCommentOptions 单个评论自定义选项 * @return void */ public function listComments($singleCommentOptions = NULL) { //初始化一些变量 $this->_singleCommentOptions = Typecho_Config::factory($singleCommentOptions); $this->_singleCommentOptions->setDefault(array('before' => '<ol class="comment-list">', 'after' => '</ol>', 'beforeAuthor' => '', 'afterAuthor' => '', 'beforeDate' => '', 'afterDate' => '', 'dateFormat' => $this->options->commentDateFormat, 'replyWord' => '<button type="button" id="reply-button" class="btn btn-danger btn-xs mdi-content-reply reply-button"><div class="ripple-wrapper"></div></button>', 'commentStatus' => _t('您的评论正等待审核!'), 'avatarSize' => 32, 'defaultAvatar' => NULL)); $this->pluginHandle()->trigger($plugged)->listComments($this->_singleCommentOptions, $this); if (!$plugged) { if ($this->have()) { echo $this->_singleCommentOptions->before; while ($this->next()) { $this->threadedCommentsCallback(); } echo $this->_singleCommentOptions->after; } } }
/** * 列出回响 * * @access private * @param mixed $singlePingOptions 单个回响自定义选项 * @return void */ public function listPings($singlePingOptions = NULL) { if ($this->have()) { //初始化一些变量 $parsedSinglePingOptions = Typecho_Config::factory($singlePingOptions); $parsedSinglePingOptions->setDefault(array('before' => '<ol class="ping-list">', 'after' => '</ol>', 'beforeTitle' => '', 'afterTitle' => '', 'beforeDate' => '', 'afterDate' => '', 'dateFormat' => $this->options->commentDateFormat)); echo $parsedSinglePingOptions->before; while ($this->next()) { $this->singlePingCallback($parsedSinglePingOptions); } echo $parsedSinglePingOptions->after; } }
/** * 列出评论 * * @access private * @param mixed $singleCommentOptions 单个评论自定义选项 * @return void */ public function listComments($singleCommentOptions = NULL) { //初始化一些变量 $this->_singleCommentOptions = Typecho_Config::factory($singleCommentOptions); $this->_singleCommentOptions->setDefault(array('before' => '', 'after' => '', 'beforeAuthor' => '', 'afterAuthor' => '', 'beforeDate' => '', 'afterDate' => '', 'dateFormat' => $this->options->commentDateFormat, 'replyWord' => _t('<i class="fa fa-reply"></i>'), 'commentStatus' => _t('回复待审核'), 'avatarSize' => 32, 'defaultAvatar' => NULL)); $this->pluginHandle()->trigger($plugged)->listComments($this->_singleCommentOptions, $this); if (!$plugged) { if ($this->have()) { echo $this->_singleCommentOptions->before; while ($this->next()) { $this->threadedCommentsCallback(); } echo $this->_singleCommentOptions->after; } } }
/** * 为多数据库提供支持 * * @access public * @param Typecho_Db $db 数据库实例 * @param integer $op 数据库操作 * @return void */ public function addServer($config, $op) { $this->_config[] = Typecho_Config::factory($config); $key = count($this->_config) - 1; /** 将连接放入池中 */ switch ($op) { case self::READ: case self::WRITE: $this->_pool[$op][] = $key; break; default: $this->_pool[self::READ][] = $key; $this->_pool[self::WRITE][] = $key; break; } }
/** * 列出评论 * * @access private * @param mixed $singleCommentOptions 单个评论自定义选项 * @return void */ public function listComments($singleCommentOptions = NULL) { if ($this->have()) { //初始化一些变量 $parsedSingleCommentOptions = Typecho_Config::factory($singleCommentOptions); $parsedSingleCommentOptions->setDefault(array('before' => '<ol class="comment-list">', 'after' => '</ol>', 'beforeAuthor' => '', 'afterAuthor' => '', 'beforeDate' => '', 'afterDate' => '', 'dateFormat' => $this->options->commentDateFormat, 'replyWord' => _t('回复'), 'commentStatus' => _t('您的评论正等待审核!'), 'avatarSize' => 32, 'defaultAvatar' => NULL)); echo $parsedSingleCommentOptions->before; while ($this->next()) { $this->threadedCommentsCallback($parsedSingleCommentOptions); } echo $parsedSingleCommentOptions->after; } }
public function listNodes($nodeOptions = NULL) { $this->_nodeOptions = Typecho_Config::factory($nodeOptions); $this->_nodeOptions->setDefault(array('node' => '<a href="{permalink}">{name}</a>', 'cate' => '', 'cateBefore' => '', 'cateAfter' => '', 'isBefore' => 0)); $this->stack = $this->getCategories($this->_top); if ($this->have()) { while ($this->next()) { $this->treeViewNodesCallback(); } } $this->stack = $this->_map; }