setSafeMode(true); // HTML-Purifier require_once ps(__DIR__ . $config["path"]["htmlpurifier"] . "/HTMLPurifier.auto.php"); $purifier = new HTMLPurifier(HTMLPurifier_Config::createDefault()); // PHPMailer use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require_once ps(__DIR__ . $config["path"]["phpmailer"] . "/Exception.php"); require_once ps(__DIR__ . $config["path"]["phpmailer"] . "/PHPMailer.php"); require_once ps(__DIR__ . $config["path"]["phpmailer"] . "/SMTP.php"); $mailer = new PHPMailer(true); // Smarty require_once ps(__DIR__ . $config["path"]["smarty"] . "/Smarty.class.php"); $smarty = new Smarty(); $smarty->setTemplateDir(ps(__DIR__ . $config["smarty"]["template"] . "/" . $usertheme)); $smarty->setConfigDir(ps(__DIR__ . $config["smarty"]["config"])); $smarty->setCompileDir(ps(__DIR__ . $config["smarty"]["compile"])); $smarty->setCacheDir(ps(__DIR__ . $config["smarty"]["cache"])); // Getting all plugins for the Theme require ps(__DIR__ . $config["smarty"]["template"] . "/{$usertheme}/info.php"); foreach ($theme["plugins"] as $reqPlugin) { if (!file_exists(ps(__DIR__ . $config["path"]["plugins"] . "/" . $reqPlugin . ".php"))) die("This theme requires following plugin: " . $reqPlugin); require_once ps(__DIR__ . $config["path"]["plugins"] . "/" . $reqPlugin . ".php"); } // Plugins (Legacy) // $plugins = glob(ps(__DIR__ . $config["path"]["plugins"] . "/enabled/*.php")); // foreach ($plugins as $plugin) { // require_once $plugin; // } // And finally $usertheme = getUserTheme($logged, $user["theme"] ?? ""); $userlang = getUserLang($logged, $user["lang"] ?? ""); $preflang = getPrefLang(); require ps(__DIR__ . $config["smarty"]["template"] . "/{$usertheme}/info.php"); require ps(__DIR__ . $config["path"]["langs"] . "/{$userlang}.php"); visit(); $smarty->assign("config", $config); $smarty->assign("lang", $lang); $smarty->assign("theme", $theme); $smarty->assign("userlang", $userlang); $smarty->assign("usertheme", $usertheme); $smarty->assign("version", file_get_contents(ps(__DIR__ . "/version.txt"))); $smarty->assign("logged", $logged); $smarty->assign("user", $user); $smarty->assign("preflang", $preflang);