-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
35 lines (27 loc) · 971 Bytes
/
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
<?php
error_reporting(-1);
ini_set('display_errors',1);
header('Content-Type: text/html; charset=utf-8');
session_start();
// Конфиг сайта
include_once './config.php';
include_once './libs/default.php';
$db = mysqli_connect(Core::$DB_LOCAL,Core::$DB_LOGIN,Core::$DB_PASS,Core::$DB_NAME);
mysqli_set_charset($db,'utf8');
include_once './variables.php';
// Роутер
ob_start();
include './'.Core::$CONT.'/allpages.php';
if (!file_exists('./'.Core::$CONT.'/'.$_GET['module'].'/'.$_GET['page'].'.php') || !file_exists('./skins/'.Core::$SKIN.'/'.$_GET['module'].'/'.$_GET['page'].'.tpl')) {
header("Location: /404");
exit();
}
include './'.Core::$CONT.'/'.$_GET['module'].'/'.$_GET['page'].'.php';
include './skins/'.Core::$SKIN.'/'.$_GET['module'].'/'.$_GET['page'].'.tpl';
$content = ob_get_contents();
ob_end_clean();
if (isset($_GET['ajax'])) {
echo $content;
exit;
}
include './skins/'.Core::$SKIN.'/index.tpl';