-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-controller.php
62 lines (48 loc) · 1.99 KB
/
page-controller.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
<?php
require_once __DIR__.'/../helper/functions.php';
$request_uri = $_SERVER['REQUEST_URI'];
$server_name = $_SERVER['SERVER_NAME'];
$base_url = base_url();
$base_url_length = strlen($base_url);
$url = substr($request_uri, $base_url_length);
$page_name = explode('/', $url)[0];
if ($_SERVER['REQUEST_URI'] == base_url()) {
$page_name = 'index';
}
if ($page_name == 'news-events' && isset(explode('/', $url)[1])) {
$wne_id = $_GET['wne_id'];
require_once __DIR__.'/../models/get_newsevents_details.php';
if (sizeof($news_events_details) > 0) {
$news_events_title = $news_events_details[0]['wne_title'];
$error_code = 0;
} else {
$news_events_title = 'Page not found';
$error_code = 404;
}
$page_title = [
$page_name => $news_events_title.' | News & Events | '.project_name(),
];
} else {
$page_title = [
// login and dashboard
'index' => project_name(),
'association-desk' => 'Association Desk - '.project_name(),
'about-us' => 'About Us - '.project_name(),
'objectives' => 'Objectives - '.project_name(),
// 'team' => 'Team - '.project_name(),
'gallery' => 'Gallery - '.project_name(),
'news-events' => 'New & Events - '.project_name(),
'contact' => 'Contact - '.project_name(),
'privacy-policy' => 'Privacy Policy - '.project_name(),
// BONG PAGES
'about-us-bong' => 'About Us - '.project_name(),
'objectives-bong' => 'Objectives - '.project_name(),
'association-desk-bong' => 'Association Desk - '.project_name(),
// error pages
'404' => 'Page Not Found',
];
}
// print_r($page_title);
if ( !array_key_exists($page_name, $page_title) ) {
$page_name = '404';
}