forked from foxnes/tp_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
62 lines (58 loc) · 2.13 KB
/
index.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
<?php
/**
* 仿WP的Hueman主题
*
* @package Hufman
* @author Luuljh
* @version 0.3.9
* @link https://github.com/foxnes
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('head.php');
$temp_no_rand_thumb = false;
if (!empty($this->options->ThemeOptions) && in_array('no_rand_thumb', $this->options->ThemeOptions))
$temp_no_rand_thumb = true;
?>
<?php while($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<h3 class="post-title i" itemprop="name headline">
<a href="<?php $this->permalink() ?>" itemprop="url"><?php $this->title() ?></a>
</h3>
<div class="post-content i" itemprop="articleBody">
<?php
$hasThumb = showThumb($this, (!$temp_no_rand_thumb));
if ($hasThumb){
$excerpt_limit = 210;
}else{
$excerpt_limit = 300;
}
$this->excerpt($excerpt_limit, " ...");
?>
</div>
<div class="post-meta-i">
<span class="a-color"><?php $this->category(' / '); ?></span>
<i class="icon icon-clock"></i> <time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date(); ?></time>
<?php if (!$hasThumb): ?>
<i class="icon icon-eye"></i> <?php echo getViewsStr($this); ?>
<i class="icon icon-comment-empty"></i> <?php echo $this->commentsNum; ?>
<?php endif; ?>
<?php if($this->user->hasLogin()): ?>
<i class="icon icon-edit"></i> <a href="<?php $this->options->adminUrl("write-post.php?cid=".$this->cid); ?>">编辑</a>
<?php endif; ?>
</div>
</article>
<?php endwhile; ?>
<div class="post">
<div class="fr">
<?php $this->pageLink('下一页 <i class="icon icon-angle-double-right"></i>','next'); ?>
</div>
<div class="fl">
<?php $this->pageLink('<i class="icon icon-angle-double-left"></i> 上一页'); ?>
</div>
<div class="clear"></div>
</div>
<?php $this->need('foot.php'); ?>