Jump to content

spc_alex

Members
  • Content count

    1
  • Joined

  • Last visited

  1. spc_alex

    [Contribution] Mindsparx admin

    Sorry for my bad speack english. Habitually, I speack french. I used the version of ReyBlack for MindSparx admin. My problem is the following one. I try to install the contribution " Store Mode V1.3 ". The problem it is, that after the installation, I do not manage to see the space of the configuration of the " Store mode " in the admin. Here is codes them modifying the admin in mysql and configuration.php: # NEW RECORDS FOR: STORE MODE ADDON # THE CONFIGURATION GROUP SORT ORDER MAY BE CHANGED INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (1501, 'Store Mode', 'Open, Closed, or Maintenance Mode', '30', '1'); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added) VALUES ('Current Store Mode', 'STORE_MODE', 'Open', '<b>Open</b>: fully functional store<br><b>Closed</b>: checkout is disabled<br><b>Maintenance</b>: redirected to maintenance page', '1501', '1', 'tep_cfg_select_option(array(\'Open\', \'Closed\', \'Maintenance\'), ', now(), now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added) VALUES ('Offline Warning', 'OFFLINE_WARNING', 'false', 'If enabled when the store is in Open mode, a message will display at the top of each catalog page warning your customers that the store will be going offline. This message is configurable in your language file.', '1501', '2', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now()); INSERT INTO configuration VALUES (NULL, 'Store Offline (Date/Time)', 'OFFLINE_DATE_TIME', 'Date and Time', 'Set the date and time which you desire your store to be offline [closed or maintenance].<br><br>mm/dd/yyyy at hh:mm am/pm<br>', 1501, 3, now(), now(), NULL, NULL); INSERT INTO configuration VALUES (NULL, 'Store Online (Date/Time)', 'ONLINE_DATE_TIME', 'Date and Time', 'Set the date and time which you desire your store to return online [open].<br><br>mm/dd/yyyy at hh:mm am/pm<br>', 1501, 4, now(), now(), NULL, NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) VALUES ('Maintenance Page', 'MAINTENANCE_FILENAME', 'index_maintenance.php', 'This is the webpage to which users will be redirected while the store is offline for maintenance.<br><br>filename.php or filename.html<br>', '1501', '5', now(), now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Testing', 'MAINTENANCE_TESTING', 'false', 'This temporarily disables the automatic ip detection so that you may view the maintenance page from the customers point of view for testing purposes.', '1501', '6', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Hide Header', 'HEADER_OFF', 'false', 'This hides the header when displaying the maintenance page.<br><br>true = hide | false = show', '1501', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Hide Column Left', 'COLUMN_LEFT_OFF', 'false', 'This hides the left column when displaying the maintenance page.<br><br>true = hide | false = show', '1501', '8', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Hide Column Right', 'COLUMN_RIGHT_OFF', 'false', 'This hides the right column when displaying the maintenance page.<br><br>true = hide | false = show', '1501', '9', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Hide Footer', 'FOOTER_OFF', 'false', 'This hides the footer when displaying the maintenance page.<br><br>true = hide | false = show', '1501', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, last_modified, date_added, use_function) VALUES ('Maintenance Mode: Hide Prices', 'PRICES_OFF', 'false', 'This hides the product prices when displaying the maintenance page.<br><br>true = hide | false = show', '1501', '11', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), now(), NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) VALUES ('Admin IP Address', 'OFFLINE_IP_ADDRESS', 'Your Current IP', 'This IP address will be able to access the site while everyone else is redirected to the maintenance page.<br><br>Though your current ip address should be detected automatically, you can discover it at <b>www.find-ip-address.org</b><br>', '1501', '12', now(), now()); ********** * STEP 9 * ********** in catalog/admin/configuration.php Find this: if (tep_not_null($action)) { switch ($action) { case 'save': $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']); $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'"); tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID)); break; } } REPLACE with this: // BOF: Store Mode if (tep_not_null($action)) { switch ($action) { case 'save': $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']); $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'"); // set the OFFLINE_WARNING to false if STORE_MODE is set to Closed or Maintenance if ( (OFFLINE_WARNING == 'true') && (STORE_MODE != 'Open') ) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = 'false', last_modified = '" . NOW . "' where configuration_key = 'OFFLINE_WARNING'"); } tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID)); break; } } // Add for getting the actual IP (when not a fixed ip) if (MAINTENANCE_TESTING == 'true') { $IP_Admin = 'testing'; tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $IP_Admin . "' where configuration_key = 'OFFLINE_IP_ADDRESS'"); } else { if ($HTTP_GET_VARS['gID'] == '1501') { $IP_Admin = tep_db_prepare_input(getenv(REMOTE_ADDR)); $IP_Admin_DB_query = tep_db_query ("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'OFFLINE_IP_ADDRESS'"); $IP_Admin_DB = tep_db_fetch_array($IP_Admin_DB_query); if ($IP_Admin_DB['configuration_value'] != $IP_Admin) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $IP_Admin . "' where configuration_key = 'OFFLINE_IP_ADDRESS'"); } } } // EOF: Store Mode ** NOTE: The first block of code will automaticly set Admin->Configuration->Store Mode->Offline Warning to 'false' after you set the Admin->Configuration->Current Store Mode to "Closed" or "Maintenance" This way you will NOT forget to do it yourself and you'll avoid customer confusion. ** NOTE: If you don't have a fixed IP number, the second block of code will get the actual IP of your admin computer and write it to the database. Thank you for your help and for your understanding.
×