feat: add option for multiple users (#287)

* feat: add option for multiple users

* chore: fix typo
pull/288/head^2
亦念 2020-09-21 11:43:06 +08:00 committed by GitHub
parent 3cdd89d6f6
commit 2d3d8ca62f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -195,6 +195,13 @@ function kratos_options()
'type' => 'upload',
);
$options[] = array(
'name' => __('多人创作', 'kratos'),
'desc' => __('在文章列表显示文章作者,在文章页面页脚显示作者介绍', 'kratos'),
'id' => 'multiusers',
'type' => 'checkbox',
);
$options[] = array(
'name' => __('收录配置', 'kratos'),
'type' => 'heading',

View File

@ -26,6 +26,9 @@
<div class="a-meta">
<span class="float-left d-none d-md-block">
<span class="mr-2"><i class="kicon i-calendar"></i><?php echo get_the_date('Y年m月d日'); ?></span>
<?php if(kratos_option('multiusers',false)){ ?>
<span class="mr-2"><i class="kicon i-user"></i><?php echo get_the_author_meta('display_name'); ?></span>
<?php } ?>
<span class="mr-2"><i class="kicon i-comments"></i><?php comments_number('0', '1', '%'); _e('条评论', 'kratos'); ?></span>
</span>
<span class="float-left d-block">

View File

@ -8,9 +8,15 @@
?>
<div class="toolbar clearfix">
<div class="meta float-md-left">
<?php if(kratos_option('multiusers',false)){ ?>
<img src="<?php echo get_avatar_url(get_the_author_meta('user_email')); ?>">
<p class="name"><?php echo get_the_author_meta('display_name'); ?></p>
<p class="motto mb-0"><?php echo get_the_author_meta('description'); ?></p>
<?php } else { ?>
<img src="<?php echo kratos_option('a_gravatar', ASSET_PATH . '/assets/img/gravatar.png'); ?>">
<p class="name"><?php echo kratos_option('a_nickname','Kratos'); ?></p>
<p class="motto mb-0"><?php echo kratos_option('a_about', __('保持饥渴的专注,追求最佳的品质', 'kratos')); ?></p>
<?php } ?>
</div>
<div class="share float-md-right text-center">
<?php if(kratos_option('g_donate',false)){ ?>