]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Tons of rewrites (SQL queries), surfbar nearly finished (working: surfing with static...
[mailer.git] / inc / modules / admin / admin-inc.php
index 0a5b93e134e771de3ff7a5fef891bdc4b539b293..7ef2e0aa551460bf65d5528565237463dca36aba 100644 (file)
@@ -666,17 +666,18 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
 }
 //
 function ADMIN_MAKE_MENU_SELECTION($menu, $type, $name, $default="") {
+       // Open the requested menu directory
+       $handle = opendir(sprintf("%sinc/modules/%s/", PATH, $menu)) or mxchange_die("Cannot load menu ".$menu."!");
+
        // Init the selection box
        $OUT = "<SELECT name=\"".$name."\" class=\"admin_select\" size=\"1\">\n <OPTION value=\"\">".IS_TOP_MENU."</OPTION>\n";
-
-       // Open the requested menu directory
-       $handle = opendir(PATH."inc/modules/".$menu."/") or mxchange_die("Cannot load menu ".$menu."!");
+       // Walk through all files
        while ($file = readdir($handle)) {
                // Is this a PHP script?
                if (($file != ".") && ($file != "..") && ($file != "lost+found") && (strpos($file, "".$type."-") > -1) && (strpos($file, ".php") > 0)) {
                        // Then test if the file is readable
-                       $test = PATH."inc/modules/".$menu."/".$file;
-                       if (is_readable($test)) {
+                       $test = sprintf("%sinc/modules/%s/%s", PATH, $menu, $file);
+                       if ((is_file($test)) && (is_readable($test))) {
                                // Extract the value for what=xxx
                                $part = substr($file, (strlen($type) + 1)); $part = substr($part, 0, strpos($part, ".php"));
 
@@ -685,9 +686,9 @@ function ADMIN_MAKE_MENU_SELECTION($menu, $type, $name, $default="") {
                                        $OUT .= "       <OPTION value=\"".$part."\"";
                                        if ($part == $default) $OUT .= "selected";
                                        $OUT .= ">".$part."</OPTION>\n";
-                               }
-                       }
-               }
+                               } // END - if
+                       } // END - if
+               } // END - if
        }
        closedir($handle);
        $OUT .= "</SELECT>\n";
@@ -756,7 +757,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
                        // Should always be 1 ;-)
                        if ($selected == 1) {
                                // Determine new status
-                               $result = SQL_QUERY_ESC("SELECT %s FROM "._MYSQL_PREFIX."_%s WHERE %s=%d LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT %s FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
                                        array($row, $table, $idRow, $id), __FILE__, __LINE__);
 
                                // Row found?
@@ -766,7 +767,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
                                        if ($currStatus == "Y") $newStatus='N'; else $newStatus = "Y";
 
                                        // Change this status
-                                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s SET %s='%s' WHERE %s=%d LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s SET %s='%s' WHERE %s=%s LIMIT 1",
                                                array($table, $row, $newStatus, $idRow, $id), __FILE__, __LINE__);
 
                                        // Count up affected rows