-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpost.php
45 lines (43 loc) · 2.08 KB
/
post.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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div class="container main">
<div class="row">
<div class="col-md-9">
<?php
$categories = $this->categories;
foreach($categories as $cate) {
$catename = $cate['name'];
$catelink = $cate['permalink'];
}
?>
<ol class="breadcrumb current">
<li><a href="<?php $this->options->siteUrl(); ?>">首页</a></li>
<li><a href="<?php echo $catelink; ?>"><?php echo $catename; ?></a></li>
<li class="active"><?php $this->title() ?></li>
</ol>
<div class="post">
<h3 class="post-title"><?php $this->title() ?></h3>
<div class="post-meta"><span><i class="glyphicon glyphicon-time"
aria-hidden="true"></i><?php $this->date('Y.m.d'); ?></span><span><i class="glyphicon glyphicon-eye-open"
aria-hidden="true"></i>0 次阅读</span><span><i class="glyphicon glyphicon-comment"
aria-hidden="true"></i><?php $this->commentsNum('暂无评论', '1 条评论', '%d 条评论'); ?></span></div>
<div class="post-body">
<?php
$pattern = '/\<img.*?src\=\"(.*?)\"[^>]*>/i';
$replacement = '<a href="$1" data-lightbox="lightbox" /><img src="$1" /></a>';
$content = preg_replace($pattern, $replacement, $this->content);
echo $content;
?>
</div>
<?php if(count($this->tags) > 0 ): ?>
<div class="post-tags">
<i class="glyphicon glyphicon-tags"></i><span><?php tags($this); ?></span>
</div>
<?php endif; ?>
</div>
<?php $this->need('comments.php'); ?>
</div>
<?php $this->need('sidebar.php'); ?>
</div>
</div>
<?php $this->need('footer.php'); ?>