-
Notifications
You must be signed in to change notification settings - Fork 33
/
functions.php
73 lines (64 loc) · 2.37 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
function themeConfig($form) {
$logoUrl = new Typecho_Widget_Helper_Form_Element_Text('logoUrl', NULL, NULL, _t('站点LOGO地址'), _t('在这里填入一个图片URL地址, 以在网站标题前加上一个LOGO'));
$form->addInput($logoUrl);
$sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock',
array('ShowRecentPosts' => _t('显示最新文章'),
'ShowRecentComments' => _t('显示最近回复'),
'ShowCategory' => _t('显示分类'),
'ShowArchive' => _t('显示归档'),
'ShowOther' => _t('显示其它杂项')),
array('ShowRecentPosts', 'ShowRecentComments', 'ShowCategory', 'ShowArchive', 'ShowOther'), _t('侧边栏显示'));
$form->addInput($sidebarBlock->multiMode());
}
?>
<?php function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass .= ' commentbyauthor';
} else {
$commentClass .= ' commentbyuser';
}
}
$commentLevelClass = $comments->levels > 0 ? ' comment-child' : 'comment-parent';
?>
<li id="li-comment-<?php $comments->theId(); ?>" class="comment comments-area<?php
if ($comments->levels > 0) {
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
} else {
echo ' comment-parent';
}
$comments->alt(' comment-odd', ' comment-even');
echo $commentClass;
?>">
<article id="<?php $comments->theId(); ?>" class="comment">
<header class="comment-meta comment-author vcard">
<?php $comments->gravatar('40', ''); ?>
<cite class="fn">
<?php $comments->author(); ?>
</cite>
<a href="<?php $comments->permalink(); ?>">
<time datetime="<?php $comments->date('c'); ?>">
<?php $comments->date('Y年m月d日G:i'); ?>
</time>
</a>
</header>
<section class="comment-content comment">
<?php $comments->content(); ?>
</section>
<div class="reply">
<?php
$comments->reply('回复');
_e('<span>↓</span>');
?>
</div>
</article>
<?php if ($comments->children) { ?>
<div class="children">
<?php $comments->threadedComments($options); ?>
</div>
<?php } ?>
</li>
<?php } ?>