https://www.icyphoenix.com/viewtopic.php?f=35&t=4615&p=31026#p31026 ----------------------------------- equiman Wed 27 Aug, 2008 19:46 Errors In Site Moving ----------------------------------- I'm moving my site ( http://en2ruedas.byethost5.com ) to another paid hosting ( http://www.en2ruedas.org/web/ ) and domine. But in the new site i see this error message: [code linenumbers=false]Warning: Invalid argument supplied for foreach() in /home/en2rueda/public_html/web/blocks/blocks_imp_dyn_menu.php on line 149[/code] Don't know why? Aditional infromation: My menu it's a new dyn_menu (it's the numer 2 ID) created for my across the CMS menu tool. Sorry my english is not very good. [spoiler]_tpldata['cat_row.'] = array(); //reset($template->_tpldata['cat_row.']); $template->_tpldata['menu_row.'] = array(); //reset($template->_tpldata['menu_row.']); $template->_tpldata['show_hide.'] = array(); //reset($template->_tpldata['show_hide.']); include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_dyn_menu.' . $phpEx); $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . " WHERE menu_id = '" . intval($cms_config_vars['md_menu_id'][$block_id]) . "' LIMIT 1"; if ( !($result = $db->sql_query($sql, false, 'dyn_menu_')) ) { message_die(GENERAL_ERROR, 'Could not query dynamic menu table'); } //$row = $db->sql_fetchrow($result); while ($row = $db->sql_fetchrow($result)) { break; } if ( ($row['menu_name_lang'] != '') && isset($lang[$row['menu_name_lang']]) ) { $main_menu_name = $lang[$row['menu_name_lang']]; } else { $main_menu_name = ( ($row['menu_name'] != '') ? $row['menu_name'] : $lang['quick_links']); } $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . " WHERE menu_parent_id = '" . intval($cms_config_vars['md_menu_id'][$block_id]) . "' ORDER BY cat_parent_id ASC, menu_order ASC"; if ( !($result = $db->sql_query($sql, false, 'dyn_menu_')) ) { message_die(GENERAL_ERROR, 'Could not query dynamic menu table'); } $menu_cat = array(); $cat_item = array(); $menu_item = array(); while ($menu_item = $db->sql_fetchrow($result)) { if ( $menu_item['cat_id'] > 0 ) { $cat_item[$menu_item['cat_id']] = $menu_item; } if ( $menu_item['cat_parent_id'] > 0 ) { $menu_cat[$menu_item['cat_parent_id']][$menu_item['menu_item_id']] = $menu_item; } } foreach($cat_item as $cat_item_data) { if ($cat_item_data['menu_status'] == false) { $cat_allowed = false; } else { $cat_allowed = true; $auth_level_req = $cat_item_data['auth_view']; switch($auth_level_req) { case '0': $cat_allowed = true; break; case '1': $cat_allowed = ( $userdata['session_logged_in'] ? false : true ); break; case '2': $cat_allowed = ( $userdata['session_logged_in'] ? true : false ); break; case '3': $cat_allowed = ( ( ($userdata['user_level'] == MOD) || ($userdata['user_level'] == ADMIN) ) ? true : false ); break; case '4': $cat_allowed = ( ($userdata['user_level'] == ADMIN) ? true : false ); break; default: $cat_allowed = true; break; } } if ( $cat_allowed == true ) { //echo($cat_item_data['menu_name'] . '
'); $cat_id = ($cat_item_data['cat_id']); if ( ($cat_item_data['menu_name_lang'] != '') && isset($lang['menu_item'][$cat_item_data['menu_name_lang']]) ) { $cat_name = $lang['menu_item'][$cat_item_data['menu_name_lang']]; } else { $cat_name = ( ($cat_item_data['menu_name'] != '') ? stripslashes($cat_item_data['menu_name']) : 'cat_item' . $cat_item_data['cat_id']); } $cat_icon = ( ($cat_item_data['menu_icon'] != '') ? '  ' : '  '); //$cat_icon = ( ($cat_item_data['menu_icon'] != '') ? '  ' : ' '); if ($cat_item_data['menu_link'] != '') { $cat_link = append_sid($cat_item_data['menu_link']); if ($cat_item_data['menu_link_external'] == true) { $cat_link .= '" target="_blank'; } } $template->assign_block_vars('cat_row', array( 'CAT_ID' => $cat_item_data['menu_parent_id'] . '_' . $cat_item_data['cat_id'], 'CAT_ITEM' => $cat_name, 'CAT_ICON' => $cat_icon, ) ); foreach($menu_cat[$cat_id] as $menu_cat_item_data) { if ($menu_cat_item_data['menu_status'] == false) { $menu_allowed = false; } else { $menu_allowed = true; $auth_level_req = $menu_cat_item_data['auth_view']; switch($auth_level_req) { case '0': $menu_allowed = true; break; case '1': $menu_allowed = ( $userdata['session_logged_in'] ? false : true ); break; case '2': $menu_allowed = ( $userdata['session_logged_in'] ? true : false ); break; case '3': $menu_allowed = ( ( ($userdata['user_level'] == MOD) || ($userdata['user_level'] == ADMIN) ) ? true : false ); break; case '4': $menu_allowed = ( ($userdata['user_level'] == ADMIN)? true : false ); break; default: $menu_allowed = true; break; } } if ( $menu_allowed == true ) { //echo($menu_cat_item_data['menu_name'] . '
'); if ( ($menu_cat_item_data['menu_name_lang'] != '') && isset($lang['menu_item'][$menu_cat_item_data['menu_name_lang']]) ) { $menu_name = $lang['menu_item'][$menu_cat_item_data['menu_name_lang']]; } else { $menu_name = ( ($menu_cat_item_data['menu_name'] != '') ? stripslashes($menu_cat_item_data['menu_name']) : 'cat_item' . $menu_cat_item_data['cat_id']) ; } if ($menu_cat_item_data['menu_link_external'] == true) { $menu_link = $menu_cat_item_data['menu_link']; $menu_link .= '" target="_blank'; } else { $menu_link = append_sid($menu_cat_item_data['menu_link']); } $menu_icon = ( ($menu_cat_item_data['menu_icon'] != '') ? '' : ''); $template->assign_block_vars('cat_row.menu_row', array( 'MENU_ITEM' => $menu_name, 'MENU_LINK' => $menu_link, 'MENU_ICON' => $menu_icon, ) ); } } } } if ($cms_config_vars['md_menu_show_hide'][$block_id] == true) { $template->assign_block_vars('show_hide_switch', array( ) ); } $template->assign_vars(array( 'MAIN_MENU_NAME' => $main_menu_name, ) ); } } imp_dyn_menu_block_func(); ?>[/spoiler]