-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.php
315 lines (246 loc) · 12.8 KB
/
category.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
<?php
require 'assets/lib/Parsedown.php'; $tmp = 1;
$listCategory = $_GET["category"];
$id = $_GET["id"];
$data = json_decode(file_get_contents("data.json"));
$dataArray = json_decode(file_get_contents("data.json"), TRUE);
$NumberOfPost = count($dataArray['PostValue']) - 1;
$SiteUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
//Get Author Data
$AuthorName = $data -> Author -> Name;
$AuthorDesc = $data -> Author -> Description;
$AuthorBio = $data -> Author -> Bio;
$AuthorFB = $data -> Author -> Facebook;
$AuthorIG = $data -> Author -> Instagram;
$AuthorTW = $data -> Author -> Twitter;
?>
<!doctype html>
<html lang="en" class="minimal-style is-menu-fixed is-always-fixed is-selection-shareable blog-animated header-light header-small" data-effect="slideUp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="All post with category: <?php echo $listCategory; ?>">
<meta name="keywords" content="personal, blog, html5">
<meta name="author" content="HoangLe">
<title>Category:: <?php echo $listCategory; ?></title>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/fonts/fontello/css/fontello.css">
<link rel="stylesheet" type="text/css" href="assets/js/jquery.magnific-popup/magnific-popup.css">
<link rel="stylesheet" type="text/css" href="assets/js/jquery.fluidbox/fluidbox.css">
<link rel="stylesheet" type="text/css" href="assets/js/owl-carousel/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="assets/js/selection-sharer/selection-sharer.css">
<link rel="stylesheet" type="text/css" href="assets/css/rotate-words.css">
<link rel="stylesheet" type="text/css" href="assets/css/align.css">
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
<link rel="stylesheet" type="text/css" href="assets/js/shortcodes/shortcodes.css">
<link rel="stylesheet" type="text/css" href="assets/css/768.css">
<link rel="stylesheet" type="text/css" href="assets/css/992.css">
<script src="assets/js/modernizr.min.js"></script>
</head>
<body class=" single ">
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
<div class="layout-medium">
<h1 class="site-title">
<a href="/" rel="home">
<img src="assets/images/site/logo.png" alt="logo">
<span class="screen-reader-text"><?php echo $data->SiteTitle; ?></span>
</a>
</h1>
<a class="menu-toggle"><span class="lines"></span></a>
<!-- nav-menu -->
<div class="nav-menu">
<ul>
<li><a href="/">HOME</a>
</ul>
</div>
<a class="search-toggle toggle-link"></a>
<div class="search-container">
<div class="search-box" role="search">
<form method="get" class="search-form" action="#">
<label>Search Here
<input type="search" id="search-field" placeholder="type and hit enter" name="s">
</label>
<input type="submit" class="search-submit" value="Search">
</form>
</div>
</div>
<div class="social-container">
<a class="social-link facebook" href="<?php echo $AuthorFB;?>"></a>
<a class="social-link twitter" href="<?php echo $AuthorTW;?>"></a>
<a class="social-link vine" href="#"></a>
<a class="social-link dribbble" href="#"></a>
<a class="social-link instagram" href="<?php echo $AuthorIG;?>"></a>
</div>
</div>
</nav>
</header>
<!-- header -->
<!-- site-main -->
<div id="main" class="site-main">
<div class="layout-medium">
<div id="primary" class="content-area with-sidebar">
<!-- site-content -->
<div id="content" class="site-content" role="main">
<header class="entry-header">
<h1 class="entry-title"><i>Posts in</i> <span class="cat-title"><?php echo $listCategory; ?></span></h1>
<!--<h1 class="entry-title"><i>Posts tagged</i> <span class="cat-title">typography</span></h1>-->
<!--<h1 class="entry-title"><i>Posts by</i> <span class="cat-title">Jeff Winger</span></h1>-->
<!--<h1 class="entry-title"><i>searched for :</i> <span class="cat-title">summertime</span></h1>-->
</header>
<!-- BLOG LIST -->
<div class="blog-list blog-stream">
<?php
//Get Post Data
for ($x = 0; $x <= $NumberOfPost; $x++) {
if ($listCategory == $data -> PostValue["$x"] -> PostCategory){
$postID = $data -> PostValue["$x"] -> PostID;
$postKey = $postID -1;
$PostTitle = $data->PostValue["$x"]->PostTitle;
$PostDate = date('Y-M-d H:i:s',$data -> PostValue["$x"] -> PostDate);
$PostPath = $data->PostValue["$x"]->PostFilePath;
$PostImg = $data->PostValue["$x"]->PostImgPath;
$PostDescription = $data->PostValue["$x"]->PostDescription;
$PostCategory = $data->PostValue["$x"]->PostCategory;
echo '<article class="hentry post has-post-thumbnail">
<div class="featured-image">
<a href="post.php?id='. $postID .'" title="'. $PostTitle .'"><img src="' . $PostImg . '" alt="blog-image"></a>
</div>
<div class="hentry-middle">
<header class="entry-header">
<div class="entry-meta">
<span class="cat-links">
<a href="category.php?category=' .$PostCategory. '" title="View all posts in ' . $PostCategory .'" rel="category tag">' . $PostCategory . '</a>
</span>
<span class="entry-date">
<time class="entry-date">' . $PostDate .'</time>
</span>
</div>
<h2 class="entry-title"><a href="post.php?id='. $postID .'" title="'. $PostTitle .'">'. $PostTitle .'</a></h2>
</header>
<div class="entry-content">
<p>'. $PostDescription .'
<span class="more">
<a href="post.php?id='. $postID .'" class="more-link">Read More</a>
</span>
</p>
</div>
</div>
</article>';
$tmp = 0;
} else if ($tmp == 1) {
$tmp = 0;
echo ' <article class="hentry post has-post-thumbnail">
<div class="hentry-middle">
<header class="entry-header">
<h2 class="entry-title"><a href="#" title="NotFound">No Post Found :<</a></h2>
</header>
</div>
</article>';
}
}
?>
</div>
<!-- BLOG LIST -->
</div>
<!-- site-content -->
</div>
<!-- primary -->
<!-- #secondary -->
<div id="secondary" class="widget-area sidebar" role="complementary">
<!-- widget : text -->
<aside class="widget widget_text">
<h3 class="widget-title">About Me</h3>
<div class="textwidget">
<p><img src="assets/images/blog/author.jpg" alt="avatar"></p>
<p><?php echo $AuthorDesc;?>.</p>
</div>
</aside>
<!-- widget : text -->
<!-- widget : text -->
<aside class="widget widget_text">
<h3 class="widget-title">Follow Me</h3>
<div class="textwidget">
<p>
<a class="social-link facebook" href="<?php echo $AuthorFB;?>"></a>
<a class="social-link twitter" href="<?php echo $AuthorTW;?>"></a>
<a class="social-link vine" href="#"></a>
<a class="social-link dribbble" href="#"></a>
<a class="social-link instagram" href="<?php echo $AuthorIG;?>"></a>
</p>
</div>
</aside>
<!-- widget : text -->
</div>
<!-- #secondary -->
</div>
<!-- layout -->
</div>
<!-- site-main -->
<!-- site-footer -->
<footer id="colophon" class="site-footer" role="contentinfo">
<!-- layout-medium -->
<div class="layout-medium">
<!-- site-title-wrap -->
<div class="site-title-wrap">
<h1 class="site-title">
<a href="/" rel="home">
<img src="assets/images/site/logo.png" alt="logo">
</a>
</h1>
<!-- site-title -->
<p class="site-description"><?php echo $AuthorBio;?></p>
</div>
<!-- site-title-wrap -->
<!-- footer-social -->
<div class="footer-social">
<div class="textwidget">
<a class="social-link facebook" href="<?php echo $AuthorFB;?>"></a>
<a class="social-link twitter" href="<?php echo $AuthorTW;?>"></a>
<a class="social-link vine" href="#"></a>
<a class="social-link dribbble" href="#"></a>
<a class="social-link instagram" href="<?php echo $AuthorIG;?>"></a>
</div>
</div>
<!-- footer-social -->
</div>
<!-- layout-medium -->
<!-- .site-info -->
<div class="site-info">
<!-- layout-medium -->
<div class="layout-medium">
<div class="textwidget">crafted with <i class="pw-icon-heart"></i> <em>by</em> HZV</div>
</div>
<!-- layout-medium -->
</div>
<!-- .site-info -->
</footer>
<!-- site-footer -->
</div>
<!-- page -->
<!-- SCRIPTS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
if (!window.jQuery) {
document.write('<script src="assets/js/jquery-3.1.1.min.js"><\/script>');
}
</script>
<script src="assets/js/jquery-migrate-3.0.0.min.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.fitvids.js"></script>
<script src="assets/js/jquery.viewport.mini.js"></script>
<script src="assets/js/jquery.waypoints.min.js"></script>
<script src="assets/js/jquery-validation/jquery.validate.min.js"></script>
<script src="assets/js/imagesloaded.pkgd.min.js"></script>
<script src="assets/js/jquery.isotope.min.js"></script>
<script src="assets/js/jquery.magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="assets/js/jquery.fluidbox/jquery.fluidbox.min.js"></script>
<script src="assets/js/owl-carousel/owl.carousel.min.js"></script>
<script src="assets/js/selection-sharer/selection-sharer.js"></script>
<script src="assets/js/socialstream.jquery.js"></script>
<script src="assets/js/jquery.collagePlus/jquery.collagePlus.min.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/shortcodes/shortcodes.js"></script>
</body>
</html>