Заготовка AJAX файла
Автор темы: Sander, 10 марта 2017г
• Sander
Отправлено: 10 март 2017, 11:43:30
Путь по умолчанию /engine/mods/{modName}/file.php<?php
@error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
@ini_set('error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define('ROOT_DIR', __DIR__ . '/../../..');
define('ENGINE_DIR', ROOT_DIR . '/engine');
if (file_exists(ENGINE_DIR . '/classes/plugins.class.php')) {
include_once ENGINE_DIR . '/classes/plugins.class.php';
} else {
@ini_set('pcre.recursion_limit', 10000000 );
@ini_set('pcre.backtrack_limit', 10000000 );
@ini_set('pcre.jit', false);
@include_once (ENGINE_DIR . '/data/config.php');
require_once (ENGINE_DIR . '/classes/mysql.php');
require_once (ENGINE_DIR . '/data/dbconfig.php');
abstract class DLEPlugins {
public static function Check($source = '') {
return $source;
}
}
}
include_once (DLEPlugins::Check(ENGINE_DIR . '/modules/functions.php'));
dle_session();
if ($_REQUEST['dle_skin']) {
$_REQUEST['dle_skin'] = totranslit($_REQUEST['dle_skin'], false, false);
if ($_REQUEST['dle_skin'] && is_dir( ROOT_DIR . '/templates/' . $_REQUEST['dle_skin'])) {
$config['skin'] = $_REQUEST['dle_skin'];
}
} elseif ($_COOKIE['dle_skin']) {
$_COOKIE['dle_skin'] = totranslit((string)$_COOKIE['dle_skin'], false, false);
if ($_COOKIE['dle_skin'] && is_dir(ROOT_DIR . '/templates/' . $_COOKIE['dle_skin'])) {
$config['skin'] = $_COOKIE['dle_skin'];
}
}
if ($config["lang_" . $config['skin']] && file_exists(DLEPlugins::Check(ROOT_DIR . '/language/' . $config["lang_" . $config['skin']] . '/website.lng'))) {
include_once (DLEPlugins::Check(ROOT_DIR . '/language/' . $config["lang_" . $config['skin']] . '/website.lng'));
} else {
include_once (DLEPlugins::Check(ROOT_DIR . '/language/' . $config['langs'] . '/website.lng'));
}
@header("Content-type: text/html; charset=" . $config['charset']);
setlocale(LC_NUMERIC, "C");
require_once ENGINE_DIR . '/modules/sitelogin.php';
if (!$is_logged) {
$member_id['user_group'] = 5;
}
/* Код файла */
/*
// JSON
$html = json_encode($html, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
echo $html;
*/