All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
[mailer.git] / inc / modules / admin / what-theme_import.php
index d8ab90b5c82cd0871ac3e16754cf609c56638bb9..9dbff1f165fde7e3f9d150e033bb13dbb5858844 100644 (file)
@@ -51,10 +51,10 @@ if (!empty($_POST['theme'])) {
        // Check if theme is there
        if (!THEME_CHECK_EXIST($_POST['theme'])) {
                // Import theme
-               $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme']));
-               if (FILE_READABLE($file)) {
+               $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($_POST['theme']));
+               if (FILE_READABLE($INC)) {
                        // Load the theme header file
-                       require($file);
+                       LOAD_INC($INC);
 
                        // Register it ith the exchange
                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)
@@ -94,12 +94,12 @@ $THEMES = array(
 $handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
 while ($dir = readdir($handle)) {
        // Construct absolute theme.php file name
-       $theme = sprintf("%stheme/%s/theme.php", PATH, $dir);
+       $INC = sprintf("theme/%s/theme.php", $dir);
 
        // Test it...
-       if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme))) {
+       if (($dir != ".") && ($dir != "..") && (FILE_READABLE($INC))) {
                // Found a valid directory so let's load it's theme.php file
-               require($theme);
+               LOAD_INC($INC);
 
                // Add found theme to array
                $THEMES['theme_unix'][]   = $dir;