From 1b8396cee17ac4c772ddc3adcda8252b1cbc2624 Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Thu, 26 Mar 2020 11:55:00 +0800 Subject: =?UTF-8?q?=F0=9F=9A=8C=20Add:=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/header.php | 12 +++++++++--- libs/Contents.php | 31 +++++++++++++++++++++++-------- libs/Options.php | 4 +++- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/includes/header.php b/includes/header.php index 1021383..7682580 100644 --- a/includes/header.php +++ b/includes/header.php @@ -66,8 +66,14 @@ @@ -143,4 +149,4 @@ -


+


\ No newline at end of file diff --git a/libs/Contents.php b/libs/Contents.php index d5cb522..51d97a6 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -151,15 +151,22 @@ class Contents return ''; } + /** + * 解析自定义导航栏 + */ + static public function paresNav($data) { + $de_json = json_decode($data, true); + $count_json = count($de_json); + for ($i = 0; $i < $count_json; $i++) { + $title = $de_json[$i]['title']; + $link = $de_json[$i]['link']; + //输出导航 + echo ''. $title .''; + } + } + + //从这里开始的代码来自 熊猫小A (https://imalan.cn) - /** - * 根据 id 返回对应的对象 - * 此方法在 Typecho 1.2 以上可以直接调用 Helper::widgetById(); - * 但是 1.1 版本尚有 bug,因此单独提出放在这里 - * - * @param string $table 表名, 支持 contents, comments, metas, users - * @return Widget_Abstract - */ /** * 为内容中的标题编号 @@ -172,6 +179,14 @@ class Contents return ''.$matchs[3].''; } + /** + * 根据 id 返回对应的对象 + * 此方法在 Typecho 1.2 以上可以直接调用 Helper::widgetById(); + * 但是 1.1 版本尚有 bug,因此单独提出放在这里 + * + * @param string $table 表名, 支持 contents, comments, metas, users + * @return Widget_Abstract + */ public static function widgetById($table, $pkId) { $table = ucfirst($table); diff --git a/libs/Options.php b/libs/Options.php index 07b7c09..bd2a97d 100755 --- a/libs/Options.php +++ b/libs/Options.php @@ -89,8 +89,10 @@ function themeConfig($form) { //nav $navStyle = new Typecho_Widget_Helper_Form_Element_Select('navStyle',array('0'=>'顶部导航栏','1'=>'左侧抽屉栏'),'0','

导航栏 Nav

类型','选择导航栏的类型(若选择左侧抽屉蓝,则下一条设置失效)'); $form->addInput($navStyle); - $navAero = new Typecho_Widget_Helper_Form_Element_Select('navAero',array('0'=>'是','1'=>'否'),'0','顶部透明','视口处于最顶部时,顶部导航栏是否变为透明
'); + $navAero = new Typecho_Widget_Helper_Form_Element_Select('navAero',array('0'=>'是','1'=>'否'),'0','顶部透明','视口处于最顶部时,顶部导航栏是否变为透明'); $form->addInput($navAero); + $customNav = new Typecho_Widget_Helper_Form_Element_Textarea('customNav', NULL, NULL, _t('自定义导航栏'), _t('按照格式书写,自定义导航栏内容,留空则读取所有的独立页面,书写的格式请查看 wiki
')); + $form->addInput($customNav); //index-banner $bannerUrl = new Typecho_Widget_Helper_Form_Element_Text('bannerUrl', NULL, NULL, _t('

首页大图 Banner

图片 Url'), _t('首页大图的图片地址')); -- cgit v1.2.3