Thanks for this excellent contribution, I have been working on a website upgrade project, and Zen Colorbox is a great visual upgrade from my old site. When applying the SQL patch, I came across a syntax error that I wanted to post here in case it was useful. One term in the query is supposed to be enclosed in quotes I believe, but causes a syntax error if it is not. This is from the zen-colorbox/readme.html file as viewed in a browser (affected area in red):
Code:
INSERT INTO `configuration_group` (`configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`) VALUES ('Zen Colorbox', 'Configure Zen Colorbox settings', '0', '1');
UPDATE `configuration_group` SET `sort_order` = LAST_INSERT_ID() WHERE `configuration_group_id` = LAST_INSERT_ID();
SELECT @cgi := `configuration_group_id` FROM `configuration_group` WHERE `configuration_group_title` = 'Zen Colorbox';
INSERT IGNORE INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `date_added`, `use_function`, `set_function`) VALUES
('<strong>Zen Colorbox</strong>', 'ZEN_COLORBOX_STATUS', 'true', '<br />If true, all product images on the following pages will be displayed within a lightbox:<br /><br />- document_general_info<br />- document_product_info<br />- page (EZ-Pages)<br />- product_free_shipping_info<br />- product_info<br />- product_music_info<br />- product_reviews<br />- product_reviews_info<br />- product_reviews_write<br /><br /><strong>Default: true</strong>', @cgi, 10, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Zen Colorbox (Update Check)', 'ZEN_COLORBOX_PLUGIN_CHECK', <?php echo SHOW_VERSION_UPDATE_IN_HEADER; ?>, 'Allow version checking if Zen Cart version checking enabled<br/><br/>If false, no version checking performed.<br/>If true, then only if Zen Cart version checking is on:', @cgi, 20, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Overlay Opacity', 'ZEN_COLORBOX_OVERLAY_OPACITY', '0.6', '<br />Controls the transparency of the overlay.<br /><br /><strong>Default: 0.6</strong>', @cgi, 30, NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''0.1'', ''0.2'', ''0.3'', ''0.4'', ''0.5'', ''0.6'', ''0.7'', ''0.8'', ''0.9'', ''1''), '),
('Resize Duration', 'ZEN_COLORBOX_RESIZE_DURATION', '400', '<br />Controls the speed of the image resizing.<br /><br />Note: This value is measured in milliseconds.<br /><br /><strong>Default: 400</strong><br />', @cgi, 40, NOW(), NULL, NULL),
('Initial Width', 'ZEN_COLORBOX_INITIAL_WIDTH', '250', '<br />If Enable Resize Animations is set to true, the lightbox will resize its width from this value to the current image width, when first displayed.<br /><br />Note: This value is measured in pixels.<br /><br /><strong>Default: 250</strong><br />', @cgi, 50, NOW(), NULL, NULL),
('Initial Height', 'ZEN_COLORBOX_INITIAL_HEIGHT', '250', '<br />If Enable Resize Animations is set to true, the lightbox will resize its height from this value to the current image height, when first displayed.<br /><br />Note: This value is measured in pixels.<br /><br /><strong>Default: 250</strong><br />', @cgi, 60, NOW(), NULL, NULL),
('Display Image Counter', 'ZEN_COLORBOX_COUNTER', 'true', '<br />If true, the image counter will be displayed (below the caption of each image) within the lightbox.<br /><br /><strong>Default: true</strong>', @cgi, 70, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('Close on Overlay Click', 'ZEN_COLORBOX_CLOSE_OVERLAY', 'false', '<br />If true, the lightbox will close when the overlay is clicked.<br /><br /><strong>Default: false</strong>', @cgi, 80, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Loop', 'ZEN_COLORBOX_LOOP', 'true', '<br />If true, Images will loop in both directions.<br /><br /><strong>Default: true</strong>', @cgi, 90, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('<strong>Slideshow</strong>', 'ZEN_COLORBOX_SLIDESHOW', 'false', '<br />If true, Images will display as a slideshow.<br /><br /><strong>Default: false</strong>', @cgi, 100, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('## Slideshow Auto Start', 'ZEN_COLORBOX_SLIDESHOW_AUTO', 'true', '<br />If true, your slideshow will auto start.<br /><br /><strong>Default: true</strong>', @cgi, 110, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('## Slideshow Speed', 'ZEN_COLORBOX_SLIDESHOW_SPEED', '2500', '<br />Sets the speed of the slideshow <br /><br />Note: This value is measured in milliseconds.<br /><br /><strong>Default: 2500</strong>', @cgi, 120, NOW(), NULL, NULL),
('## Slideshow Start Text', 'ZEN_COLORBOX_SLIDESHOW_START_TEXT', 'start slideshow', '<br />Link text to start the slideshow.<br /><br /><strong>Default: start slideshow</strong>', @cgi, 130, NOW(), NULL, NULL),
('## Slideshow Stop Text', 'ZEN_COLORBOX_SLIDESHOW_STOP_TEXT', 'stop slideshow', '<br />Link text to stop the slideshow.<br /><br /><strong>Default: stop slideshow</strong>', @cgi, 140, NOW(), NULL, NULL),
('<strong>Gallery Mode</strong>', 'ZEN_COLORBOX_GALLERY_MODE', 'true', '<br />If true, the lightbox will allow additional images to quickly be displayed using previous and next buttons.<br /><br /><strong>Default: true</strong>', @cgi, 150, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('## Include Main Image in Gallery', 'ZEN_COLORBOX_GALLERY_MAIN_IMAGE', 'true', '<br />If true, the main product image will be included in the lightbox gallery.<br /><br /><strong>Default: true</strong>', @cgi, 160, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('<strong>EZ-Pages Support</strong>', 'ZEN_COLORBOX_EZPAGES', 'true', '<br />If true, the lightbox effect will be used for linked images on all EZ-Pages.<br /><br /><strong>Default: true</strong>', @cgi, 170, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('## File Types', 'ZEN_COLORBOX_FILE_TYPES', 'jpg,png,gif', '<br />On EZ-Pages, the lightbox effect will be applied to all images with one of the following file types.<br /><br /><strong>Default: jpg,png,gif</strong><br />', @cgi, 180, NOW(), NULL, NULL);
INSERT IGNORE INTO `admin_pages` (`page_key` ,`language_key` ,`main_page` ,`page_params` ,`menu_key` ,`display_on_menu` ,`sort_order`)VALUES
('configZenColorbox', 'BOX_CONFIGURATION_ZEN_COLORBOX', 'FILENAME_CONFIGURATION', CONCAT('gID=',@cgi), 'configuration', 'Y', @cgi);
Code:
INSERT INTO `configuration_group` (`configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`) VALUES ('Zen Colorbox', 'Configure Zen Colorbox settings', '0', '1');
UPDATE `configuration_group` SET `sort_order` = LAST_INSERT_ID() WHERE `configuration_group_id` = LAST_INSERT_ID();
SELECT @cgi := `configuration_group_id` FROM `configuration_group` WHERE `configuration_group_title` = 'Zen Colorbox';
INSERT IGNORE INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `date_added`, `use_function`, `set_function`) VALUES
('<strong>Zen Colorbox</strong>', 'ZEN_COLORBOX_STATUS', 'true', '<br />If true, all product images on the following pages will be displayed within a lightbox:<br /><br />- document_general_info<br />- document_product_info<br />- page (EZ-Pages)<br />- product_free_shipping_info<br />- product_info<br />- product_music_info<br />- product_reviews<br />- product_reviews_info<br />- product_reviews_write<br /><br /><strong>Default: true</strong>', @cgi, 10, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Zen Colorbox (Update Check)', 'ZEN_COLORBOX_PLUGIN_CHECK', '<?php echo SHOW_VERSION_UPDATE_IN_HEADER; ?>', 'Allow version checking if Zen Cart version checking enabled<br/><br/>If false, no version checking performed.<br/>If true, then only if Zen Cart version checking is on:', @cgi, 20, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Overlay Opacity', 'ZEN_COLORBOX_OVERLAY_OPACITY', '0.6', '<br />Controls the transparency of the overlay.<br /><br /><strong>Default: 0.6</strong>', @cgi, 30, NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''0.1'', ''0.2'', ''0.3'', ''0.4'', ''0.5'', ''0.6'', ''0.7'', ''0.8'', ''0.9'', ''1''), '),
('Resize Duration', 'ZEN_COLORBOX_RESIZE_DURATION', '400', '<br />Controls the speed of the image resizing.<br /><br />Note: This value is measured in milliseconds.<br /><br /><strong>Default: 400</strong><br />', @cgi, 40, NOW(), NULL, NULL),
('Initial Width', 'ZEN_COLORBOX_INITIAL_WIDTH', '250', '<br />If Enable Resize Animations is set to true, the lightbox will resize its width from this value to the current image width, when first displayed.<br /><br />Note: This value is measured in pixels.<br /><br /><strong>Default: 250</strong><br />', @cgi, 50, NOW(), NULL, NULL),
('Initial Height', 'ZEN_COLORBOX_INITIAL_HEIGHT', '250', '<br />If Enable Resize Animations is set to true, the lightbox will resize its height from this value to the current image height, when first displayed.<br /><br />Note: This value is measured in pixels.<br /><br /><strong>Default: 250</strong><br />', @cgi, 60, NOW(), NULL, NULL),
('Display Image Counter', 'ZEN_COLORBOX_COUNTER', 'true', '<br />If true, the image counter will be displayed (below the caption of each image) within the lightbox.<br /><br /><strong>Default: true</strong>', @cgi, 70, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('Close on Overlay Click', 'ZEN_COLORBOX_CLOSE_OVERLAY', 'false', '<br />If true, the lightbox will close when the overlay is clicked.<br /><br /><strong>Default: false</strong>', @cgi, 80, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('Loop', 'ZEN_COLORBOX_LOOP', 'true', '<br />If true, Images will loop in both directions.<br /><br /><strong>Default: true</strong>', @cgi, 90, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('<strong>Slideshow</strong>', 'ZEN_COLORBOX_SLIDESHOW', 'false', '<br />If true, Images will display as a slideshow.<br /><br /><strong>Default: false</strong>', @cgi, 100, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('## Slideshow Auto Start', 'ZEN_COLORBOX_SLIDESHOW_AUTO', 'true', '<br />If true, your slideshow will auto start.<br /><br /><strong>Default: true</strong>', @cgi, 110, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '),
('## Slideshow Speed', 'ZEN_COLORBOX_SLIDESHOW_SPEED', '2500', '<br />Sets the speed of the slideshow <br /><br />Note: This value is measured in milliseconds.<br /><br /><strong>Default: 2500</strong>', @cgi, 120, NOW(), NULL, NULL),
('## Slideshow Start Text', 'ZEN_COLORBOX_SLIDESHOW_START_TEXT', 'start slideshow', '<br />Link text to start the slideshow.<br /><br /><strong>Default: start slideshow</strong>', @cgi, 130, NOW(), NULL, NULL),
('## Slideshow Stop Text', 'ZEN_COLORBOX_SLIDESHOW_STOP_TEXT', 'stop slideshow', '<br />Link text to stop the slideshow.<br /><br /><strong>Default: stop slideshow</strong>', @cgi, 140, NOW(), NULL, NULL),
('<strong>Gallery Mode</strong>', 'ZEN_COLORBOX_GALLERY_MODE', 'true', '<br />If true, the lightbox will allow additional images to quickly be displayed using previous and next buttons.<br /><br /><strong>Default: true</strong>', @cgi, 150, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('## Include Main Image in Gallery', 'ZEN_COLORBOX_GALLERY_MAIN_IMAGE', 'true', '<br />If true, the main product image will be included in the lightbox gallery.<br /><br /><strong>Default: true</strong>', @cgi, 160, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('<strong>EZ-Pages Support</strong>', 'ZEN_COLORBOX_EZPAGES', 'true', '<br />If true, the lightbox effect will be used for linked images on all EZ-Pages.<br /><br /><strong>Default: true</strong>', @cgi, 170, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),'),
('## File Types', 'ZEN_COLORBOX_FILE_TYPES', 'jpg,png,gif', '<br />On EZ-Pages, the lightbox effect will be applied to all images with one of the following file types.<br /><br /><strong>Default: jpg,png,gif</strong><br />', @cgi, 180, NOW(), NULL, NULL);
INSERT IGNORE INTO `admin_pages` (`page_key` ,`language_key` ,`main_page` ,`page_params` ,`menu_key` ,`display_on_menu` ,`sort_order`)VALUES
('configZenColorbox', 'BOX_CONFIGURATION_ZEN_COLORBOX', 'FILENAME_CONFIGURATION', CONCAT('gID=',@cgi), 'configuration', 'Y', @cgi);
Thanks again for the excellent contribution!
Bookmarks