-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.php
43 lines (39 loc) · 968 Bytes
/
type.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
<?php
// Template for rendering the type/category pages
require "config.php";
require "utils.php";
$pluralLookup = [
"note" => "notes",
"reply" => "replies",
"like" => "likes",
"bookmark" => "bookmarks",
"repost" => "reposts"
];
?>
<!DOCTYPE html>
<html lang="<?= $site_language ?>">
<head>
<?php include "partials/head.php" ?>
<?php
if (isset($_GET['type'])) {
$type = $_GET['type'];
$typePlural = $pluralLookup[$type];
} else {
header("Location: /");
}
?>
<title><?= "All " . $typePlural . " — " . $site_title; ?></title>
</head>
<body>
<main>
<?php include "partials/header.php" ?>
<div class="warning">
You're viewing all <?= $typePlural ?>. <a href="/">Return to timeline</a>
</div>
<?php listPostsOfType($current_year, $type) ?>
</main>
<aside>
<?php include "partials/sidebar.php" ?>
</aside>
</body>
</html>