增加判断是否在文章页面显示作者信息

This commit is contained in:
浪子 2024-05-17 18:42:35 +08:00
parent 965dd0fc7f
commit b221c3d9ab
9 changed files with 12 additions and 27 deletions

View File

@ -26,14 +26,10 @@ function themeConfig($form) {
$form->addInput($addhead);
$tongji = new Typecho_Widget_Helper_Form_Element_Textarea('tongji', NULL, NULL, _t('统计代码'));
$form->addInput($tongji);
}
function themeFields($layout) {
$switchpf = new Typecho_Widget_Helper_Form_Element_Checkbox('switchpf',
array('open'=>'显示作者'),
NULL,
_t('是否文章页面显示作者信息'),
_t('勾选后,将在文章页面显示'));
$layout->addItem($switchpf);
$showProfile = new Typecho_Widget_Helper_Form_Element_Radio('showProfile',
array('0'=> _t('否'), '1'=> _t('是')),
'0', _t('是否在文章页面显示显示作者信息'), _t('选择“是”将在文章页面包含显示作者信息。'));
$form->addInput($showProfile);
}
function get_post_view($archive) {
$cid = $archive->cid;

View File

@ -20,7 +20,6 @@ error_reporting(E_ALL);if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<link rel='icon' href='<?php $this->options->icoUrl() ?>' type='image/x-icon' />
<?php endif; ?>
<?php $this->header("generator=&template=&pingback=&wlw=&xmlrpc=&rss1=&atom=&rss2=/feed"); ?>
<?php $this->options->addhead(); ?>
</head>
<body>

View File

@ -1,6 +1,6 @@
<?php
/**
* 关于页面
* 无评论页面
*
* @package custom
*/
@ -11,7 +11,6 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<h1 class="post--single__title"><?php $this->title() ?></h1>
</header>
<article class="post--single">
<div class="graph u-marginBottom30">
<?php $this->content(); ?>
</div>

View File

@ -12,9 +12,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php Typecho_Widget::widget('Widget_Stat')->to($quantity); ?>
<h2 class="archive--title__year">共包含 <?php $quantity->publishedPostsNum(); ?> 篇文章</h2>
</header>
<div data-target="<?php $this->options->postLinkOpen(); ?>" class="page--archive" >
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
@ -44,8 +42,6 @@ $output .= '<li class="archive--item"><div class="archive--title"><a href="' . $
$output .= ' </ul></div></div>';
echo $output;?>
</div>
</main>
<?php $this->need('footer.php'); ?>

View File

@ -24,5 +24,4 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
'); ?>
</section>
</div>
<?php $this->need('footer.php'); ?>

View File

@ -1,6 +1,6 @@
<?php
/**
* 豆瓣
* 豆瓣页面
*
* @package custom
*/

View File

@ -23,11 +23,8 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
?>
</ul>
</div>
<?php if ($this->allow('comment')): ?>
<?php $this->need('comments.php'); ?>
<?php endif; ?>
</section>
<?php $this->need('footer.php'); ?>

View File

@ -9,7 +9,6 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<section class="site--main">
<header class="archive--header">
<h1 class="post--single__title"><?php $this->title() ?></h1>
</header>
<div class="post-content">
<?php $this->widget('Widget_Metas_Tag_Cloud', 'sort=mid&ignoreZeroCount=1&desc=0')->to($tags); ?>

View File

@ -60,7 +60,7 @@
<?php $this->tags(' ', true, ' '); ?>
</div>
<!-- 个人信息-->
<?php if($this->fields->switchpf && in_array('open', $this->fields->switchpf)): ?>
<?php if ($this->options->showProfile): ?>
<?php $this->need('profile.php'); ?>
<?php endif; ?>
<!--翻页-->