X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-repair_mmenu.php;h=c4681a0b2accca05fab722ca33886316b157adc1;hp=566b219bee366c90e45cb3bb58f57cef3f34719f;hb=4001187f22197f55e5a1f211fc8defcc180f7c32;hpb=a47a9c49a7813304ac78deb3741bdd85e6d50912 diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 566b219bee..c4681a0b2a 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -41,21 +41,23 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); $ACTIONS = array(); + // First fix all main menus (what="")... $result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; -while (list($id, $act) = SQL_FETCHROW($result_fix)) { +while ($content = SQL_FETCHARRAY($result_fix)) { // Store action value for later usage in sorting sub menus - $ACTIONS[] = $act; + $ACTIONS[] = $content['action']; // Fix weight SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1", - array($cnt, $id), __FILE__, __LINE__); + array($cnt, $content['id']), __FILE__, __LINE__); $REP += SQL_AFFECTEDROWS(); // Count one up $cnt++; } + // Set logout weight to 999 SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE `action`='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); @@ -64,10 +66,10 @@ foreach ($ACTIONS as $act) { $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($act), __FILE__, __LINE__); $cnt = 1; - while (list($id) = SQL_FETCHROW($result_fix)) { + while ($content = SQL_FETCHARRAY($result_fix)) { // Fix weight SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1", - array($cnt, $id), __FILE__, __LINE__); + array($cnt, $content['id']), __FILE__, __LINE__); $REP += SQL_AFFECTEDROWS(); // Count one up