-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathload.php
33 lines (28 loc) · 2.01 KB
/
load.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
<?php
// Include must-have files for the site to work properly
require("core/config.php");
require("core/conn.php");
require("core/funky.php");
require("core/user.php");
require("core/custom.php");
// Debug mode
if (config("debug") == 1) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
} else {
error_reporting(0);
ini_set('display_errors', 0);
}
// Check if banned IP
$banned_ips = getBans();
if ((isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($_SERVER['HTTP_X_FORWARDED_FOR'], $banned_ips)) || (isset($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], $banned_ips)) || (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) && in_array($_SERVER["HTTP_CF_CONNECTING_IP"], $banned_ips))) die("You are banned because of abnormal behaviour (indicating you are maybe a Bot or someone with malicious intent). Please contact the administration if it's a bug.");
// Get all Cookies, etc
$usertheme = isset($_COOKIE[config("cookie") . "_theme"]) ? clean(mysqli_real_escape_string($conn, $_COOKIE[config("cookie") . "_theme"])) : config("default_theme");
$userlang = isset($_COOKIE[config("cookie") . "_lang"]) ? clean(mysqli_real_escape_string($conn, $_COOKIE[config("cookie") . "_lang"])) : config("default_language");
$userhistory = isset($_COOKIE[config("cookie") . "_history"]) ? explode(",", clean(mysqli_real_escape_string($conn, $_COOKIE[config("cookie") . "_history"]))) : array();
$userreadchapters = isset($_COOKIE[config("cookie") . "_readChapters"]) ? explode(",", clean(mysqli_real_escape_string($conn, $_COOKIE[config("cookie") . "_readChapters"]))) : array();
$readingmode = isset($_COOKIE[config("cookie") . "_readingMode"]) ? clean(mysqli_real_escape_string($conn, $_COOKIE[config("cookie") . "_readingMode"])) : config("default_readingmode");
// Include default files
require("languages/default/$userlang.def.php");
if (file_exists("languages/custom/$userlang.cus.php")) require("languages/custom/$userlang.cus.php");
if (file_exists("languages/custom/universal.php")) require("languages/custom/universal.php");