-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
151 lines (141 loc) · 3.84 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
// Include router class
include('Route.php');
Route::add('/',function(){
$titel = 'FS-Quiz - Home';
$pagename = 'home';
require('content/home.php');
});
Route::add('/privacy',function(){
$titel = 'FS-Quiz - Privacy';
$pagename = 'about';
require('content/privacy.php');
});
Route::add('/legal-notice',function(){
$titel = 'FS-Quiz - Legal notice';
$pagename = 'about';
require('content/legal-notice.php');
});
Route::add('/contact',function(){
$titel = 'FS-Quiz - Contact';
$pagename = 'about';
require('content/contact.php');
});
//favicon
Route::add('/favicon.ico',function(){
header('Content-Type: image/jpeg');
readfile('img/icons/favicon/favicon.ico');
exit;
});
Route::add('/(android-icon-(36|48|72|96|144|192)x(36|48|72|96|144|192)\.png$)',function($favLink){
header('Content-Type: image/jpeg');
readfile('img/icons/favicon/'.$favLink);
exit;
});
Route::add('/(apple-touch-icon(-(57|60|72|76|114|120|144|152|180)x(57|60|72|76|114|120|144|152|180))?(-precomposed)?\.png$)',function($favLink){
header('Content-Type: image/jpeg');
readfile('img/icons/favicon/'.$favLink);
exit;
});
Route::add('/home',function(){
$titel = 'FS-Quiz - Home';
$pagename = 'home';
require('content/home.php');
});
Route::add('/quizzes',function(){
$titel = 'FS-Quiz - Quizzes';
$pagename = 'quizzes';
require('content/quizzes.php');
});
Route::add('/quizzesNew',function(){
$titel = 'FS-Quiz - Quizzes';
$pagename = 'quizzes';
require('content/search/question2.php');
});
Route::add('/search',function(){
$titel = 'FS-Quiz - Search';
$pagename = 'search';
require('content/search.php');
});
Route::add('/advent',function(){
$titel = 'FS-Quiz - Advent Calendar';
$pagename = 'advent';
require('content/advent.php');
});
Route::add('/about',function(){
$titel = 'FS-Quiz - About';
$pagename = 'about';
require('content/about.php');
});
Route::add('/faq',function(){
$titel = 'FS-Quiz - FAQ';
$pagename = 'faq';
require('content/faq.php');
});
Route::add('/changelog',function(){
$titel = 'FS-Quiz - Changelog';
$pagename = 'about';
require('content/changelog.php');
});
Route::add('/quiz/([0-9]*)', function($quiz_id) {
$titel = 'FS-Quiz - Quiz';
$pagename = 'quizzes';
require('content/quiz.php');
}, 'get');
Route::add('/statistics',function(){
$titel = 'FS-Quiz - Statistics';
$pagename = 'home';
require('content/statistics.php');
});
//documents
Route::add('/search/documents/([0-9]*)', function($event) {
$titel = 'FS-Quiz - Documents';
$pagename = 'search';
require('content/search/documents.php');
}, 'get');
Route::add('/search/documents/([0-9]*)/([0-9]*)', function($event,$year) {
$titel = 'FS-Quiz - Documents';
$pagename = 'search';
require('content/search/documents.php');
}, 'get');
Route::add('/search/documents/([0-9]*)/([0-9]*)/([a-z]*)', function($event,$year,$type) {
$titel = 'FS-Quiz - Documents';
$pagename = 'search';
require('content/search/documents.php');
}, 'get');
Route::add('/search/documents', function() {
$titel = 'FS-Quiz - Documents';
$pagename = 'search';
require('content/search/documents.php');
});
//questions
Route::add('/search/questions', function() {
$titel = 'FS-Quiz - Questions';
$pagename = 'search';
require('content/search/question.php');
});
Route::add('/question/([0-9]*)', function($question_id) {
$titel = 'FS-Quiz - Question';
$pagename = 'search';
require('content/question.php');
});
Route::add('/bremergy/([0-9]*)', function($num) {
require('bremergy/gruppe.php');
}, 'get');
Route::add('/master/admin',function(){
$titel = 'FS-Quiz - Home';
$pagename = 'home';
require('bremergy/admin.php');
});
// Add base route (startpage)
Route::add('/api',function(){
header("Location: http://api.fs-quiz.eu");
exit();
});
Route::pathNotFound(function($path) {
$titel = 'FS-Quiz - 404';
$pagename = '404';
require('content/404.php');
});
Route::run('/');
?>