summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--about.php5
-rw-r--r--includes/header.php3
-rwxr-xr-xlibs/Options.php14
3 files changed, 14 insertions, 8 deletions
diff --git a/about.php b/about.php
index 2c912f6..bca5d10 100644
--- a/about.php
+++ b/about.php
@@ -11,8 +11,9 @@ $this->need('includes/header.php');
<div class="post-body">
<br><br><br>
<div class="about">
- <div class="about-avatar"><!-- 头像(调用 gravatar)-->
- <?php echo $this->author->gravatar(300); ?>
+ <div class="about-avatar"><!-- 头像 -->
+ <?php if($this->options->avatar==''): echo $this->author->gravatar(500);
+ else: ?><img src="<?php $this->options->avatar(); ?>"><?php endif; ?>
<?php if($this->fields->name==!''): ?>
<h2 class="about-name"><?php echo $this->fields->name(); ?></h2>
<?php endif; ?>
diff --git a/includes/header.php b/includes/header.php
index e984006..667357d 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -131,7 +131,8 @@
<button class="drawer-button" onclick="toggleDrawer();$('.options').addClass('ready');"><i class="iconfont icon-list"></i></button>
<div class="drawer-header">
<div class="drawer-avatar">
- <?php echo $this->author->gravatar(500); ?>
+ <?php if($this->options->avatar==''): echo $this->author->gravatar(500);
+ else: ?><img src="<?php $this->options->avatar(); ?>"><?php endif; ?>
</div>
</div>
<div class="drawer-content">
diff --git a/libs/Options.php b/libs/Options.php
index 9cd87aa..ce3272b 100755
--- a/libs/Options.php
+++ b/libs/Options.php
@@ -50,7 +50,7 @@ function themeConfig($form) {
?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 2500);</script>
<?php
}else{
- echo '<div class="miracles-backup-alert">不用删了!备份不存在!!!</div>';
+ echo '<div class="miracles-backup-alert">备份不存在!</div>';
}
}
}
@@ -77,6 +77,14 @@ function themeConfig($form) {
/**
* 设置项
*/
+ //Info
+ $bannerTitle = new Typecho_Widget_Helper_Form_Element_Text('bannerTitle', NULL, NULL, _t('<h2>站点信息 Information</h2>站点名称'), _t('输入你站点的名称,会显示在首页大图上'));
+ $form->addInput($bannerTitle);
+ $bannerIntro = new Typecho_Widget_Helper_Form_Element_Text('bannerIntro', NULL, NULL, _t('站点介绍'), _t('用一句话介绍你的站点,会显示在首页大图上'));
+ $form->addInput($bannerIntro);
+ $avatar = new Typecho_Widget_Helper_Form_Element_Text('avatar', NULL, NULL, _t('站长头像'), _t('输入一个图片 url 作为头像,若为空则调用 gravatar<hr>'));
+ $form->addInput($avatar);
+
//nav
$navStyle = new Typecho_Widget_Helper_Form_Element_Select('navStyle',array('0'=>'顶部导航栏','1'=>'左侧抽屉栏'),'0','<h2>导航栏 Nav</h2>类型','选择导航栏的类型(若选择左侧抽屉蓝,则下一条设置失效)');
$form->addInput($navStyle);
@@ -92,10 +100,6 @@ function themeConfig($form) {
$form->addInput($bannerFont);
$bannerHeight = new Typecho_Widget_Helper_Form_Element_Text('bannerHeight', NULL, '60', _t('高度'), _t('首页大图所占屏幕的高度,100为最大,填入纯数字,如"35"'));
$form->addInput($bannerHeight);
- $bannerTitle = new Typecho_Widget_Helper_Form_Element_Text('bannerTitle', NULL, NULL, _t('标题'), _t('这里是首页大图显示的的标题'));
- $form->addInput($bannerTitle);
- $bannerIntro = new Typecho_Widget_Helper_Form_Element_Text('bannerIntro', NULL, NULL, _t('介绍'), _t('这里是首页大图标题下的简介<hr>'));
- $form->addInput($bannerIntro);
//pjax
$pjax = new Typecho_Widget_Helper_Form_Element_Select('pjax',array('0'=>'关闭','1'=>'开启'),'1','<h2>Pjax 预加载</h2>是否开启','Pjax 预加载功能的开关');