/
index.php
106 lines (96 loc) · 2.41 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
98
99
100
101
102
103
104
105
106
<?php include('config.php');
$stories = array(
"DEFAULT" => "chapter-one",
"chapter-one" => array(
"DEFAULT" => "a-battle-for-care",
"RELEASE" => "10/21/2013 12:00AM",
"a-battle-for-care" => array(
"file" => "inc/day1.story.php",
"title" => "A Battle for Care"
)
),
"chapter-two" => array(
"DEFAULT" => "looking-for-light",
"RELEASE" => "10/22/2013 12:00AM",
"looking-for-light" => array(
"file" => "inc/day2.story1.php",
"title" => "Looking for Light"
),
"turning-taboos-into-talking-points" => array(
"file" => "inc/day2.story2.php",
"title" => "Turning taboos into talking points"
)
),
"chapter-three" => array(
"DEFAULT" => "on-the-fringes",
"RELEASE" => "10/23/2013 12:00AM",
"on-the-fringes" => array(
"file" => "inc/day3.story1.php",
"title" => "On the Fringes"
),
"lesbians-left-out-of-activism" => array(
"file" => "inc/day3.story2.php",
"title" => "Lesbians left out of activism"
),
),
"columns" => array(
"DEFAULT" => "blaine-sonali",
"RELEASE" => "10/23/2013 12:00AM",
"blaine-sonali" => array(
"file" => "inc/columns.php",
"title" => "Columns"
)
),
"photos" => array(
"DEFAULT" => "revealing-voices",
"RELEASE" => "10/21/2013 12:00AM",
"revealing-voices" => array(
"file" => "inc/photos.profiles.php",
"title" => "Revealing Voices"
)
),
);
$cur_part = "";
$cur_story = "";
// Set the part
if(isset($_GET['part']) && !isset($stories[$_GET['part']]))
{
send_404();
}
else if (!isset($_GET['part']))
{
$cur_part = $stories["DEFAULT"];
}
else
{
$cur_part = $_GET['part'];
}
// Set the story
if(isset($_GET['story']) && !isset($stories[$cur_part][$_GET['story']]))
{
send_404();
}
else if (!isset($_GET['story']))
{
$cur_story = $stories[$cur_part]["DEFAULT"];
}
else
{
$cur_story = $_GET['story'];
}
// If the part isn't available, serve a 404
if(time() < strtotime($stories[$cur_part]["RELEASE"]) && !DEBUG)
{
send_404();
}
// Figure out the canonical URL for SEO
$canonical_url = SITE_URL.$cur_part."/".$cur_story."/";
if($cur_part == $stories["DEFAULT"] && $cur_story == $stories[$stories["DEFAULT"]]["DEFAULT"])
{
$canonical_url = SITE_URL;
}
$curtitle = $stories[$cur_part][$cur_story]['title'];
// Render the page
include('inc/header.php');
include($stories[$cur_part][$cur_story]['file']);
include('inc/footer.php'); ?>