From 98defefd961e36bf075bf6396bc8e58540caa832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Thu, 25 Jul 2024 09:49:31 +0800 Subject: [PATCH] 0.5.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 分类图片获取 --- functions.php | 12 +++++++----- page-categories.php | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index e61d35e..ade73a3 100644 --- a/functions.php +++ b/functions.php @@ -11,20 +11,22 @@ function themeConfig($form) { array('0'=> _t('否'), '1'=> _t('是')), '0', _t('是否在文章页面显示显示作者信息'), _t('选择“是”将在文章页面包含显示作者信息。')); $form->addInput($showProfile); - $instagramurl = new Typecho_Widget_Helper_Form_Element_Text('instagramurl', NULL, NULL, _t('Instagram'), _t('会在个人信息显示')); + $instagramurl = new Typecho_Widget_Helper_Form_Element_Text('instagramurl', NULL, 'https://Instagram.com/', _t('Instagram'), _t('会在个人信息显示')); $form->addInput($instagramurl); - $telegramurl = new Typecho_Widget_Helper_Form_Element_Text('telegramurl', NULL, NULL, _t('电报'), _t('会在个人信息显示')); + $telegramurl = new Typecho_Widget_Helper_Form_Element_Text('telegramurl', NULL, 'https://t.me/', _t('电报'), _t('会在个人信息显示')); $form->addInput($telegramurl); - $githuburl = new Typecho_Widget_Helper_Form_Element_Text('githuburl', NULL, NULL, _t('github'), _t('会在个人信息显示')); + $githuburl = new Typecho_Widget_Helper_Form_Element_Text('githuburl', NULL, 'https://github.com/', _t('github'), _t('会在个人信息显示')); $form->addInput($githuburl); - $twitterurl = new Typecho_Widget_Helper_Form_Element_Text('twitterurl', NULL, NULL, _t('twitter'), _t('会在个人信息显示')); + $twitterurl = new Typecho_Widget_Helper_Form_Element_Text('twitterurl', NULL, 'https://x.com/', _t('twitter'), _t('会在个人信息显示')); $form->addInput($twitterurl); - $mastodonurl = new Typecho_Widget_Helper_Form_Element_Text('mastodonurl', NULL, NULL, _t('mastodon'), _t('会在个人信息显示')); + $mastodonurl = new Typecho_Widget_Helper_Form_Element_Text('mastodonurl', NULL,'https://jiong.us/', _t('mastodon'), _t('会在个人信息显示')); $form->addInput($mastodonurl); $sitemapurl = new Typecho_Widget_Helper_Form_Element_Text('sitemapurl', NULL, NULL, _t('sitemap'), _t('会在页脚显示')); $form->addInput($sitemapurl); $cnavatar = new Typecho_Widget_Helper_Form_Element_Text('cnavatar', NULL, 'https://cravatar.cn/avatar/', _t('Gravatar镜像'), _t('默认https://cravatar.cn/avatar/,建议保持默认')); $form->addInput($cnavatar); + $midimg = new Typecho_Widget_Helper_Form_Element_Text('midimg', NULL, './img/', _t('填写图片路径,以"/"结尾'), _t('可以使用本地目录或者使用CDN地址')); + $form->addInput($midimg); $donate = new Typecho_Widget_Helper_Form_Element_Text('donate', NULL, 'https://blogcdn.loliko.cn/donate/wx.png', _t('赞赏二维码'), _t('不填写则不显示')); $form->addInput($donate); $doubanID = new Typecho_Widget_Helper_Form_Element_Text('doubanID', NULL, 'https://db.imsun.org/', _t('豆瓣页面必需API,包含"/"'), _t(' ')); diff --git a/page-categories.php b/page-categories.php index 99ca984..469d89a 100644 --- a/page-categories.php +++ b/page-categories.php @@ -17,10 +17,9 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> mid; - // 获取主题URL - $themeUrl = $this->options->themeUrl; + $themeUrl = $this->options->midimg; // 为每个分类生成图片地址 - $categoryImage = $themeUrl . '/dist/img/' . $categoryId . '.jpg'; + $categoryImage = $themeUrl . $categoryId . '.jpg'; ?>
<?php $categories->name(); ?>