]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Now CSS classes are being inserted by EL
[mailer.git] / inc / mysql-manager.php
index afd2f1caab172368b776823d70d96b759c5d6298..e0f783715494dc0af63df3f176d6c82a936926f4 100644 (file)
@@ -406,7 +406,15 @@ function addMenu ($mode, $action, $what) {
        } // END - if
 
        // Load SQL data and add the menu to the output stream...
-       $result_main = SQL_QUERY_ESC("SELECT `title`, `action`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$ADD." ORDER BY `sort` ASC",
+       $result_main = SQL_QUERY_ESC("SELECT
+       `title`, `what`, `action`, `visible`, `locked`
+FROM
+       `{?_MYSQL_PREFIX?}_%s_menu`
+WHERE
+       (`what`='' OR `what` IS NULL)
+       ".$ADD."
+ORDER BY
+       `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
 
        //* DEBUG: */ print(__LINE__.'/'.$main_cnt.':'.getWhat()."*<br />");
@@ -414,16 +422,28 @@ function addMenu ($mode, $action, $what) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
-                       //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].':'.getWhat()."*<br />");
+                       //* DEBUG: */ print(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*<br />');
                        // Init/"translate" variables
                        enableBlockMode(false);
-                       $content = translateMenuVisibleLocked($content);
 
                        // Load menu header template
                        $GLOBALS['rows'] .= loadTemplate($mode . '_menu_title', true, $content);
 
                        // Sub menu
-                       $result_sub = SQL_QUERY_ESC("SELECT `title` AS sub_title, `what` AS sub_what, `visible` AS sub_visible, `locked` AS sub_locked FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$ADD." ORDER BY `sort` ASC",
+                       $result_sub = SQL_QUERY_ESC("SELECT
+       `title` AS `sub_title`,
+       `what` AS `sub_what`,
+       `visible` AS `sub_visible`,
+       `locked` AS `sub_locked`
+FROM
+       `{?_MYSQL_PREFIX?}_%s_menu`
+WHERE
+       `action`='%s' AND
+       `what` != '' AND
+       `what` IS NOT NULL
+       ".$ADD."
+ORDER BY
+       `sort` ASC",
                                array($mode, $content['action']), __FUNCTION__, __LINE__);
 
                        // Do we have some entries?
@@ -436,9 +456,6 @@ function addMenu ($mode, $action, $what) {
                                        // Merge both arrays in one
                                        $content = merge_array($content, $content2);
 
-                                       // Translate visible/locked again
-                                       $content = translateMenuVisibleLocked($content, 'sub_');
-
                                        // Init content
                                        $OUT = '';
 
@@ -477,11 +494,11 @@ function addMenu ($mode, $action, $what) {
                                        $cnt++;
 
                                        // Rewrite array
-                                       $content =  array(
-                                               'menu'        => $OUT,
-                                               'what'        => $content['sub_what'],
-                                               'visible_css' => $content['sub_visible_css'],
-                                               'locked_css'  => $content['sub_locked_css']
+                                       $content = array(
+                                               'menu'    => $OUT,
+                                               'what'    => $content['sub_what'],
+                                               'visible' => $content['sub_visible'],
+                                               'locked'  => $content['locked'],
                                        );
 
                                        // Add regular menu row or bottom row?
@@ -1656,7 +1673,8 @@ LEFT JOIN
 ON
        p.userid=d.userid
 WHERE
-       p.userid=%s",
+       p.userid=%s
+LIMIT 1",
                array(bigintval($userid)), __FUNCTION__, __LINE__);
 
        // Do we have an entry?
@@ -1665,7 +1683,8 @@ WHERE
                $data = SQL_FETCHARRAY($result);
 
                // Delete points entries as well
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__);
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s",
+                       array(bigintval($userid)), __FUNCTION__, __LINE__);
 
                // Update mediadata as well
                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {