forked from AlanDecode/Typecho-Theme-RAW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
90 lines (88 loc) · 5.03 KB
/
page.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* page.php
*
* 独立页面
*
* @author 熊猫小A
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?>
<?php $this->need('head.php'); ?>
<?php $this->need('header.php'); ?>
<div id="main" class="flex flex-1">
<div class="center flex-1">
<!--post-item start-->
<div id="post-list">
<?php if(!$this->have()):?>
<div class="post-item">
<div class="post-item-body" style="padding-top:0.001em"><h1 style="text-align:center;margin-top:40px;color:var(--text-color)">糟糕,是 404 的感觉</h1></div>
</div>
<?php else:?>
<div style="animation-delay:0.2s" class="post-item full">
<?php if($this->fields->type=='1' || !($this->fields->banner && $this->fields->banner!='')): ?>
<div class="post-item-header flex align-items-center" style="padding-bottom:0">
<img class="avatar" src="<?php echo Typecho_Common::gravatarUrl($this->author->mail, 100, '', '', true)?>" />
<div style="font-size: 14px; line-height: 1.5;overflow:hidden" class="post-meta flex flex-direction-column">
<span><b><?php echo $this->author->screenName; ?></b> 发表了一篇<?php if($this->fields->type=='1') echo '说说'; else echo '日志'; ?></span>
<span style="white-space:nowrap;text-overflow:ellipsis;overflow:hidden"><?php Utils::exportPostMeta($this,$this->fields->type); ?></span>
</div>
</div>
<?php elseif($this->fields->banner && $this->fields->banner!='') :?>
<a data-fancybox="gallery" href="<?php echo $this->fields->banner; ?>"><img style="max-width:100%;width:100%" src="<?php echo $this->fields->banner; ?>"/></a>
<?php endif; ?>
<div class="post-item-body <?php if($this->fields->banner && $this->is('index')) echo 'pull-left'; if($this->is('index')&&($this->fields->indextype=='1')) echo ' featured';?> flex">
<article class="yue">
<?php if(!($this->fields->type=='1')): ?>
<h1 class="post-title"><?php $this->title();?>
<?php if($this->user->hasLogin()): ?>
<sup><a target="_blank" href="<?php echo $this->options->adminUrl.'write-page.php?cid='.$this->cid;?>" class="footnote-ref"><i class="fa fa-edit"></i></a></sup>
<?php endif;?>
</h1>
<?php endif; ?>
<?php if(!$this->fields->type=='1' && ($this->fields->banner && $this->fields->banner!='')): ?>
<div class="post-item-header flex align-items-center" style="padding: 0;font-size:14px;overflow:hidden">
<span style="white-space:nowrap;text-overflow:ellipsis;overflow:hidden"><b><i class="fa fa-pencil"></i> <?php echo $this->author->screenName; ?></b> • <?php Utils::exportPostMeta($this,$this->fields->type); ?></span>
</div>
<?php endif; ?>
<?php if($this->fields->showTOC=='1'):?>
<?php
$parsed=Utils::parseTOC(Utils::parseAll($this->content));
$GLOBALS['TOC_O']=$parsed['toc'];
echo $parsed['content'];
?>
<?php else :?>
<?php echo Utils::parseAll($this->content,true); ?>
<?php endif; ?>
</article>
</div>
<div class="post-item-footer">
<?php if(Utils::isPluginAvailable('Like')):?>
<span class="like-button"><a href="javascript:;" class="post-like" data-pid="<?php echo $this->cid;?>">
<i class="fa fa-heart"></i> LIKE <span class="like-num"><?php Like_Plugin::theLike($link = false,$this);?></span>
</a></span>
<?php endif; ?>
<span>Tags:<?php $this->tags(',', true, 'none'); ?></span>
</div>
</div>
<?php endif; ?>
</div>
<!--post-item end-->
<div class="post-item" style="animation-delay:0.2s">
<div class="post-pager">
<?php Utils::thePrev($this);?>
<?php if($this->options->reward_img&&$this->options->reward_img!=''):?>
<div class="post-pager-item post-pager-reward" data-title="如果觉得不错就赞赏一下吧~"><a data-fancybox data-src="#reward" href="javascript:;"><i class="fa fa-gift"></i> 打赏</a></div>
<?php endif;?>
<?php Utils::theNext($this);?>
</div>
</div>
<?php $this->need('comments.php'); ?>
<?php $this->need('footer-info.php'); ?>
</div>
<?php $this->need('nav-left.php'); ?>
<?php if($this->options->bloglayout!='1'):?>
<?php $this->need('aside.php'); ?>
<?php endif;?>
</div>
<?php $this->need('footer.php'); ?>