1
0
Fork 0
template/site-settings.php
2024-04-28 14:31:08 +02:00

51 lines
1.4 KiB
PHP
Executable file

<?php session_start();
require_once 'site-config.php';
ini_set('display_errors', ($debugging == false ? 0 : 1));
ini_set('display_startup_errors', ($debugging == false ? 0 : 1));
error_reporting(E_ALL);
date_default_timezone_set($config_timezone);
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI'];
$is_local = (($host == 'localhost' OR strpos($host, '192.168') !== false) ? true : false);
$filename = basename($_SERVER['PHP_SELF']);
$filename_get = (!empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null);
$google = ['notranslate','nositelinkssearchb'];
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
$dir_files = $config_root.'/files/'.$config_folder;
$dir_css = 'css';
$dir_functions = 'functions';
$dir_images = 'images';
$dir_js = 'js';
$dir_languages = 'languages';
if(file_exists('vendor/autoload.php')) {
require_once 'vendor/autoload.php';
$Parsedown = new Parsedown();
}
require_once 'site-functions.php';
require_once 'languages/'.(isset($_GET['lang']) ? safetag($_GET['lang']) : 'se').'.php';
if(!empty($database_host) AND !empty($database_name) AND !empty($database_user) AND !empty($database_pass)) {
try {
$sql = new PDO('mysql:host='.$database_host.';dbname='.$database_name, $database_user, $database_pass);
$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e) {
echo $e;
exit;
}
}
?>