-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.php
366 lines (280 loc) · 18.7 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?php
/**
* 这是由Viosey 基于 Google Material Design 开发的 Typecho 主题
* 由Manyang901继续维护和更新
*
* @package New.Material
* @author Viosey & Manyang901
* @version 2.10.1
* @link https://github.com/manyang901/material
*
*/
//Include header.php
$this->need('inc/header.php');
//Include Language Dictionary
if ($this->options->langis == '0') {
require_once(dirname(__FILE__) . '/inc/lang/en-us.php');
} elseif ($this->options->langis == '1') {
require_once(dirname(__FILE__) . '/inc/lang/zh-cn.php');
} elseif ($this->options->langis == '2') {
require_once(dirname(__FILE__) . '/inc/lang/zh-tw.php');
}
$MultiLang = new LangDict();
?>
<!-- Standalone CSS Calling For Page -->
<?php if (!empty($this->options->CDNUrl)): ?>
<link class="pjax-load " rel="stylesheet" type="text/css" media="all" href="<?php $this->options->CDNUrl(); ?>/MaterialCDN/css/index.css" />
<?php else: ?>
<link class="pjax-load" rel="stylesheet" type="text/css" media="all" href="<?php $this->options->themeUrl('css/index.css'); ?>" />
<?php endif; ?>
<!-- Standalone CSS END -->
<link rel="prefetch" href="<?php $this->options->themeUrl('css/post.css') ?>" as="style">
</head>
<!-- Html Head END -->
<!-- Html Body Start-->
<body class="mdui-drawer-body-left mdui-theme-primary-<?php $this->options->ThemeColor(); ?> mdui-theme-accent-<?php $this->options->AccentColor(); ?> <?php if (in_array('DarkTheme', $this->options->FunctionSwitch)) { echo 'mdui-theme-layout-dark'; }?>" >
<main>
<!-- Auto Hiding Header & Appbar & Title BEGIN -->
<header class="mdui-appbar mdui-appbar-fixed mdui-appbar-scroll-hide header-responsive" id="header">
<div class="mdui-toolbar mdui-color-theme mdui-color-white" >
<!-- menu icon -->
<span class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-drawer="{target: '#sidebar', swipe: true}"><i class="mdui-icon material-icons">menu</i></span>
<!-- title in appbar header -->
<a href="<?php $this->options->siteUrl(); ?>" class="mdui-typo-headline mdui-center">
<?php $this->options->title(); ?>
</a>
</div>
</header>
<!-- Header & Appbar & Title End -->
<!-- Blog Header BEGIN -->
<!-- Contain Left Main-pic , Right main-logo and slogan -->
<div class="mdui-container-fluid mdui-appbar-with-toolbar pjax-load" >
<!-- Provide a switch of showing first row of content -->
<?php if (in_array('ShowMainPic',$this->options->FunctionSwitch)): ?>
<!-- First Row Of Content-->
<div class="mdui-row">
<!-- Left Main Picture Column-->
<div class="mdui-col-xs-12 mdui-col-md-7 mdui-col-offset-md-1">
<!-- Left Main-pic MD card BEGIN -->
<div class="mdui-card top-card">
<!-- Main-pic Picture -->
<div class="mdui-card-media" >
<a href="<?php $this->options->MainPicHref(); ?>">
<?php if (!empty($this->options->MainPic )): ?>
<img class="main-pic" alt="main-pic" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php $this->options->MainPic(); ?>">
<?php else: ?>
<img class="main-pic" alt="main-pic" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php $this->options->themeUrl('img/MainPic.jpg') ?>" />
<?php endif; ?>
</a>
<!--Slogan BEGIN-->
<div class="mdui-card-media-covered mdui-card-media-covered-gradient">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title">
<?php $this->options->slogan(); ?>
</div>
</div>
</div>
<!-- Slogan END-->
</div>
<!-- Main-pic Picture END -->
</div>
<!-- Left Main-pic MD card END -->
</div>
<!-- Left Main Picture Column END -->
<!-- Right Part BEGIN -->
<!-- Including main-logo and a title -->
<div class="mdui-col-xs-12 mdui-col-md-3" >
<!-- Right MD card -->
<div class="mdui-card top-card" >
<div class="mdui-card-media mdui-center" >
<!-- Main-logo with a href -->
<a href="<?php $this->options->LogoHref(); ?>">
<?php if (!empty($this->options->Logo )): ?>
<img class="main-logo" alt=
"main-logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php $this->options->Logo(); ?>">
<?php else: ?>
<img class="main-logo" alt="main-logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php $this->options->themeUrl('img/Avatar.jpg') ?>" >
<?php endif; ?>
</a>
<!-- Main-logo END -->
</div>
<!-- A small divider between Main-logo and title -->
<div class="mdui-divider"></div>
<!-- A Blog title -->
<div class="mdui-card-actions mdui-valign">
<div class="main-logo-title mdui-float-left mdui-text-color-theme-secondary">
<?php $this->options->title(); ?>
</div>
<div class="mdui-toolbar-spacer"></div>
<div id="main-search-container" class="main-search" >
<div class="main-search-form-wrapper">
<form method="post" action="" class="main-search-form">
<input id="main-search-text" type="text" name="s" class="text" size="16" />
<input type="submit" class="submit mdui-btn mdui-btn-dense mdui-btn-raised mdui-color-white" value="Search" />
</form>
<button id="main-search-close" class="mdui-btn mdui-btn-icon mdui-btn-dense mdui-ripple">
<i class="mdui-icon material-icons">close</i>
</button>
</div>
</div>
<button id="main-search-btn" class="mdui-float-right mdui-btn mdui-btn-icon">
<i class="mdui-icon material-icons">search</i>
</button>
</div>
</div>
<!-- Right MD card END -->
</div>
<!-- Right Part END -->
</div>
<!-- First Row Of content END -->
<?php endif; ?>
</div>
<!-- Blog Header END -->
<!-- Blog Posts Output BEGIN -->
<div class="mdui-container-fluid pjax-load" >
<?php while ($this->next()): ?>
<!-- Each Post Occupy One MD Row-->
<div class="mdui-row" >
<!-- Post MD Card Wrap Location -->
<div class="mdui-col-xs-12 mdui-col-md-10 mdui-col-offset-md-1" >
<!-- MD Card Used to Contain Post Info Begin-->
<div class="mdui-card mdui-hoverable">
<!-- Show First Pic in post as thumbnail -->
<?php if ($this->options->ThumbnailOption == '1'): ?>
<div class="mdui-card-media index-post-card-media" >
<!-- Post ThumbNail -->
<picture>
<img alt="ThumbNail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php showThumbnail($this); ?>" >
</picture>
<!-- Post ThumbNail END -->
<!-- Post Title Displays Above Bottom in ThumbNail-->
<div class="mdui-card-media-covered mdui-card-media-covered-gradient" >
<div class="mdui-card-primary mdui-typo" >
<a class="mdui-card-primary-title mdui-text-color-white" href="<?php $this->permalink() ?>" target="_self">
<?php $this->title() ?>
</a>
</div>
</div>
<!-- Post Title End -->
</div>
<!-- Show A Blue SVG as thumbnail -->
<?php elseif ($this->options->ThumbnailOption == '2'): ?>
<div class="mdui-card-media index-post-card-media" >
<!-- Post ThumbNail -->
<picture>
<img alt="Post Thumbnail" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJ5ZXMiPz4NCg0KPHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2ZXJzaW9uPSIxLjEiDQp4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KDQo8cmVjdCB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIxMDAwIiBmaWxsPSIjNjRCNUY2Ij4NCjwvcmVjdD4NCjwvc3ZnPg==" >
</picture>
<!-- Post Title Displays Above Bottom of ThumbNail -->
<div class="mdui-card-media-covered mdui-card-media-covered-gradient" >
<div class="mdui-card-primary mdui-typo" >
<a class="mdui-card-primary-title mdui-text-color-white" href="<?php $this->permalink() ?>" target="_self"><?php $this->title() ?></a>
</div>
</div>
<!-- Post Title END -->
</div>
<!-- Directly Show Random ThumbNail -->
<?php elseif ($this->options->ThumbnailOption == '3'): ?>
<div class="mdui-card-media index-post-card-media" >
<!--Post ThumbNail-->
<picture>
<source media="(min-width: 1024px)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php randomThumbnail($this); ?>" type="image/jpeg">
<img alt="ThumbNail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8+vXrfwAJpgPg8gE+iwAAAABJRU5ErkJggg==" data-src="<?php randomThumbnail($this); ?>" >
</picture>
<!-- Post Title Displays Above ThumbNail -->
<div class="mdui-card-media-covered mdui-card-media-covered-gradient" >
<div class="mdui-card-primary mdui-typo" >
<a class="mdui-card-primary-title mdui-text-color-white" href="<?php $this->permalink() ?>" target="_self"><?php $this->title() ?></a>
</div>
</div>
<!-- Post Title END -->
</div>
<?php endif; ?>
<!-- Post content BEGIN -->
<div class="mdui-card-content mdui-clearfix">
<!-- Control Output Length -->
<?php $this->excerpt(80, '...'); ?>
<!-- Show Additional parts -->
<span class="mdui-typo mdui-float-right" >
<a href="<?php $this->permalink(); ?>" target="_self">
<?php echo $MultiLang->get('Continue Reading'); ?>
</a>
</span>
</div>
<!--Post Content END-->
<div class="mdui-divider"></div>
<!-- Post info-->
<!-- Author avatar -->
<div class="mdui-card-header mdui-float-left" >
<?php if (!empty($this->options->avatarURL)): ?>
<img class="mdui-card-header-avatar" data-src="<?php $this->options->avatarURL() ?>" width="44px" height="44px" />
<?php else: ?>
<?php $this->author->gravatar(64,'X','https://i.loli.net/2018/06/10/5b1d11b5bed74.png',"mdui-card-header-avatar"); ?>
<?php endif; ?>
<!--Author Name-->
<span class="mdui-card-header-title mdui-typo"><a href="<?php $this->author->permalink(); ?>">
<?php $this->author(); ?></a>
</span>
<span class="mdui-card-header-subtitle" >
<?php if ($this->options->langis == '0'): ?>
<?php $this->date('F j, Y'); ?>
<?php else: ?>
<?php $this->dateWord(); ?>
<?php endif; ?>
</span>
<!--Row Of Subtitle End-->
</div>
<!--Md Card Header End-->
<!--Right Part Of Md Card Header(Under) -->
<div class="mdui-typo mdui-float-right index-post-card-header-rightinfo" style="color:<?php $this->options->alinkcolor(); ?>">
<div class="mdui-text-color-pink-accent" >
<?php $this->category(', '); ?>
<!-- Statistic of Views -->
<?php if (in_array('ViewCount',$this->options->FunctionSwitch)): ?>
<a href="<?php $this->permalink() ?>">
<?php echo '|'; ?>
<?php _e(getViewsStr($this)); ?>
</a>
<?php endif; ?>
</div>
</div>
<!--Right Part Of Md Card Header End-->
</div>
<!--Md Card Of Post End-->
</div>
</div>
<?php endwhile; ?>
<!--Post Md Cards Output End-->
</div>
<!-- Posts Output MD Container End-->
<!-- Echo Prev & After Page-->
<div class="mdui-container pjax-load" >
<nav class="">
<div class="mdui-col-xs-3 mdui-m-y-3">
<?php $this->pageLink(
'<div>
<button class="mdui-btn mdui-shadow-1 mdui-color-white mdui-ripple round-btn">
<i class="mdui-icon material-icons">arrow_back</i>
</button>
</div>'); ?>
</div>
<div style="line-height: 36px;" class="mdui-text-center mdui-col-xs-6 mdui-m-y-3">page
<?php if ($this->_currentPage>1) {
echo $this->_currentPage;
} else {
echo 1;
}?> of
<?php echo ceil($this->getTotal() / $this->parameter->pageSize); ?>
</div>
<div class="mdui-col-xs-3 mdui-m-y-3" >
<?php $this->pageLink(
'<div>
<button class="mdui-btn mdui-shadow-1 mdui-color-white mdui-ripple mdui-float-right round-btn">
<i class="mdui-icon material-icons">arrow_forward</i>
</button>
</div>', 'next'); ?>
</div>
</nav>
</div>
<!-- Echo Navigation Icon End-->
<?php $this->need('inc/sidebar.php'); ?>
<?php $this->need('inc/footer.php'); ?>