public function handleUpgradeFrom($version) { $success = true; switch ($version) { case '4.0.2': // 4.0.3 and 4.0.4 left this set to 4.0.2 // 4.0.3 and 4.0.4 left this set to 4.0.2 case '4.1': case '4.1.1': // Remove the obsolete "Shipping Tax" configuration option $this->removeConfigurationOption('SHIPPING_TAX'); // We changed a definition related to the edit orders admin page if (function_exists('zen_deregister_admin_pages') && zen_page_key_exists('editOrders')) { zen_deregister_admin_pages('editOrders'); } if (function_exists('zen_deregister_admin_pages') && zen_page_key_exists('configEditOrders')) { zen_deregister_admin_pages('configEditOrders'); } break; default: break; } return $success; }
/** * Processes any changes to the admin pages required by this plugin. * * Subclasses should generally not override this method. * @param boolean $install true if installing / upgrading, false otherwise. * @param array $pages an array containing the admin page(s). * * The following array keys are understood (+ indicates always required): * + page_key = The internal unique key for the page in the database. * If more than one page is desired, this can be used as a key * pointing to an array containg the corresponding keys below. * * EX: array('configPluginPage1' => array( * 'language_key' => 'BOX_CONFIGURATION_PLUGIN_PAGE1' * ) * ); * * + language_key = The name displayed in the admin menu for the page. * This should be the name of a constant defined in a language file. * * main_page = The name of a constant defined to represent the name * of the admin file loaded to display the page. If not defined * 'FILENAME_CONFIGURATION' is used. * * page_params = Any paramaters to send to the page. If the main page * is 'FILENAME_CONFIGURATION' the paramaters will be overwritten * with the correct paramaters. * * menu_key = The name of the menu where this page should be attached. * This key is required unless main_page is 'FILENAME_CONFIGURATION' * or 'FILENAME_MODULES'. * * display_on_menu = Indicates if this page should be displayed in * the admin menu. 'Y' for yes, 'N' otherwise. If not specified * this defaults to 'N' unless the main page is * 'FILENAME_CONFIGURATION' (defaults to 'Y'). * * sort_order = The preffered location of the page in the menu. This * should be a non negative number. The lower the number, the * higher up in the menu the page will appear. If two pages on * the same menu have the same sort_order, they are listed in * the order they were added Zen Cart. If not specified, the * maximum sort_order used on the menu is determined and a number * one larger is used. * * @return boolean true if the changes succeed, false otherwise. */ protected function processAdminPages($install = true, $pages = null) { global $db, $messageStack; if ($pages === null || !is_array($pages)) { $pages = $this->getAdminPages(); } if (array_key_exists('page_key', $pages)) { $page_key = $pages['page_key']; unset($pages['page_key']); $pages = array($page_key => $pages); unset($page_key); } $success = true; foreach ($pages as $key => $page) { // Validate core keys exist if (!zen_not_null($key) || !array_key_exists('language_key', $page)) { $messageStack->add(sprintf(PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_KEY, $this->getUniqueName()), 'error'); return false; } // Configure defaults if (!array_key_exists('main_page', $page)) { $page['main_page'] = 'FILENAME_CONFIGURATION'; } switch ($page['main_page']) { case 'FILENAME_CONFIGURATION': // Always overwrite with the correct data $page['page_params'] = 'gID=' . $this->getConfigurationGroupId(); break; default: if (!array_key_exists('page_params', $page)) { $page['page_params'] = ''; } } if (!array_key_exists('menu_key', $page)) { switch ($page['main_page']) { case 'FILENAME_CONFIGURATION': $page['menu_key'] = 'configuration'; break; case 'FILENAME_MODULES': $page['menu_key'] = 'modules'; break; default: $messageStack->add(sprintf(PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY, $this->getUniqueName()), 'error'); return false; } } // Process / Verify the Admin Page if ($install) { if (!zen_page_key_exists($key)) { // Validate the menu_key exists in the database. $check = $db->Execute('SELECT `menu_key` FROM `' . TABLE_ADMIN_MENUS . '` ' . 'WHERE `menu_key` = \'' . zen_db_prepare_input($page['menu_key']) . '\''); if ($check->EOF) { $std_menu_keys = array('configuration', 'catalog', 'modules', 'customers', 'taxes', 'localization', 'reports', 'tools', 'gv', 'access', 'extras'); $messageStack->add(sprintf(in_array($page['menu_key'], $std_menu_keys) ? PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY_BROKEN : PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY_MISSING, $this->getUniqueName(), $page['menu_key']), 'error'); return false; } if (!array_key_exists('display_on_menu', $page)) { if ($page['main_page'] == 'FILENAME_CONFIGURATION') { $page['display_on_menu'] = 'Y'; } else { $page['display_on_menu'] = 'N'; } } if (!array_key_exists('sort_order', $page)) { $page_sort = $db->Execute('SELECT MAX(sort_order) as max_sort FROM `' . TABLE_ADMIN_PAGES . '` ' . 'WHERE `menu_key`=\'' . zen_db_prepare_input($page['menu_key']) . '\''); if (!$page_sort->EOF) { $page['sort_order'] = (int) $page_sort->fields['max_sort'] + 1; } else { $messageStack->add(sprintf(PLUGIN_INSTALL_ERROR_SORT_ORDER, TABLE_ADMIN_PAGES), 'warning'); $page['sort_order'] = 0; } unset($page_sort); } if ((int) $page['sort_order'] < 0) { $page['sort_order'] = 0; } zen_register_admin_page($key, $page['language_key'], $page['main_page'], $page['page_params'], $page['menu_key'], $page['display_on_menu'], $page['sort_order']); if (!zen_page_key_exists($key)) { $success = false; } } } else { if (zen_page_key_exists($key)) { zen_deregister_admin_pages($key); if (zen_page_key_exists($key)) { $success = false; } } } } return $success; }
$sql = "ALTER TABLE " . TABLE_ORDERS_STATUS_HISTORY . " ADD track_id3 TEXT default NULL"; $db->Execute($sql); } //check if track_id4 column exists $sql = "SHOW COLUMNS FROM " . TABLE_ORDERS_STATUS_HISTORY . " LIKE '%track_id4%'"; $result = $db->Execute($sql); if (!$result->RecordCount()) { $sql = "ALTER TABLE " . TABLE_ORDERS_STATUS_HISTORY . " ADD track_id4 TEXT default NULL"; $db->Execute($sql); } //check if track_id5 column exists $sql = "SHOW COLUMNS FROM " . TABLE_ORDERS_STATUS_HISTORY . " LIKE '%track_id5%'"; $result = $db->Execute($sql); if (!$result->RecordCount()) { $sql = "ALTER TABLE " . TABLE_ORDERS_STATUS_HISTORY . " ADD track_id5 TEXT default NULL"; $db->Execute($sql); } if (file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.typt.php')) { if (!unlink(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.typt.php')) { $messageStack->add('The auto-loader ' . DIR_FS_ADMIN . 'includes/auto_loaders/config.typt.php has not been deleted. For this module to work you must delete this file manually.', 'error'); } } $messageStack->add('Ty Package Tracker v3.1.4 install completed!', 'success'); // find next sort order in admin_pages table $sql = "SELECT (MAX(sort_order)+2) as sort FROM " . TABLE_ADMIN_PAGES; $result = $db->Execute($sql); $admin_page_sort = $result->fields['sort']; // now register the admin pages // Admin Menu for Ty Package Tracker Configuration Menu zen_deregister_admin_pages('configTyPackageTracker'); zen_register_admin_page('configTyPackageTracker', 'BOX_CONFIGURATION_TY_PACKAGE_TRACKER', 'FILENAME_CONFIGURATION', 'gID=' . $typt_configuration_id, 'configuration', 'Y', $admin_page_sort);
// create Product Listing Page Entry while keeping previous values $c_key = 'USE_STYLE_CHANGER_FOR_PRODUCT_LISTING'; $sql = "SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "' LIMIT 1"; $results = $db->Execute($sql); $config_value = $results->fields['configuration_value'] != '' ? $results->fields['configuration_value'] : 'False'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql); $sql = "INSERT INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES\n\t(NULL, 'Use Style Changer for Product Listing', '" . $c_key . "', '" . $config_value . "', 'Show the Style Changer for allowing the customer to change between Rows and Columns', " . $product_listing_configuration_id . ", 940, now(), now(), NULL, 'zen_cfg_select_option(array(''True'',''False''),')"; $db->Execute($sql); // eof page entry $messageStack->add('SNAF database changes have been installed', 'success'); } else { // this is an uninstall : $sql = "DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = 'Specials Listing-SNAF';"; $db->Execute($sql); zen_deregister_admin_pages('configSpecialsListing'); $c_key = 'INCLUDE_SALEMAKER_IN_SPECIALS'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql); $c_key = 'USE_PRODUCT_LISTING_FOR_SPECIALS'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql); $c_key = 'USE_PRODUCT_LISTING_FILTER_FOR_SPECIALS'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql); $c_key = 'USE_PRODUCT_LISTING_FOR_ALL_PRODUCTS'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql); $c_key = 'USE_PRODUCT_LISTING_FILTER_FOR_ALL_PRODUCTS'; $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'"; $db->Execute($sql);
// ====================================================== // // Uninstall // // ====================================================== // ====================================================== // // remove the menu items from the images menu // // ====================================================== foreach ($menu_items_image as $m) { $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $m[0] . "'"; $db->Execute($sql); } if (defined('TABLE_ADMIN_PAGES')) { zen_deregister_admin_pages('configImageHandler4'); } // ====================================================== // // rollback corefiles to default versions // // ====================================================== foreach ($rollback_files as $cf) { if (xxxx_install_replace($cf[0], $cf[1])) { if ($message_type == 'session') { $messageStack->add_session('ROLLBACK : ' . $cf[0] . ' ' . IH_MS_ROLLBACK_OK . '', 'success'); } else { $messageStack->add('ROLLBACK : ' . $cf[0] . ' ' . IH_MS_ROLLBACK_OK . '', 'success'); } @unlink($cf[1]); } else {
// now register the admin pages // Admin Menu for Super Orders Configuration Menu zen_deregister_admin_pages('configSuperOrders'); zen_register_admin_page('configSuperOrders', 'BOX_CONFIGURATION_SUPER_ORDERS', 'FILENAME_CONFIGURATION', 'gID=' . $so_configuration_id, 'configuration', 'Y', $admin_page_sort); //-- Admin Menu for Batch Status Update zen_deregister_admin_pages('customersBatchStatusUpdate'); zen_register_admin_page('customersBatchStatusUpdate', 'BOX_CUSTOMERS_SUPER_BATCH_STATUS', 'FILENAME_SUPER_BATCH_STATUS', '', 'customers', 'Y', $admin_page_sort); //-- Admin Menu for Batch Status Print zen_deregister_admin_pages('customersBatchFormPrint'); zen_register_admin_page('customersBatchFormPrint', 'BOX_CUSTOMERS_SUPER_BATCH_FORMS', 'FILENAME_SUPER_BATCH_FORMS', '', 'customers', 'Y', $admin_page_sort); //-- Admin Menu for Batch Print Pages zen_deregister_admin_pages('customersBatchPages'); zen_register_admin_page('customersBatchPages', 'BOX_CUSTOMERS_SUPER_BATCH_PAGES', 'FILENAME_SUPER_BATCH_PAGES', '', 'customers', 'N', $admin_page_sort); //-- Admin Menu for Super Data Sheet zen_deregister_admin_pages('customersSuperDataSheet'); zen_register_admin_page('customersSuperDataSheet', 'BOX_CUSTOMERS_SUPER_DATA_SHEET', 'FILENAME_SUPER_DATA_SHEET', '', 'customers', 'N', $admin_page_sort); //-- Admin Menu for Super Shipping Label zen_deregister_admin_pages('customersSuperShippingLabel'); zen_register_admin_page('customersSuperShippingLabel', 'BOX_CUSTOMERS_SUPER_SHIPPING_LABEL', 'FILENAME_SUPER_SHIPPING_LABEL', '', 'customers', 'N', $admin_page_sort); //-- Admin Menu for Super Orders Edit Pop-Up zen_deregister_admin_pages('customersSuperPopUp'); zen_register_admin_page('customersSuperPopUp', 'BOX_CUSTOMERS_SUPER_EDIT_POPUP', 'FILENAME_SUPER_EDIT', '', 'customers', 'N', $admin_page_sort); //-- Admin Menu for Manage Payment Types zen_deregister_admin_pages('localizationManagePaymentTypes'); zen_register_admin_page('localizationManagePaymentTypes', 'BOX_LOCALIZATION_MANAGE_PAYMENT_TYPES', 'FILENAME_SUPER_PAYMENT_TYPES', '', 'localization', 'Y', $admin_page_sort); //-- Admin Menu for Orders Awaiting Paymments Report zen_deregister_admin_pages('reportsOrdersAwaitingPayment'); zen_register_admin_page('reportsOrdersAwaitingPayment', 'BOX_REPORTS_SUPER_REPORT_AWAIT_PAY', 'FILENAME_SUPER_REPORT_AWAIT_PAY', '', 'reports', 'Y', $admin_page_sort); //-- Admin Menu for Cash Report zen_deregister_admin_pages('reportsCashReport'); zen_register_admin_page('reportsCashReport', 'BOX_REPORTS_SUPER_REPORT_CASH', 'FILENAME_SUPER_REPORT_CASH', '', 'reports', 'Y', $admin_page_sort);
function ultimate_seo_uninstall() { global $db, $messageStack; $failed = false; zen_db_perform(TABLE_CONFIGURATION, array('configuration_value' => 'false'), 'update', '`configuration_key`=\'SEO_ENABLED\''); $db->Execute('DELETE FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'' . SEO_CONFIGURATION_GROUP_TITLE . '\''); $check = $db->Execute('SELECT `configuration_group_title` FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'' . SEO_CONFIGURATION_GROUP_TITLE . '\''); if (!$check->EOF) { $messageStack->add(sprintf(SEO_UNINSTALL_ERROR_DELETE, 'configuration group: ' . SEO_CONFIGURATION_GROUP_TITLE, TABLE_CONFIGURATION_GROUP), 'error'); $failed = true; } $db->Execute('DELETE FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'SEO URLs\''); $check = $db->Execute('SELECT `configuration_group_title` FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'SEO URLs\''); if (!$check->EOF) { $messageStack->add(sprintf(SEO_UNINSTALL_ERROR_DELETE, 'configuration group: ' . SEO_CONFIGURATION_GROUP_TITLE, 'SEO URLs'), 'error'); $failed = true; } foreach (ultimate_seo_default_settings() as $option => $value) { if (defined($option)) { $db->Execute('DELETE FROM `' . TABLE_CONFIGURATION . '` ' . 'WHERE `configuration_key`=\'' . $option . '\''); $check = $db->Execute('SELECT `configuration_id` FROM `' . TABLE_CONFIGURATION . '` ' . 'WHERE `configuration_key` = \'' . $option . '\''); if (!$check->EOF) { $messageStack->add(sprintf(SEO_UNINSTALL_ERROR_DELETE, 'configuration option: ' . $option, TABLE_CONFIGURATION), 'error'); $failed = true; } } } $db->Execute('DROP TABLE IF EXISTS ' . TABLE_SEO_CACHE); $check = $db->Execute('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ' . 'WHERE TABLE_SCHEMA = \'' . DB_DATABASE . '\' ' . 'AND TABLE_NAME = \'' . TABLE_SEO_CACHE . '\''); if (!$check->EOF) { $messageStack->add(sprintf(SEO_UNINSTALL_ERROR_TABLE, TABLE_SEO_CACHE), 'error'); $failed = true; } if (function_exists('zen_deregister_admin_pages')) { if (zen_page_key_exists('configUltimateSEO')) { zen_deregister_admin_pages('configUltimateSEO'); } if (zen_page_key_exists('UltimateSEO')) { zen_deregister_admin_pages('UltimateSEO'); } if (zen_page_key_exists('configUltimateSEO') || zen_page_key_exists('UltimateSEO')) { $messageStack->add(SEO_UNINSTALL_ERROR_ADMIN_PAGES); $failed = true; } } return $failed; }
public function handleUpgradeFrom($version) { global $db, $messageStack; $success = true; $default = $this->getDefaultConfiguration(); // Handle the upgrades. This can be quite complex. switch ($version) { case '2.150': if (defined('SEO_REMOVE_ALL_SPEC_CHARS')) { $data = $default['REMOVE_CHARS']; $data['configuration_key'] = 'USU_REMOVE_CHARS'; $data['configuration_value'] = SEO_REMOVE_ALL_SPEC_CHARS == 'true' ? 'non-alphanumerical' : 'punctuation'; $this->updateConfigurationOption('SEO_REMOVE_ALL_SPEC_CHARS', $data); } if (defined('SEO_ADD_PRODUCT_CAT')) { $data = $default['FORMAT']; $data['configuration_key'] = 'USU_FORMAT'; $data['configuration_value'] = SEO_ADD_PRODUCT_CAT == 'true' ? 'parent' : 'original'; if (defined('SEO_ADD_CAT_PARENT') && SEO_ADD_CAT_PARENT == 'true') { $data['configuration_value'] = 'original'; } $this->updateConfigurationOption('SEO_ADD_PRODUCT_CAT', $data); } if (defined('SEO_ADD_CAT_PARENT')) { $data = $default['CATEGORY_DIR']; $data['configuration_key'] = 'USU_CATEGORY_DIR'; $data['configuration_value'] = SEO_ADD_CAT_PARENT == 'false' ? 'off' : 'full'; $this->updateConfigurationOption('SEO_ADD_CAT_PARENT', $data); } if (defined('SEO_ADD_CPATH_TO_PRODUCT_URLS')) { $data = $default['CPATH']; $data['configuration_key'] = 'USU_CPATH'; $data['configuration_value'] = SEO_ADD_CPATH_TO_PRODUCT_URLS == 'false' ? 'off' : 'auto'; $this->updateConfigurationOption('SEO_ADD_CPATH_TO_PRODUCT_URLS', $data); } // Remove older options which are no longer used $old_options = array('USE_SEO_CACHE_ARTICLES', 'USE_SEO_CACHE_INFO_PAGES', 'SEO_URLS_USE_W3C_VALID'); foreach ($old_options as $option) { if (defined($option)) { $this->removeConfigurationOption($option); } } // Zen Cart 1.5.x specific changes if (function_exists('zen_deregister_admin_pages') && zen_page_key_exists('UltimateSEO')) { zen_deregister_admin_pages('UltimateSEO'); if (zen_page_key_exists('UltimateSEO')) { $messageStack->add(SEO_UNINSTALL_ERROR_ADMIN_PAGES); $success = false; } } // Update the configuration title if it exists $check = $db->Execute('SELECT `configuration_group_id` FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'SEO URLs\''); if (!$check->EOF) { zen_db_perform(TABLE_CONFIGURATION_GROUP, array('configuration_group_title' => $this->getUniqueName()), 'update', '`configuration_group_id`=\'' . $check->fields['configuration_group_id'] . '\''); } case '2.210': // Enforce full and parent are not compatible if (defined('SEO_URL_CATEGORY_DIR') && defined('SEO_URL_FORMAT') && SEO_URL_CATEGORY_DIR == 'full' && SEO_URL_FORMAT == 'parent') { $data = $default['FORMAT']; $data['configuration_value'] = 'original'; $this->updateConfigurationOption('USU_FORMAT', $data); } case '2.211': // Remove older option which is no longer used (if present) if (defined('SEO_REMOVE_ALL_SPEC_CHARS')) { $this->removeConfigurationOption('SEO_REMOVE_ALL_SPEC_CHARS'); } if (defined('SEO_URLS_REMOVE_CHARS')) { $data = $default['REMOVE_CHARS']; $data['configuration_key'] = 'USU_REMOVE_CHARS'; $data['configuration_value'] = SEO_URLS_REMOVE_CHARS == 'alphanumerical' ? 'non-alphanumerical' : 'punctuation'; $this->updateConfigurationOption('SEO_URLS_REMOVE_CHARS', $data); } case '2.212': // All the settings changed names after this version. // We will need to handle all the changes to not lose settings. if (defined('SEO_ENABLED')) { $data = $default['ENABLED']; $data['configuration_key'] = 'USU_ENABLED'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_ENABLED', $data); } if (defined('SEO_URL_CPATH')) { $data = $default['CPATH']; $data['configuration_key'] = 'USU_CPATH'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URL_CPATH', $data); } if (defined('SEO_URL_END')) { $data = $default['END']; $data['configuration_key'] = 'USU_END'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URL_END', $data); } if (defined('SEO_URL_FORMAT')) { $data = $default['FORMAT']; $data['configuration_key'] = 'USU_FORMAT'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URL_FORMAT', $data); } if (defined('SEO_URL_CATEGORY_DIR')) { $data = $default['CATEGORY_DIR']; $data['configuration_key'] = 'USU_CATEGORY_DIR'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URL_CATEGORY_DIR', $data); } if (defined('SEO_URLS_REMOVE_CHARS')) { $data = $default['REMOVE_CHARS']; $data['configuration_key'] = 'USU_REMOVE_CHARS'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URLS_REMOVE_CHARS', $data); } $pcre = ''; if (defined('SEO_URLS_FILTER_CHARS')) { if (zen_not_null(SEO_URLS_FILTER_CHARS)) { $pcre = SEO_URLS_FILTER_CHARS . ','; } $this->removeConfigurationOption('SEO_URLS_FILTER_CHARS'); } if (defined('SEO_URLS_FILTER_PCRE')) { $data = $default['FILTER_PCRE']; $data['configuration_key'] = 'USU_FILTER_PCRE'; $data['configuration_value'] = $pcre . SEO_URLS_FILTER_PCRE; $this->updateConfigurationOption('SEO_URLS_FILTER_PCRE', $data); } if (defined('SEO_URLS_FILTER_SHORT_WORDS')) { $data = $default['FILTER_SHORT_WORDS']; $data['configuration_key'] = 'USU_FILTER_SHORT_WORDS'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URLS_FILTER_SHORT_WORDS', $data); } if (defined('SEO_URLS_ONLY_IN')) { $data = $default['FILTER_PAGES']; $data['configuration_key'] = 'USU_FILTER_PAGES'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URLS_ONLY_IN', $data); } if (defined('SEO_REWRITE_TYPE')) { $data = $default['ENGINE']; $data['configuration_key'] = 'USU_ENGINE'; $this->updateConfigurationOption('SEO_REWRITE_TYPE', $data); } if (defined('SEO_USE_REDIRECT')) { $data = $default['REDIRECT']; $data['configuration_key'] = 'USU_REDIRECT'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_REDIRECT', $data); } if (defined('SEO_USE_CACHE_GLOBAL')) { $data = $default['CACHE_GLOBAL']; $data['configuration_key'] = 'USU_CACHE_GLOBAL'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_CACHE_GLOBAL', $data); } if (defined('SEO_USE_CACHE_PRODUCTS')) { $data = $default['CACHE_PRODUCTS']; $data['configuration_key'] = 'USU_CACHE_PRODUCTS'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_CACHE_PRODUCTS', $data); } if (defined('SEO_USE_CACHE_CATEGORIES')) { $data = $default['CACHE_CATEGORIES']; $data['configuration_key'] = 'USU_CACHE_CATEGORIES'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_CACHE_CATEGORIES', $data); } if (defined('SEO_USE_CACHE_MANUFACTURERS')) { $data = $default['CACHE_MANUFACTURERS']; $data['configuration_key'] = 'USU_CACHE_MANUFACTURERS'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_CACHE_MANUFACTURERS', $data); } if (defined('SEO_USE_CACHE_EZ_PAGES')) { $data = $default['CACHE_EZ_PAGES']; $data['configuration_key'] = 'USU_CACHE_EZ_PAGES'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_USE_CACHE_EZ_PAGES', $data); } if (defined('SEO_URLS_CACHE_RESET')) { $data = $default['CACHE_RESET']; $data['configuration_key'] = 'USU_CACHE_RESET'; unset($data['configuration_value']); $this->updateConfigurationOption('SEO_URLS_CACHE_RESET', $data); } // Zen Cart 1.5.x specific changes if (function_exists('zen_deregister_admin_pages') && zen_page_key_exists('configUltimateSEO')) { zen_deregister_admin_pages('configUltimateSEO'); if (zen_page_key_exists('configUltimateSEO')) { $messageStack->add(SEO_UNINSTALL_ERROR_ADMIN_PAGES); $success = false; } } // Update the configuration title if an old one exists $check = $db->Execute('SELECT `configuration_group_id` FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'Ultimate SEO\''); if (!$check->EOF) { zen_db_perform(TABLE_CONFIGURATION_GROUP, array('configuration_group_title' => $this->getUniqueName()), 'update', '`configuration_group_id`=\'' . $check->fields['configuration_group_id'] . '\''); } // Remove old versions of the cache if ($this->dbTableExists(DB_PREFIX . 'seo_cache')) { $db->Execute('DROP TABLE `' . DB_PREFIX . 'seo_cache`'); } default: // Remove beta versions of the cache if (version_compare($version, '2.215', '<') && $this->dbTableExists(TABLE_USU_CACHE)) { $db->Execute('DROP TABLE `' . TABLE_USU_CACHE . '`'); } } return $success; }