diff --git a/install-dev/upgrade/php/p15015_blockadvertising_extension.php b/install-dev/upgrade/php/p15015_blockadvertising_extension.php new file mode 100644 index 000000000..580d718d9 --- /dev/null +++ b/install-dev/upgrade/php/p15015_blockadvertising_extension.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 15469 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function p15015_blockadvertising_extension() +{ + // Try to update with the extension of the image that exists in the module directory + if (file_exists(_PS_MODULE_DIR_.'blockadvertising')) + foreach (scandir(_PS_MODULE_DIR_.'blockadvertising') as $file) + if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png'))) + Configuration::updateGlobalValue('BLOCKADVERT_IMG_EXT', substr($file, strrpos($file, '.') + 1)); + return true; +} \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.0.15.sql b/install-dev/upgrade/sql/1.5.0.15.sql new file mode 100644 index 000000000..ec7f8de82 --- /dev/null +++ b/install-dev/upgrade/sql/1.5.0.15.sql @@ -0,0 +1,5 @@ +SET NAMES 'utf8'; + +/* PHP:p15015_blockadvertising_extension(); */; + +