From ab9b0f8996975f2c68c18ff137afd58c0b678e84 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 8 Jul 2009 01:28:55 +0000 Subject: [PATCH] Menu Layouts working correctly. --- class2.php | 14 +++++++++----- e107_admin/menus.php | 6 +++--- signup.php | 9 +++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/class2.php b/class2.php index ae259a575..3adac550c 100644 --- a/class2.php +++ b/class2.php @@ -9,8 +9,8 @@ * General purpose file * * $Source: /cvs_backup/e107_0.8/class2.php,v $ -* $Revision: 1.102 $ -* $Date: 2009-07-07 22:56:10 $ +* $Revision: 1.103 $ +* $Date: 2009-07-08 01:28:55 $ * $Author: e107coders $ * */ @@ -965,14 +965,17 @@ if(!defined("THEME_LAYOUT")) $sql->db_Mark_Time('Start: Get menus'); if(!isset($_E107['no_menus'])) { - $menu_data = $e107cache->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE)); + $menu_layout_field = (THEME_LAYOUT != $pref['sitetheme_deflayout']) ? THEME_LAYOUT : ""; + $menu_data = $e107cache->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE.$menu_layout_field)); $menu_data = $eArrayStorage->ReadArray($menu_data); $eMenuList = array(); $eMenuActive = array(); $eMenuArea = array(); if(!is_array($menu_data)) { - if ($sql->db_Select('menus', '*', 'menu_location > 0 AND menu_class IN ('.USERCLASS_LIST.') ORDER BY menu_order')) + + $menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN ('.USERCLASS_LIST.') AND menu_layout = "'.$menu_layout_field.'" ORDER BY menu_order'; + if ($sql->db_Select_gen($menu_qry)) { while ($row = $sql->db_Fetch()) { @@ -987,7 +990,7 @@ if(!isset($_E107['no_menus'])) $menu_data = $eArrayStorage->WriteArray($menu_data, false); $e107cache->set_sys('menus_'.USERCLASS_LIST.'_'.md5(e_LANGUAGE), $menu_data); - unset($menu_data); + unset($menu_data,$menu_layout_field,$menu_qry); } else { @@ -996,6 +999,7 @@ if(!isset($_E107['no_menus'])) $eMenuActive = $menu_data['menu_active']; unset($menu_data); } + } $sql->db_Mark_Time('(Start: Find/Load Theme)'); diff --git a/e107_admin/menus.php b/e107_admin/menus.php index bd41a12c2..d1184b9ce 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ -| $Revision: 1.19 $ -| $Date: 2009-07-07 22:56:11 $ +| $Revision: 1.20 $ +| $Date: 2009-07-08 01:28:55 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -160,7 +160,7 @@ function menuActivate() $row=$sql->db_Fetch(); //If menu is not already activated in that area, add the record. - if(!$sql->db_Update('menus', "menu_order='{$menu_count}', menu_location = ".$location." WHERE menu_name='".$row['menu_name']."' AND menu_layout = '$layout' LIMIT 1 ")) + if(!$sql->db_Select('menus', 'menu_name,menu_path', " menu_name='".$row['menu_name']."' AND menu_layout = '$layout' AND menu_location = ".$location." LIMIT 1 ")) { $qry = " INSERT into #menus diff --git a/signup.php b/signup.php index d6f071c2a..23f441662 100644 --- a/signup.php +++ b/signup.php @@ -9,9 +9,9 @@ * User signup * * $Source: /cvs_backup/e107_0.8/signup.php,v $ - * $Revision: 1.36 $ - * $Date: 2009-06-12 20:41:35 $ - * $Author: e107steved $ + * $Revision: 1.37 $ + * $Date: 2009-07-08 01:28:55 $ + * $Author: e107coders $ * */ @@ -868,7 +868,8 @@ function render_after_signup($error_message) if (isset($pref['signup_text_after']) && (strlen($pref['signup_text_after']) > 2)) { - $text = $tp->toHTML(str_replace($srch, $repl, $pref['signup_text_after']), TRUE, 'parse_sc,defs')."
"; + $text = str_replace($srch, $repl, $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs'))."
"; + // keep str_replace() outside of toHTML to allow for search/replace of dynamic terms within 'defs'. } else {