blob: 62a076d7d91bdbd173b5e7ffb831dc3179b699c4 (
plain)
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
|
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/header.php"; ?>
<div class="container" style="margin-top:30px;text-align: center;">
<h2>Welcome to Blogchain!</h2>
<p>If you want a blog that talks about unknown technology and whose authors do weird experiments with tech stuff, you've come to the right place!</p>
</div>
<?php $list = getArticlesList() ?>
<div class="container">
<div class="card-deck">
<?php $index = 0;foreach ($list as $id => $item): ?>
<?php if ($index < 3): ?>
<div class="card">
<div class="card-body">
<h2><?= $item["title"] ?></h2>
<p><?= $item["content"]["mini"] ?></p>
<a class="btn btn-primary" href="/article/<?= $item["id"] ?>">Read more</a>
<span style="margin-top: 10px;display:block;"><small><?php
$dt = DateTime::createFromFormat('Ymd', $item["date"]);
echo($dt->format("M jS, Y"));
?> · by <?= implode(" and ", $item["author"]) ?></small></span>
</div>
</div>
<?php endif; ?>
<?php $index++;endforeach; ?>
</div>
<?php if (count($list) > 3): ?>
<h3 style="margin-top:20px;">Also check out our older articles:</h3>
<div class="list-group">
<?php $index = 0;foreach ($list as $id => $item): ?>
<?php if ($index >= 3 && $index < 100): ?>
<a href="/article/<?= $item["id"] ?>" class="list-group-item list-group-item-action"><?= $item["title"] ?></a>
<?php endif; ?>
<?php $index++;endforeach; ?>
</div>
<?php if (count($list) > 100): ?>
<p>Wait! There's more! Our older articles aren't listed here to save you some bytes of data. You can get to the complete list <a href="/articles" style="text-decoration: underline;">here</a>.</p>
<?php endif; ?>
<?php endif; ?>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/footer.php"; ?>
|