forked from MatthiasApsel/Advent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (44 loc) · 1.24 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
<?php
require ('data.php');
$year = 2024;
$title = 'Adventskalender '.$year;
$now = time();
$today = date("j");
$listitems = [];
for ($k = 1; $k <= sizeof($data); $k++) :
$allowed = mktime(0,0,0,12,$k,$year);
if ($now > $allowed) :
$listitems[] = '
<a href="'.$data[$k]['href'].'">
<h2>'.$data[$k]['heading'].'</h2>
<p>'.$data[$k]['author'].'</p>
<p>'.$data[$k]['teaser'].'</p>
</a>';
elseif ($k == $today + 1 || $k == 24) :
$listitems[] = '
<a class="donate" href="'.$donate['href'].'">
<h2>'.$donate['heading'].'</h2>
<p>'.$donate['text'].'</p>
</a>';
else :
$listitems[] = '<a class="coming_soon">'.str_replace('##date##',$k,$default).'</a>';
endif;
endfor; ?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?=$title?></title>
<style><?php include('css.php') ?></style>
<script><?php include('js.php') ?></script>
</head>
<body>
<h1><a href="https://advent.radelei.de"><?=$title?></a></h1>
<ol> <?php
for ($k = 0; $k < sizeof($listitems); $k++) : ?>
<li><?=$listitems[$k]?></li> <?php
endfor ?>
</ol>
</body>
</html>