关于主题 Mozz主题模仿了GitBook风格 使用Mozz主题需要增加4个Typecho PHP接口 `/var/Widget/Archive.php ` ``` php /** * 显示下一个内容的标题链接 * * @access public * @param string $format 格式 * @return String 返回url */ public function theNextUrl($format = '%s', $default = NULL, $custom = array()) { $content = $this->db->fetchRow($this->select()->where('table.contents.created > ? AND table.contents.created < ?', $this->created, $this->options->time) ->where('table.contents.status = ?', 'publish') ->where('table.contents.type = ?', $this->type) ->where("table.contents.password IS NULL OR table.contents.password = ''") ->order('table.contents.created', Db::SORT_ASC) ->limit(1)); if ($content) { $content = $this->filter($content); $default = array( 'title' => NULL, 'tagClass' => NULL ); $custom = array_merge($default, $custom); extract($custom); $link = $content['permalink']; printf($format, $link); } else { echo $default; } } /** * 显示上一个内容的标题 * * @access public * @param string $format 格式 * @return String 返回url */ public function thePrevUrl($format = '%s', $default = NULL, $custom = array()) { $content = $this->db->fetchRow($this->select()->where('table.contents.created < ?', $this->created) ->where('table.contents.status = ?', 'publish') ->where('table.contents.type = ?', $this->type) ->where("table.contents.password IS NULL OR table.contents.password = ''") ->order('table.contents.created', Db::SORT_DESC) ->limit(1)); if ($content) { $content = $this->filter($content); $default = array( 'title' => NULL, 'tagClass' => NULL ); $custom = array_merge($default, $custom); extract($custom); $link = $content['permalink']; printf($format, $link); } else { echo $default; } } /** * 显示下一个内容的标题 * * @access public * @param string $format 格式 * @return String 返回url */ public function theNextTitle($format = '%s', $default = NULL, $custom = array()) { $content = $this->db->fetchRow($this->select()->where('table.contents.created > ? AND table.contents.created < ?', $this->created, $this->options->time) ->where('table.contents.status = ?', 'publish') ->where('table.contents.type = ?', $this->type) ->where("table.contents.password IS NULL OR table.contents.password = ''") ->order('table.contents.created', Db::SORT_ASC) ->limit(1)); if ($content) { $content = $this->filter($content); $default = array( 'title' => NULL, 'tagClass' => NULL ); $custom = array_merge($default, $custom); extract($custom); $title = $content['title']; printf($format, $title); } else { echo $default; } } /** * 显示上一个内容的标题链接 * * @access public * @param string $format 格式 * @return String 返回url */ public function thePrevTitle($format = '%s', $default = null, $custom = array()) { $content = $this->db->fetchRow($this->select()->where('table.contents.created < ?', $this->created) ->where('table.contents.status = ?', 'publish') ->where('table.contents.type = ?', $this->type) ->where("table.contents.password IS NULL OR table.contents.password = ''") ->order('table.contents.created', Db::SORT_DESC) ->limit(1)); if ($content) { $content = $this->filter($content); $default = [ 'title' => NULL, 'tagClass' => NULL ]; $custom = array_merge($default, $custom); extract($custom); $title = $content['title']; printf($format, $title); } else { echo $default; } } ```