-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
30 lines (25 loc) · 1.13 KB
/
index.php
File metadata and controls
30 lines (25 loc) · 1.13 KB
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
<?php
$Json = file_get_contents('./wordingUtils/en.json');
$enJson = json_decode($Json, true);
// Prevent the user from going on non-existing pages
session_start();
$page_title = 'Unknown page?';
$existing_pages = ['Home', 'Explorer', 'Subscriptions', 'Library', 'History', 'LikedVideo', 'WatchLater', 'Profile', 'Register', 'Login', 'Channel_page', 'Upload', 'SearchPage', 'SearchPage', 'Watch', '404'];
$homeBar = $_GET['name'];
if (empty($_GET['name']) == false) {
if (in_array($_GET['name'], $existing_pages)) {
$pageName = $_GET['name'];
} else {
$pageName = "404";
header('Location: index.php?name=404');
}
} else {
header('Location: index.php?name=Home');
}
include __DIR__ . '/front-end/views/pages/upload.php'; //$channelVideoUpload
include __DIR__ . '/front-end/views/pages/channel.php';
include __DIR__ . '/front-end/views/components/FilterBar.php'; // $filterbar
include __DIR__ . '/front-end/views/pages/' . $pageName . '.php'; // $page
include __DIR__ . "/front-end/partials/Menu.php"; // $menu
include __DIR__ . "/front-end/partials/NavBar.php"; // $navBar
require_once './template.php';