-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
97 lines (73 loc) · 3.73 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
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/global.inc.php');
include($rootDir.'/db.inc.php');
$pageTitle = 'Home';
$errorMsg = null;
$errorMsgType = 'red';
$results = getAllPosts($connection);
//$results = null;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="<?= $rootAssetUrl ?>images/logo.png">
<title><?= $pageTitle ?> - <?= $blogTitle ?></title>
<meta name="description" content="<?= $blogDesc ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Styles -->
<link rel="stylesheet" href="<?= $rootAssetUrl ?>css/default.css"/>
<link rel="stylesheet" href="<?= $rootAssetUrl ?>css/global.css"/>
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Reenie+Beanie&text=The%20Flolon%20Blog&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Icons&family=Roboto&family=Roboto+Slab:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/fork-awesome.min.css"/>
</head>
<body>
<div class="pageHeight">
<div class="top hero">
<?php include($rootDir.'/navbar.inc.php'); ?>
<a class="noUnderline center logo white-text" href="https://flolon.cc"><h1><?= $blogTitle ?></h1></a>
</div>
<div class="container" style="margin-top: 2rem;">
<?php
if($results[0] == null) {
echo '<div class="card error light">No posts yet</div>';
}else {
foreach ($results as $row) {
?>
<a class="post-card" href="./post/?id=<?= escape($row['slug']) ?>" tabindex="0">
<div class="card">
<h2 class="title"><?= escape($row['title']) ?></h2>
<div class="sub inline">
<span class="date">
<span class="material-icons icon">calendar_today</span><span><?= formatDate($row['date']) ?></span>
</span>
<?php if($row['tags'] !== '' && $row['tags'] !== null) { ?>
<span class="spacer"> • </span>
<!-- <span class="username">
<span class="material-icons icon">account_circle</span><span><?= escape($row['username']) ?></span>
</span>
<span class="spacer"> • </span> -->
<span class="tags">
<?php
$tags = explode( ', ', $row['tags']);
foreach ($tags as $tag) {
echo '<span class="tag dark">'. escape($tag) .'</span>';
}
?>
</span>
<?php } ?>
</div>
</div>
</a>
<?php
}
}
?>
</div><!-- /container -->
</div><!-- /pageHeight -->
<?php include($rootDir.'/footer.inc.php'); ?>
</body>
</html>