This repository has been archived by the owner on Mar 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
76 lines (62 loc) · 2.08 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
<?php
require 'flight/Flight.php';
require 'language/language.php';
require 'control/global.php';
require 'control/Trakt.php';
require 'control/TMDB.php';
require 'control/FanArt.php';
require 'views/error.php';
// Variables
Flight::set('flight.views.path', './views');
// Routes
Flight::route('/', function () {
Flight::render('home');
});
Flight::route('/@user/@view/@type', function ($user, $view, $type) {
$query = Flight::request()->query;
header('Cache-Control: no-cache');
header('Content-type: image/svg+xml');
if (!$user || !$view || !$type) {
error("MISSING_INFORMATION", 720, 480); }
$lang = isset($query['language']) ? $query['language'] : "en";
$trakt = new Trakt($user, "CLIENT_ID");
$tmdb = new TMDB("API_KEY");
$fanart = new FanArt("API_KEY");
if ($type == "poster" && $view == "profile") { // Poster Profile
require 'views/poster_profile.php';
}
elseif ($type == "poster" && $view == "watched") { // Poster Watched
require 'views/poster_watched.php';
}
elseif ($type == "poster" && $view == "watching") { // Poster Watching
require 'views/poster_watching.php';
}
elseif ($type == "card" && $view == "watched") { // Card Watched
require 'views/card_watched.php';
}
elseif ($type == "card" && $view == "watching") { // Card Watching
require 'views/card_watching.php';
}
elseif ($type == "banner" && $view == "watched") { // Banner Watched
require 'views/banner_watched.php';
}
elseif ($type == "banner" && $view == "watching") { // Banner Watching
require 'views/banner_watching.php';
}
elseif ($type == "fanart" && $view == "watched") { // FanArt Watched
require 'views/fanart_watched.php';
}
elseif ($type == "fanart" && $view == "watching") { // FanArt Watching
require 'views/fanart_watching.php';
}
elseif ($type == "text" && $view == "watched") { // Text Watched
require 'views/text_watched.php';
}
elseif ($type == "text" && $view == "watching") { // Text Watching
require 'views/text_watching.php';
}
else {
error("UNDEFINED_VIEW_TYPE", 720, 480);
}
});
Flight::start();