diff --git a/functions.php b/functions.php index 317daf1..4c6fa53 100644 --- a/functions.php +++ b/functions.php @@ -136,56 +136,27 @@ function themeFields($layout) new Typecho_Widget_Helper_Form_Element_Radio( 'navigation', array( - 2 => _t('小程序导航'), + 0 => _t('站内文章'), 1 => _t('网址导航'), - 0 => _t('普通文章') + 2 => _t('微信小程序'), ), 1, _t('文章类型'), - _t("普通文章: 点击会前往详情页; 网址导航: 点击图标前往详情,点击其他位置直接跳转至对应url") + _t("• 普通文章: 点击会前往文章页
• 网址导航: 点击图标前往详情,点击其他位置直接跳转至对应url
• 小程序: 点击往详情页") ) ); $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Text('url', NULL, NULL, _t('跳转链接'), _t('请输入跳转URL,小程序不填')) + new Typecho_Widget_Helper_Form_Element_Text('url', NULL, NULL, _t('跳转地址'), _t('• 普通文章: 此字段留空即可
• 网址导航: 可访问的URL
• 小程序: 二维码图片URL')) ); $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Text('text', NULL, NULL, _t('导航描述'), _t('请输入导航描述')) + new Typecho_Widget_Helper_Form_Element_Text('text', NULL, NULL, _t('简单介绍'), _t('简短描述即可,将展示于首页和详情页开头
(其他内容应记录在正文中)')) ); $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Text('logo', NULL, NULL, _t('链接logo'), _t('请输入Logo URL链接,网址加favicon.ico就是图标,默认是网站logo'))); - $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Text('qrcode', NULL, NULL, _t('小程序二维码'), _t('请输入小程序二维码链接!')) - ); - $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Text('screenshot', NULL, NULL, _t('功能预览'), _t('请输入功能预览链接!')) + new Typecho_Widget_Helper_Form_Element_Text('logo', NULL, NULL, _t('图标URL'), _t('文章/网站/小程序的图标链接
留空则自动从 favicon.im 获取(不支持小程序)')) ); $layout->addItem( new Typecho_Widget_Helper_Form_Element_Text('score', NULL, NULL, _t('评分'), _t('请输入评分,1.0~5.0分')) ); - $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Radio( - 'advertisement', - array( - 1 => _t('有'), - 0 => _t('无') - ), - 0, // 默认值为 0 (无广告) - _t('是否存在广告'), - _t("请选择是否有广告!") - ) - ); - $layout->addItem( - new Typecho_Widget_Helper_Form_Element_Radio( - 'official', - array( - 1 => _t('是'), - 0 => _t('否') - ), - 0, // 默认值为 0 (非官方小程序) - _t('是否是官方小程序'), - _t("请选择是否为官方小程序!") - ) - ); } /** @@ -321,4 +292,27 @@ function getSiteFavicon($posts) { $logo = 'https://favicon.im/' . parse_url($url, PHP_URL_HOST); } return $logo; +} + +function displayStars($score) { + $score = max(0, min(5, $score)); + + $fullStars = floor($score); + $halfStars = ($score - $fullStars) >= 0.5 ? 1 : 0; + $emptyStars = 5 - $fullStars - $halfStars; + + $stars = ''; + for ($i = 0; $i < $fullStars; $i++) { + $stars .= ''; + } + + if ($halfStars) { + $stars .= ''; + } + + for ($i = 0; $i < $emptyStars; $i++) { + $stars .= ''; + } + + return $stars; } \ No newline at end of file diff --git a/page-article.php b/page-article.php deleted file mode 100644 index 084705f..0000000 --- a/page-article.php +++ /dev/null @@ -1,110 +0,0 @@ -cid) { - exit(agree($this->cid)); - } - exit('error'); -} -$agree = $this->hidden ? array('agree' => 0, 'recording' => true) : agreeNum($this->cid); -$this->need('header.php'); -$this->need('sidebar.php'); -$this->need('topbar.php'); ?> - - -
-
-
-
-
-
-
-

title(); ?>

- -
-
- -
-
- - content(); ?> -
-
-
- - -
- - - -
-
-
- is('post')) : - $this->related(6, count($this->tags) > 0 ? 'tag' : 'author')->to($item); - if ($item->have()) : ?> -
-
- -
-
-
- next()) : ?> -
-
-
- -
-
-
-
title(); ?>
-
-
fields->text(); ?>
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
- -need('footer.php'); ?> diff --git a/page.php b/page.php index 309ae90..ee60a27 100644 --- a/page.php +++ b/page.php @@ -1,2 +1,2 @@ need('page-article.php'); \ No newline at end of file +$this->need('post.php'); \ No newline at end of file diff --git a/post-modal.php b/post-modal.php index b449dbf..39c35b1 100644 --- a/post-modal.php +++ b/post-modal.php @@ -6,9 +6,9 @@
-
+
fields->text): ?> - +

fields->text; ?>

fields->score): ?> @@ -51,36 +55,11 @@ fields->score ?>分 - fields->score); - $totalStars = 5; - $fullStars = floor($score); - $partialScore = $score - $fullStars; - for ($i = 0; $i < $fullStars; $i++) { - echo ''; - } - if ($partialScore > 0) { - echo ''; - $fullStars++; - } - for ($i = $fullStars; $i < $totalStars; $i++) { - echo ''; - } - ?> + fields->score) ?>
- fields->screenshot): ?> - - - - fields->navigation !== 0): ?> -

title(); ?>-使用体验

- - content(); ?>