Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating "down_for_maintenance.sql"


i2Paq

Recommended Posts

I've downloaded the Down for Maintenance contri. In this contri you need to add a new congiguration group and so on. I'm no sql guru and I think that a lot of us are neither so I want to create a down_for_maintenance.sql file so that everyone can benefit from this great and handy contri. I've come a long way creating this fil but now I need some help, so;

 

HELP! :)

 

This is the file so far;

 

# Insert configuration items into the configuration table.
INSERT INTO configuration (
  configuration_group_id,   
  configuration_group_title,
  configuration_group_description,
  sort_order,
  visible,
  date_added
  ) VALUES (
  '8675312
  'DOwn for Maintenance',
  'DOwn for Maintenance',
  901,
  1,
  now()
  );

# Insert configuration items into the configuration table.
INSERT INTO configuration (
  configuration_title,
  configuration_key,
  configuration_value,
  configuration_description,
  configuration_group_id,
  sort_order,
  set_function,
  date_added
  ) VALUES (
  'Down the Store for Maintenance?',
  'DOWN_FOR_MAINTENANCE',
  false,
  'If enabled, all requests for catalog will be redirected to the Maintenance page',
  8675312,
  ''
  tep_cfg_select_option(array(\'true\',\'false\')
  now()
  );

# Insert configuration items into the configuration table.
INSERT INTO configuration (
  configuration_title,
  configuration_key,
  configuration_value,
  configuration_description,
  configuration_group_id,
  sort_order,
  set_function,
  date_added
  ) VALUES (
  'Enable Warning?',
  'DOWN_FOR_MAINTENANCE_WARNING',
  false,
  'If enabled, a banner will display at the top of each catalog page warnig your customers that your shop will be down for Maintenance soon',
  8675312,
  ''
  tep_cfg_select_option(array(\'true\',\'false\')
  now()
  );

# Insert configuration items into the configuration table.
INSERT INTO configuration (
  configuration_title,
  configuration_key,
  configuration_value,
  configuration_description,
  configuration_group_id,
  sort_order,
  set_function,
  date_added
  ) VALUES (
  'Warning Message',
  'DOWN_FOR_MAINTENANCE_MESSAGE',
  '',
  'The store will be going down for maintenance in a few minutes.  We apologize for the inconvience.',
  8675312,
  '',
  'tep_cfg_textarea(',
  now()
  );

# Insert configuration items into the configuration table.
INSERT INTO configuration (
  configuration_title,
  configuration_key,
  configuration_value,
  configuration_description,
  configuration_group_id,
  sort_order,
  set_function,
  date_added
  ) VALUES (
  'Admin IP Address',
  'DOWN_FOR_MAINTENANCE_MESSAGE_IP_ADDRESS',
  127.0.0.1,
  'This IP address will still be able to access the site while everyone else gets redirected to the Down For Maintenance page.',
  8675312,
  ''
  now()
  );

 

This is what needs to be in there;

 

STEP 1:  Backup your database (standard practice) and then run the following statements in phpMyAdmin (or your SQL administration tool of choice):

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (8675312, 'Down for Maintenance', 'Down for Maintenance', '901', '1');

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Down the store for maintenance?', 'DOWN_FOR_MAINTENANCE', 'false', 'If enabled, all requests for catalog pages will be redirected to the maintenance page.', 8675312, '', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Maintenance page', 'DOWN_FOR_MAINTENANCE_PAGE', 'index-maint.php', 'Page to which users will be redirected while store is down for maintenance.  A good idea would be to create a new HTML or PHP page which matches your store layout, but with all the content replaced by a maintenance message.', 8675312, '', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Warning?', 'DOWN_FOR_MAINTENANCE_WARNING', 'false', 'If enabled, a banner will display at the top of each catalog page warning your customers that the store will be down for maintenance soon.', 8675312, '', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Warning Message', 'DOWN_FOR_MAINTENANCE_MESSAGE', 'The store will be going down for maintenance in a few minutes. We apologize for the inconvience.', 'This is the message customers will see when the Warning Message is enabled,', 8675312, '', 'tep_cfg_textarea(', now());


INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Admin IP Address', 'DOWN_FOR_MAINTENANCE_IP_ADDRESS', '127.0.0.1', 'This IP address will still be able to access the site while everyone else gets redirected to the Down For Maintenance page.<br><br>You can see the current IP address of your PC at http://whatismyipaddress.com.', 8675312, '', now());

The store will be going down for maintenance in a few minutes.  We apologize for the inconvience.

END STEP 1

 

I would be very pleased if someone or maybe a few could hace a look at my file. Especialy the first item where I need to create a new configuration_group_id etc.

 

I have not tried this file yet for obvious reasons ;)

 

If this file is finished and works, needless to say, I will ofcourse give it back to the community and upload it to the right contri!

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...