first commit
This commit is contained in:
35
modules/ph_simpleblog/upgrade/index.php
Normal file
35
modules/ph_simpleblog/upgrade/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
16
modules/ph_simpleblog/upgrade/install-1.0.1.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.0.1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_1($object)
|
||||
{
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD date_add DATETIME NOT NULL') && Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD date_upd DATETIME NOT NULL');
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.0.2.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.0.2.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_2($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD author VARCHAR(60) NOT NULL AFTER active');
|
||||
|
||||
$object->registerHook('moduleRoutes');
|
||||
|
||||
return true;
|
||||
}
|
||||
46
modules/ph_simpleblog/upgrade/install-1.0.3.php
Normal file
46
modules/ph_simpleblog/upgrade/install-1.0.3.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_3($object)
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_tag` (
|
||||
`id_simpleblog_tag` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_lang` INT( 11 ) unsigned NOT NULL,
|
||||
`name` VARCHAR(60) NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_tag`)
|
||||
) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_post_tag` (
|
||||
`id_simpleblog_post` INT( 11 ) unsigned NOT NULL,
|
||||
`id_simpleblog_tag` INT( 11 ) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_tag`)
|
||||
) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
foreach ($sql as $s) {
|
||||
if (!Db::getInstance()->Execute($s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$context = Context::getContext();
|
||||
|
||||
$tab = new Tab();
|
||||
$tab->name[$context->language->id] = $object->l('Tags');
|
||||
$tab->class_name = 'AdminSimpleBlogTags';
|
||||
$tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
|
||||
$tab->module = $object->name;
|
||||
$tab->add();
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.0.4.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.0.4.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_4($object)
|
||||
{
|
||||
$object->registerHook('displaySimpleBlogPosts');
|
||||
|
||||
return true;
|
||||
}
|
||||
29
modules/ph_simpleblog/upgrade/install-1.0.5.php
Normal file
29
modules/ph_simpleblog/upgrade/install-1.0.5.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_5($object)
|
||||
{
|
||||
$object->registerHook('displayLeftColumn');
|
||||
$object->registerHook('displayRightColumn');
|
||||
|
||||
$tab = new Tab();
|
||||
$tab->name[Context::getContext()->language->id] = $object->l('Settings');
|
||||
$tab->class_name = 'AdminSimpleBlogSettings';
|
||||
$tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
|
||||
$tab->module = $object->name;
|
||||
$tab->add();
|
||||
|
||||
Configuration::updateValue('PH_BLOG_POSTS_PER_PAGE', '10');
|
||||
Configuration::updateValue('PH_BLOG_FB_COMMENTS', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.0.6.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.0.6.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_6($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_SLUG', 'blog');
|
||||
|
||||
return true;
|
||||
}
|
||||
23
modules/ph_simpleblog/upgrade/install-1.0.7.php
Normal file
23
modules/ph_simpleblog/upgrade/install-1.0.7.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_7($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_COLUMNS', 'prestashop');
|
||||
Configuration::updateValue('PH_BLOG_LAYOUT', 'left_sidebar');
|
||||
Configuration::updateValue('PH_BLOG_LIST_LAYOUT', 'grid');
|
||||
Configuration::updateValue('PH_BLOG_GRID_COLUMNS', '2');
|
||||
Configuration::updateValue('PH_BLOG_MAIN_TITLE', 'Blog - what\'s new?');
|
||||
$object->registerHook('displayHeader');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.0.8.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.0.8.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_8($object)
|
||||
{
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD cover TEXT AFTER author');
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.0.9.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.0.9.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_9($object)
|
||||
{
|
||||
return Configuration::updateValue('PH_BLOG_THUMB_METHOD', '1')
|
||||
&& Configuration::updateValue('PH_BLOG_THUMB_X', '400')
|
||||
&& Configuration::updateValue('PH_BLOG_THUMB_Y', '200')
|
||||
&& Configuration::updateValue('PH_BLOG_THUMB_X_WIDE', '800')
|
||||
&& Configuration::updateValue('PH_BLOG_THUMB_Y_WIDE', '250');
|
||||
}
|
||||
17
modules/ph_simpleblog/upgrade/install-1.1.0.php
Normal file
17
modules/ph_simpleblog/upgrade/install-1.1.0.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_0($object)
|
||||
{
|
||||
return Configuration::updateValue('PH_BLOG_LOAD_FA', '1')
|
||||
&& Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD is_featured tinyint(1) NOT NULL DEFAULT \'0\'');
|
||||
}
|
||||
28
modules/ph_simpleblog/upgrade/install-1.1.1.php
Normal file
28
modules/ph_simpleblog/upgrade/install-1.1.1.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_1($object)
|
||||
{
|
||||
Configuration::updateValue('PH_RECENTPOSTS_NB', '4');
|
||||
Configuration::updateValue('PH_RECENTPOSTS_CAT', '0');
|
||||
Configuration::updateValue('PH_RECENTPOSTS_POSITION', 'home');
|
||||
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_AUTHOR', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_DATE', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_THUMBNAIL', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_CATEGORY', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_SHARER', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_TAGS', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_DESCRIPTION', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.1.2.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.1.2.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_2($object)
|
||||
{
|
||||
Configuration::updateValue('PH_RECENTPOSTS_LAYOUT', 'grid');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.1.4.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.1.4.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_4($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_CAT_DESC', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.1.5.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.1.5.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_5($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_POST_BY_AUTHOR', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.1.6.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.1.6.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_6($object)
|
||||
{
|
||||
$object->registerHook('displaySimpleBlogCategories');
|
||||
|
||||
return true;
|
||||
}
|
||||
19
modules/ph_simpleblog/upgrade/install-1.1.7.php
Normal file
19
modules/ph_simpleblog/upgrade/install-1.1.7.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_7($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_LOAD_FA', '0');
|
||||
Configuration::updateValue('PH_BLOG_FB_INIT', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.1.8.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.1.8.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_8($object)
|
||||
{
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD featured TEXT NOT NULL AFTER cover');
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.1.9.1.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.1.9.1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9_1($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.1.9.2.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.1.9.2.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9_2($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.1.9.3.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.1.9.3.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9_3($object)
|
||||
{
|
||||
if (file_exists(_PS_MODULE_DIR_.'ph_simpleblog/controllers/admin/AdminSimpleBlogSettings.php')) {
|
||||
@unlink(_PS_MODULE_DIR_.'ph_simpleblog/controllers/admin/AdminSimpleBlogSettings.php');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.1.9.4.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.1.9.4.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9_4($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.1.9.5.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.1.9.5.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9_5($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_BREADCRUMBS', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.1.9.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.1.9.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_9($object)
|
||||
{
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD logged tinyint(1) NOT NULL DEFAULT \'0\' AFTER is_featured');
|
||||
}
|
||||
32
modules/ph_simpleblog/upgrade/install-1.2.0.0.php
Normal file
32
modules/ph_simpleblog/upgrade/install-1.2.0.0.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_0($object)
|
||||
{
|
||||
// Cover
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_category` ADD cover VARCHAR(5) NOT NULL AFTER id_simpleblog_category');
|
||||
|
||||
// Position
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_category` ADD position int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER cover');
|
||||
|
||||
// Likes
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD likes INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER author');
|
||||
|
||||
// Views
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD views INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER likes');
|
||||
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_CATEGORY_IMAGE', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_LIKES', '1');
|
||||
Configuration::updateValue('PH_BLOG_DISPLAY_VIEWS', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
19
modules/ph_simpleblog/upgrade/install-1.2.0.1.php
Normal file
19
modules/ph_simpleblog/upgrade/install-1.2.0.1.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_1($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_CATEGORY_IMAGE_X', '535');
|
||||
Configuration::updateGlobalValue('PH_CATEGORY_IMAGE_Y', '150');
|
||||
|
||||
return true;
|
||||
}
|
||||
19
modules/ph_simpleblog/upgrade/install-1.2.0.2.php
Normal file
19
modules/ph_simpleblog/upgrade/install-1.2.0.2.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_2($object)
|
||||
{
|
||||
// Position
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_category` ADD id_parent int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER position');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.2.0.3.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.2.0.3.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_3($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_CATEGORY_SORTBY', 'position');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.4.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.4.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_4($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.5.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.5.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_5($object)
|
||||
{
|
||||
return $object->registerHook('displayBackOfficeHeader') && $object->registerHook('displayAdminHomeQuickLinks');
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.6.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.6.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_6($object)
|
||||
{
|
||||
return Configuration::updateGlobalValue('PH_BLOG_DATEFORMAT', 'd M Y, H:i');
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.7.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.7.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_7($object)
|
||||
{
|
||||
return Configuration::updateGlobalValue('PH_RECENTPOSTS_GRID_COLUMNS', Configuration::get('PH_BLOG_GRID_COLUMNS'));
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.8.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.8.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_8($object)
|
||||
{
|
||||
return Configuration::updateGlobalValue('PH_RELATEDPOSTS_GRID_COLUMNS', Configuration::get('PH_BLOG_GRID_COLUMNS'));
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.0.9.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.0.9.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_0_9($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.2.1.0.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.2.1.0.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_1_0($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
109
modules/ph_simpleblog/upgrade/install-1.2.2.0.php
Normal file
109
modules/ph_simpleblog/upgrade/install-1.2.2.0.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_0($object)
|
||||
{
|
||||
Shop::setContext(Shop::CONTEXT_ALL);
|
||||
|
||||
$sql = array();
|
||||
|
||||
/*
|
||||
|
||||
AUTHORS
|
||||
|
||||
**/
|
||||
// $sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_author` (
|
||||
// `id_simpleblog_author` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
// `firstname` VARCHAR(60) NOT NULL,
|
||||
// `lastname` VARCHAR(60) NOT NULL,
|
||||
// `email` VARCHAR(60) NOT NULL,
|
||||
// `bio` TEXT NOT NULL,
|
||||
// `www` VARCHAR(255) NOT NULL,
|
||||
// `facebook` TEXT NOT NULL,
|
||||
// `google` TEXT NOT NULL,
|
||||
// `linkedin` TEXT NOT NULL,
|
||||
// `twitter` TEXT NOT NULL,
|
||||
// PRIMARY KEY (`id_simpleblog_author`)
|
||||
// ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
// Only for PrestaShop 1.6...
|
||||
// $tab = new Tab()
|
||||
|
||||
// $tab->name = array();
|
||||
// foreach (Language::getLanguages(true) as $lang)
|
||||
// $tab->name[$lang['id_lang']] = $object->l('Authors');
|
||||
|
||||
// $tab->class_name = 'AdminSimpleBlogAuthors';
|
||||
// $tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
|
||||
// $tab->module = $object->name;
|
||||
// $tab->add();
|
||||
|
||||
Configuration::updateGlobalValue('PH_BLOG_NEW_AUTHORS', '0');
|
||||
Configuration::updateGlobalValue('PH_BLOG_AUTHOR_INFO', '1');
|
||||
|
||||
/*
|
||||
|
||||
COMMENTS
|
||||
|
||||
**/
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_comment` (
|
||||
`id_simpleblog_comment` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_simpleblog_post` INT( 11 ) DEFAULT NULL,
|
||||
`id_parent` INT( 11 ) DEFAULT NULL,
|
||||
`id_customer` INT( 11 ) DEFAULT NULL,
|
||||
`id_guest` INT( 11 ) DEFAULT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`email` varchar(255) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL,
|
||||
`ip` varchar(255) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_comment`)
|
||||
) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
$tab = new Tab();
|
||||
|
||||
$tab->name = array();
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$tab->name[$lang['id_lang']] = $object->l('Comments');
|
||||
}
|
||||
|
||||
$tab->class_name = 'AdminSimpleBlogComments';
|
||||
$tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
|
||||
$tab->module = $object->name;
|
||||
$tab->add();
|
||||
|
||||
Configuration::updateGlobalValue('PH_BLOG_NATIVE_COMMENTS', '0');
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_NOTIFICATIONS', '0');
|
||||
|
||||
/*
|
||||
|
||||
NEW STYLE OF POSTS ACCESS
|
||||
|
||||
**/
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD access TEXT NOT NULL AFTER is_featured');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD id_simpleblog_author INT( 11 ) UNSIGNED NOT NULL DEFAULT 0 AFTER id_simpleblog_category');
|
||||
|
||||
/*
|
||||
|
||||
DB
|
||||
|
||||
**/
|
||||
foreach ($sql as $s) {
|
||||
if (!Db::getInstance()->Execute($s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.2.2.2.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.2.2.2.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_2($object)
|
||||
{
|
||||
Shop::setContext(Shop::CONTEXT_ALL);
|
||||
|
||||
$object->registerHook('displayTop');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.2.2.3.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.2.2.3.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_3($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_AUTO_APPROVAL', '0');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.2.2.4.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.2.2.4.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_4($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD allow_comments tinyint(1) DEFAULT 3 NOT NULL AFTER views');
|
||||
|
||||
return true;
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.2.2.5.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.2.2.5.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_5($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_STUFF_HIGHLIGHT', 1);
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_ALLOW', 0);
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_NOTIFY_EMAIL', Configuration::get('PS_SHOP_EMAIL'));
|
||||
|
||||
return true;
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.2.2.6.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.2.2.6.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_6($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_MODERATOR', '');
|
||||
Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_APP_ID', '');
|
||||
Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_COLOR_SCHEME', 'light');
|
||||
|
||||
return true;
|
||||
}
|
||||
28
modules/ph_simpleblog/upgrade/install-1.2.2.7.php
Normal file
28
modules/ph_simpleblog/upgrade/install-1.2.2.7.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_7($object)
|
||||
{
|
||||
Shop::setContext(Shop::CONTEXT_ALL);
|
||||
|
||||
/*
|
||||
|
||||
Possibility to set meta_title other then title
|
||||
|
||||
**/
|
||||
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post_lang` ADD title VARCHAR(255) NOT NULL AFTER id_lang');
|
||||
|
||||
Db::getInstance()->query('UPDATE `'._DB_PREFIX_.'simpleblog_post_lang` spl, `'._DB_PREFIX_.'simpleblog_post_lang` spl2 SET spl.title = spl2.meta_title WHERE spl.id_simpleblog_post = spl2.id_simpleblog_post');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.2.2.8.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.2.2.8.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_8($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_DISPLAY_MORE', '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
39
modules/ph_simpleblog/upgrade/install-1.2.2.9.php
Normal file
39
modules/ph_simpleblog/upgrade/install-1.2.2.9.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_2_2_9($object)
|
||||
{
|
||||
// Make sure that posts for logged only are properly assigned to new access system:
|
||||
$posts = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'simpleblog_post`');
|
||||
$available_groups = Group::getGroups(Context::getContext()->language->id);
|
||||
|
||||
foreach ($posts as $post) {
|
||||
$post_access = array();
|
||||
|
||||
if ($post['logged'] == 1) {
|
||||
foreach ($available_groups as $group) {
|
||||
if ($group['id_group'] == Configuration::get('PS_UNIDENTIFIED_GROUP') || $group['id_group'] == Configuration::get('PS_GUEST_GROUP')) {
|
||||
$post_access[$group['id_group']] = false;
|
||||
} else {
|
||||
$post_access[$group['id_group']] = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($available_groups as $group) {
|
||||
$post_access[$group['id_group']] = true;
|
||||
}
|
||||
}
|
||||
Db::getInstance()->update('simpleblog_post', array('access' => serialize($post_access)), 'id_simpleblog_post = '.$post['id_simpleblog_post']);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.0.0.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.0.0.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_0_0($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
20
modules/ph_simpleblog/upgrade/install-1.3.0.1.php
Normal file
20
modules/ph_simpleblog/upgrade/install-1.3.0.1.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_0_1($object)
|
||||
{
|
||||
@unlink(_PS_MODULE_DIR_.'ph_simpleblog/assets/index.php');
|
||||
@unlink(_PS_MODULE_DIR_.'ph_simpleblog/assets/phpthumb/index.php');
|
||||
@unlink(_PS_MODULE_DIR_.'ph_simpleblog/assets/phpthumb/thumb_plugins/index.php');
|
||||
|
||||
return true;
|
||||
}
|
||||
46
modules/ph_simpleblog/upgrade/install-1.3.1.0.php
Normal file
46
modules/ph_simpleblog/upgrade/install-1.3.1.0.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_0($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post_lang` ADD video_code TEXT AFTER content');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post_lang` ADD external_url TEXT AFTER video_code');
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_post_image` (
|
||||
`id_simpleblog_post_image` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_simpleblog_post` INT( 11 ) UNSIGNED NOT NULL,
|
||||
`position` int(10) UNSIGNED NOT NULL,
|
||||
`image` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_post_image`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_post_product` (
|
||||
`id_simpleblog_post` INT( 11 ) UNSIGNED NOT NULL,
|
||||
`id_product` INT( 11 ) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_post`,`id_product`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
/*
|
||||
|
||||
DB
|
||||
|
||||
**/
|
||||
foreach ($sql as $s) {
|
||||
if (!Db::getInstance()->Execute($s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
39
modules/ph_simpleblog/upgrade/install-1.3.1.1.php
Normal file
39
modules/ph_simpleblog/upgrade/install-1.3.1.1.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_1($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` DROP COLUMN logged');
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'simpleblog_post_type` (
|
||||
`id_simpleblog_post_type` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(255),
|
||||
`slug` VARCHAR(255),
|
||||
`description` TEXT,
|
||||
PRIMARY KEY (`id_simpleblog_post_type`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
/*
|
||||
|
||||
DB
|
||||
|
||||
**/
|
||||
foreach ($sql as $s) {
|
||||
if (!Db::getInstance()->Execute($s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.1.2.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.1.2.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_2($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD id_simpleblog_post_type int(11) UNSIGNED NOT NULL DEFAULT 1 AFTER id_simpleblog_category');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.1.3.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.1.3.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_3($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
22
modules/ph_simpleblog/upgrade/install-1.3.1.4.php
Normal file
22
modules/ph_simpleblog/upgrade/install-1.3.1.4.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_4($object)
|
||||
{
|
||||
$posts = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'simpleblog_post`');
|
||||
|
||||
foreach ($posts as $post) {
|
||||
Db::getInstance()->update('simpleblog_post', array('id_simpleblog_post_type' => 1), 'id_simpleblog_post = '.$post['id_simpleblog_post']);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
37
modules/ph_simpleblog/upgrade/install-1.3.1.5.php
Normal file
37
modules/ph_simpleblog/upgrade/install-1.3.1.5.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_5($object)
|
||||
{
|
||||
$default_post_type = new SimpleBlogPostType();
|
||||
$default_post_type->name = 'Post';
|
||||
$default_post_type->slug = 'post';
|
||||
$default_post_type->description = 'Default type of post';
|
||||
$default_post_type->add();
|
||||
|
||||
$gallery_post_type = new SimpleBlogPostType();
|
||||
$gallery_post_type->name = 'Gallery';
|
||||
$gallery_post_type->slug = 'gallery';
|
||||
$gallery_post_type->add();
|
||||
|
||||
$external_url_post_type = new SimpleBlogPostType();
|
||||
$external_url_post_type->name = 'External URL';
|
||||
$external_url_post_type->slug = 'url';
|
||||
$external_url_post_type->add();
|
||||
|
||||
$video_post_type = new SimpleBlogPostType();
|
||||
$video_post_type->name = 'Video';
|
||||
$video_post_type->slug = 'video';
|
||||
$video_post_type->add();
|
||||
|
||||
return true;
|
||||
}
|
||||
24
modules/ph_simpleblog/upgrade/install-1.3.1.6.php
Normal file
24
modules/ph_simpleblog/upgrade/install-1.3.1.6.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_6($object)
|
||||
{
|
||||
if (function_exists('date_default_timezone_get')) {
|
||||
$timezone = @date_default_timezone_get();
|
||||
} else {
|
||||
$timezone = 'Europe/Warsaw';
|
||||
}
|
||||
|
||||
Configuration::updateGlobalValue('PH_BLOG_TIMEZONE', $timezone);
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.1.7.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.1.7.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_7($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
30
modules/ph_simpleblog/upgrade/install-1.3.1.8.php
Normal file
30
modules/ph_simpleblog/upgrade/install-1.3.1.8.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_8($object)
|
||||
{
|
||||
$sql = 'SHOW COLUMNS FROM `'._DB_PREFIX_.'simpleblog_post_image`';
|
||||
$simpleblog_post_image = Db::getInstance()->executeS($sql);
|
||||
|
||||
$needUpgrade = true;
|
||||
foreach ($simpleblog_post_image as $column) {
|
||||
if ($column['Field'] == 'image') {
|
||||
$needUpgrade = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($needUpgrade === true) {
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post_image` CHANGE filename image varchar(255) NOT NULL');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
21
modules/ph_simpleblog/upgrade/install-1.3.1.9.php
Normal file
21
modules/ph_simpleblog/upgrade/install-1.3.1.9.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_1_9($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_LOAD_FONT_AWESOME', 1);
|
||||
Configuration::updateGlobalValue('PH_BLOG_LOAD_BXSLIDER', 1);
|
||||
Configuration::updateGlobalValue('PH_BLOG_LOAD_MASONRY', 1);
|
||||
Configuration::updateGlobalValue('PH_BLOG_LOAD_FITVIDS', 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.2.0.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.2.0.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_0($object)
|
||||
{
|
||||
$object->registerHook('displayPrestaHomeBlogAfterPostContent');
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.2.1.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.2.1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_1($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.2.10.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.2.10.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_10()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
46
modules/ph_simpleblog/upgrade/install-1.3.2.11.php
Normal file
46
modules/ph_simpleblog/upgrade/install-1.3.2.11.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_11($object)
|
||||
{
|
||||
$themes = Theme::getThemes();
|
||||
$theme_meta_value = array();
|
||||
foreach ($object->controllers as $controller) {
|
||||
$page = 'module-'.$object->name.'-'.$controller;
|
||||
$result = Db::getInstance()->getValue('SELECT * FROM '._DB_PREFIX_.'meta WHERE page="'.pSQL($page).'"');
|
||||
if ((int) $result > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$meta = new Meta();
|
||||
$meta->page = $page;
|
||||
$meta->configurable = 0;
|
||||
$meta->save();
|
||||
if ((int) $meta->id > 0) {
|
||||
foreach ($themes as $theme) {
|
||||
$theme_meta_value[] = array(
|
||||
'id_theme' => $theme->id,
|
||||
'id_meta' => $meta->id,
|
||||
'left_column' => (int) $theme->default_left_column,
|
||||
'right_column' => (int) $theme->default_right_column,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$object->_errors[] = sprintf(Tools::displayError('Unable to install controller: %s'), $controller);
|
||||
}
|
||||
}
|
||||
if (count($theme_meta_value) > 0) {
|
||||
return Db::getInstance()->insert('theme_meta', $theme_meta_value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
26
modules/ph_simpleblog/upgrade/install-1.3.2.2.php
Normal file
26
modules/ph_simpleblog/upgrade/install-1.3.2.2.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_2($object)
|
||||
{
|
||||
if (!Shop::isFeatureActive()) {
|
||||
$categories = SimpleBlogCategory::getCategories(Context::getContext()->language->id, false);
|
||||
|
||||
foreach ($categories as $id_category => $category) {
|
||||
$instance = new SimpleBlogCategory($id_category, Context::getContext()->language->id);
|
||||
$instance->associateTo(Shop::getCompleteListOfShopsID());
|
||||
unset($instance);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.2.4.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.2.4.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_4($object)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'simpleblog_post` ADD id_product TEXT AFTER featured');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.2.5.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.2.5.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_5($object)
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_DISPLAY_RELATED', 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.2.6.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.2.6.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_6($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.2.7.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.2.7.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_7($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
22
modules/ph_simpleblog/upgrade/install-1.3.2.8.php
Normal file
22
modules/ph_simpleblog/upgrade/install-1.3.2.8.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_8()
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENT_ALLOW_GUEST', false);
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA', true);
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_SITE_KEY', '');
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_SECRET_KEY', '');
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_THEME', 'light');
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.2.9.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.2.9.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_2_9()
|
||||
{
|
||||
Configuration::updateGlobalValue('PH_BLOG_RELATED_PRODUCTS_USE_DEFAULT_LIST', false);
|
||||
|
||||
return true;
|
||||
}
|
||||
18
modules/ph_simpleblog/upgrade/install-1.3.3.php
Normal file
18
modules/ph_simpleblog/upgrade/install-1.3.3.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_3($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_ADVERTISING', true);
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.4.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.4.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_4($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.5.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.5.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_5($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.6.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.6.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_6($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.3.7.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.3.7.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_3_7($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
22
modules/ph_simpleblog/upgrade/install-1.4.0.php
Normal file
22
modules/ph_simpleblog/upgrade/install-1.4.0.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_4_0($object)
|
||||
{
|
||||
if (Configuration::get('PH_BLOG_NATIVE_COMMENTS')) {
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_SYSTEM', 'native');
|
||||
} else {
|
||||
Configuration::updateGlobalValue('PH_BLOG_COMMENTS_SYSTEM', 'facebook');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.4.1.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.4.1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_4_1($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.5.0.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.5.0.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2014-2016 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_5_0($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
25
modules/ph_simpleblog/upgrade/install-1.6.0.php
Normal file
25
modules/ph_simpleblog/upgrade/install-1.6.0.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2008-2019 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_0($module)
|
||||
{
|
||||
if ($module->is_17) {
|
||||
$module->myDeleteModuleTabs();
|
||||
$tabs = $module->tabs;
|
||||
foreach ($tabs as $tab) {
|
||||
$tabName = isset($tab['name'][Context::getContext()->language->iso_code]) ? $tab['name'][Context::getContext()->language->iso_code] : $tab['name']['en'];
|
||||
$module->myInstallModuleTab($tabName, $tab['class_name'], Tab::getIdFromClassName($tab['parent_class_name']));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.6.1.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.6.1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2008-2019 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_1($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
17
modules/ph_simpleblog/upgrade/install-1.6.3.php
Normal file
17
modules/ph_simpleblog/upgrade/install-1.6.3.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2008-2019 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_3($object)
|
||||
{
|
||||
Configuration::updateValue('PH_BLOG_IMAGE_FBSHARE', 'featured');
|
||||
return true;
|
||||
}
|
||||
16
modules/ph_simpleblog/upgrade/install-1.6.4.php
Normal file
16
modules/ph_simpleblog/upgrade/install-1.6.4.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2008-2019 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_4($object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
109
modules/ph_simpleblog/upgrade/install-1.7.0.php
Normal file
109
modules/ph_simpleblog/upgrade/install-1.7.0.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* Blog for PrestaShop module by Krystian Podemski from PrestaHome.
|
||||
*
|
||||
* @author Krystian Podemski <krystian@prestahome.com>
|
||||
* @copyright Copyright (c) 2008-2019 Krystian Podemski - www.PrestaHome.com / www.Podemski.info
|
||||
* @license You only can use module, nothing more!
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_7_0($module)
|
||||
{
|
||||
// migrate tabs for PrestaShop 1.7 new way (fix permission issues)
|
||||
if ($module->is_17) {
|
||||
$module->myDeleteModuleTabs();
|
||||
$module->createAllModuleTabs();
|
||||
}
|
||||
|
||||
if ($module->is_16) {
|
||||
$module->myInstallModuleTab(
|
||||
$module->l('Authors'),
|
||||
'AdminSimpleBlogAuthors',
|
||||
(int) Tab::getIdFromClassName('AdminSimpleBlog')
|
||||
);
|
||||
}
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_author` (
|
||||
`id_simpleblog_author` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`firstname` VARCHAR(60) NOT NULL,
|
||||
`lastname` VARCHAR(60) NOT NULL,
|
||||
`photo` TEXT NOT NULL,
|
||||
`email` VARCHAR(130) NOT NULL,
|
||||
`facebook` TEXT NOT NULL,
|
||||
`google` TEXT NOT NULL,
|
||||
`linkedin` TEXT NOT NULL,
|
||||
`twitter` TEXT NOT NULL,
|
||||
`instagram` TEXT NOT NULL,
|
||||
`phone` TEXT NOT NULL,
|
||||
`www` VARCHAR(255) NOT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_author`)
|
||||
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_author_lang` (
|
||||
`id_simpleblog_author` int(10) UNSIGNED NOT NULL,
|
||||
`id_lang` INT( 11 ) UNSIGNED NOT NULL,
|
||||
`bio` TEXT NOT NULL,
|
||||
`additional_info` TEXT NOT NULL,
|
||||
PRIMARY KEY (`id_simpleblog_author`,`id_lang`)
|
||||
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
foreach ($sql as $s) {
|
||||
if (!Db::getInstance()->Execute($s)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Configuration::updateGlobalValue('PH_BLOG_NEW_AUTHORS', '0');
|
||||
Configuration::updateGlobalValue('PH_BLOG_AUTHOR_INFO', '1');
|
||||
|
||||
if ($module->is_16) {
|
||||
$themes = Theme::getThemes();
|
||||
$theme_meta_value = array();
|
||||
foreach ($module->controllers as $controller) {
|
||||
$page = 'module-'.$module->name.'-'.$controller;
|
||||
$result = Db::getInstance()->getValue('SELECT * FROM '._DB_PREFIX_.'meta WHERE page="'.pSQL($page).'"');
|
||||
if ((int) $result > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$meta = new Meta();
|
||||
$meta->page = $page;
|
||||
$meta->configurable = 0;
|
||||
$meta->save();
|
||||
if ((int) $meta->id > 0) {
|
||||
foreach ($themes as $theme) {
|
||||
$theme_meta_value[] = array(
|
||||
'id_theme' => $theme->id,
|
||||
'id_meta' => $meta->id,
|
||||
'left_column' => false,
|
||||
'right_column' => false,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$module->_errors[] = sprintf(Tools::displayError('Unable to install controller: %s'), $controller);
|
||||
}
|
||||
}
|
||||
if (count($theme_meta_value) > 0) {
|
||||
return Db::getInstance()->insert('theme_meta', $theme_meta_value);
|
||||
}
|
||||
} else {
|
||||
foreach ($module->controllers as $controller) {
|
||||
$page = 'module-' . $module->name . '-' . $controller;
|
||||
$result = Db::getInstance()->getValue('SELECT * FROM ' . _DB_PREFIX_ . 'meta WHERE page="' . pSQL($page) . '"');
|
||||
if ((int) $result > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$meta = new Meta();
|
||||
$meta->page = $page;
|
||||
$meta->configurable = 1;
|
||||
$meta->save();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user