forked from idawnlight/typecho-theme-material
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
142 lines (131 loc) · 8.64 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php $this->need('header.php'); ?>
<div class="material-layout mdl-js-layout has-drawer is-upgraded">
<main class="material-layout__content" id="main">
<div id="top"></div>
<!-- Hamburger Button -->
<button class="MD-burger-icon sidebar-toggle">
<span id="MD-burger-id" class="MD-burger-layer"></span>
</button>
<!-- Post module -->
<div class="material-post_container">
<div class="material-post mdl-grid">
<!-- Article title -->
<div class="mdl-card mdl-shadow--4dp mdl-cell mdl-cell--12-col">
<div class="post_thumbnail-custom mdl-card__media mdl-color-text--grey-50" style="background-image: url(<?php echo showThumbnail($this); ?>);">
<p class="article-headline-p">
<?php $this->title() ?>
</p>
</div>
<!-- Article info -->
<div class="mdl-color-text--grey-700 mdl-card__supporting-text meta">
<!-- Author avatar -->
<div id="author-avatar">
<?php if (!empty($this->options->avatarURL)): ?>
<img src="<?php $this->options->avatarURL() ?>" width="44px" height="44px" alt="Author Avatar">
<?php else: ?>
<?php $this->author->gravatar(44); ?>
<?php endif; ?>
</div>
<div>
<!-- Author name -->
<strong><?php $this->author(); ?></strong>
<!-- Articel date -->
<span>
<?php if ($this->options->language != 'zh-CN'): ?>
<?php $this->date('F j, Y'); ?>
<?php else: ?>
<?php $this->dateWord(); ?>
<?php endif; ?>
</span>
</div>
<div class="section-spacer"></div>
<?php if (getThemeOptions("qrcode") != "false"): ?>
<button id="article-functions-qrcode-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
<i class="material-icons" role="presentation">devices other</i>
<span class="visuallyhidden">devices other</span>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-functions-qrcode-button">
<li class="mdl-menu__item"><?php lang("post.qrcode") ?></li>
<img src="<?php getQRCode($this->permalink); ?>" height="200" width="200">
</ul>
<?php endif; ?>
<!-- view tags -->
<?php if (count($this->tags)): ?>
<button id="article-functions-viewtags-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
<!-- For modern browsers. -->
<i class="material-icons" role="presentation">bookmarks</i>
<span class="visuallyhidden">tags</span>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-functions-viewtags-button">
<li class="mdl-menu__item">
<?php $this->tags('<li class="mdl-menu__item" style="text-decoration: none;"> ', true, ''); ?></li>
</ul>
<?php endif; ?>
<!-- share -->
<button id="article-fuctions-share-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
<i class="material-icons" role="presentation">share</i>
<span class="visuallyhidden">share</span>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-fuctions-share-button">
<?php if ($this->user->hasLogin()):?>
<a class="md-menu-list-a" href="<?php $this->options->adminUrl(); ?>write-post.php?cid=<?php echo $this->cid;?>" target="_blank">
<li class="mdl-menu__item">编辑</li>
</a>
<?php endif;?>
<a class="md-menu-list-a" href="https://www.facebook.com/sharer/sharer.php?u=<?php $this->permalink(); ?>">
<li class="mdl-menu__item">
<?php lang("share.toFacebook") ?>
</li>
</a>
<a class="md-menu-list-a" href="https://telegram.me/share/url?url=<?php $this->permalink() ?>&text=<?php $this->title(); ?>" >
<li class="mdl-menu__item">
<?php lang("share.toTelegram") ?>
</li>
</a>
<a class="md-menu-list-a" href="https://twitter.com/intent/tweet?text=<?php $this->title() ?>&url=<?php $this->permalink() ?>&via=<?php $this->user->screenName(); ?>">
<li class="mdl-menu__item">
<?php lang("share.toTwitter") ?>
</li>
</a>
<a class="md-menu-list-a" href="http://service.weibo.com/share/share.php?appkey=&title=<?php $this->title(); ?>&url=<?php $this->permalink(); ?>&pic=&searchPic=false&style=simple ">
<li class="mdl-menu__item">
<?php lang("share.toWeibo") ?>
</li>
</a>
</ul>
</div>
<!-- Articel content -->
<div id="post-content" class="mdl-color-text--grey-700 mdl-card__supporting-text fade out">
<?php
if (!empty($this->options->switch) && in_array('PanguPHP', $this->options->switch)) {
print pangu($this->content);
} else {
$this->content();
}
?>
<?php if (!empty($this->options->post_license)): ?>
<blockquote style="margin: 2em 0 0;padding: 0.5em 1em;border-left: 3px solid #F44336;background-color: #F5F5F5;list-style: none;">
<p>
<strong><?php lang("post.permalink"); echo "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>" ;?></strong><br>
<strong><?php $this->options->post_license(); ?></strong>
</p>
</blockquote>
<?php endif;?>
</div>
<!-- Article comments -->
<?php $this->need('comments.php'); ?>
</div>
<!-- theNext thePrev button -->
<nav class="material-nav mdl-color-text--grey-50 mdl-cell mdl-cell--12-col">
<?php $this->theNext('%s', null, array('title' => '
<button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
<i class="material-icons">arrow_back</i>
</button> ' . lang("post.newer", false) . '', 'tagClass' => 'prev-content')); ?>
<div class="section-spacer"></div>
<?php $this->thePrev('%s', null, array('title' => lang("post.older", false) . ' <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
<i class="material-icons">arrow_forward</i>
</button>', 'tagClass' => 'prev-content')); ?>
</nav>
</div>
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>