bowsera Posted August 21, 2011 Share Posted August 21, 2011 ok so here is my problem, My currencies box is showing in the admin install modules panel. However, it shows options for edit and uninstall. when I click the edit button it takes me to the edit menu for another box. When I double click on the currencies box name i get the error: Warning: reset() [function.reset]: Passed variable is not an array or object in /hermes/web01/b1826/moo.badorecom/womens/admin/modules.php on line 231 Warning: Variable passed to each() is not an array or object in /hermes/web01/b1826/moo.badorecom/womens/admin/modules.php on line 232 these two lines in my ...admin/modules.php are as follows: reset($mInfo->keys); while (list($key, $value) = each($mInfo->keys)) { I am going to post the contents of my currencies box file below: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2010 osCommerce Released under the GNU General Public License */ class bm_currencies { var $code = 'bm_currencies'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_currencies() { $this->title = MODULE_BOXES_CURRENCIES_TITLE; $this->description = MODULE_BOXES_CURRENCIES_DESCRIPTION; if ( defined('MODULE_BOXES_CURRENCIES_STATUS') ) { $this->sort_order = MODULE_BOXES_CURRENCIES_SORT_ORDER; $this->enabled = (MODULE_BOXES_CURRENCIES_STATUS == 'True'); $this->group = ((MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (isset($currencies) && is_object($currencies) && (count($currencies->currencies) > 1)) { reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( is_string($value) && ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CURRENCIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' ' . tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . ' ' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_CURRENCIES_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Currencies Module', 'MODULE_BOXES_CURRENCIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CURRENCIES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_CURRENCIES_STATUS', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'MODULE_BOXES_CURRENCIES_SORT_ORDER'); } } ?> If anyone can help or point me in the right direction it would be greatly appreciated. Link to comment Share on other sites More sharing options...
ce7 Posted August 21, 2012 Share Posted August 21, 2012 ok so here is my problem, My currencies box is showing in the admin install modules panel. However, it shows options for edit and uninstall. when I click the edit button it takes me to the edit menu for another box. When I double click on the currencies box name i get the error: Warning: reset() [function.reset]: Passed variable is not an array or object in /hermes/web01/b1826/moo.badorecom/womens/admin/modules.php on line 231 Warning: Variable passed to each() is not an array or object in /hermes/web01/b1826/moo.badorecom/womens/admin/modules.php on line 232 these two lines in my ...admin/modules.php are as follows: reset($mInfo->keys); while (list($key, $value) = each($mInfo->keys)) { I am going to post the contents of my currencies box file below: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2010 osCommerce Released under the GNU General Public License */ class bm_currencies { var $code = 'bm_currencies'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_currencies() { $this->title = MODULE_BOXES_CURRENCIES_TITLE; $this->description = MODULE_BOXES_CURRENCIES_DESCRIPTION; if ( defined('MODULE_BOXES_CURRENCIES_STATUS') ) { $this->sort_order = MODULE_BOXES_CURRENCIES_SORT_ORDER; $this->enabled = (MODULE_BOXES_CURRENCIES_STATUS == 'True'); $this->group = ((MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (isset($currencies) && is_object($currencies) && (count($currencies->currencies) > 1)) { reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( is_string($value) && ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CURRENCIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' ' . tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . ' ' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_CURRENCIES_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Currencies Module', 'MODULE_BOXES_CURRENCIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CURRENCIES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_CURRENCIES_STATUS', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'MODULE_BOXES_CURRENCIES_SORT_ORDER'); } } ?> If anyone can help or point me in the right direction it would be greatly appreciated. Hi did you figure out what is going on? any solution can be shared here? I have same problem with install different boxes, thanks Lyn Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.