Example #1
0
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;
}
 public function renderForm()
 {
     $this->initFormToolbar();
     if (!$this->loadObject(true)) {
         return;
     }
     $obj = $this->loadObject(true);
     /**
     
     
                 POST IMAGES
     
     
             **/
     $cover = false;
     $featured = false;
     if (isset($obj->id)) {
         $this->display = 'edit';
         $cover = ImageManager::thumbnail(_PS_MODULE_DIR_ . 'ph_simpleblog/covers/' . $obj->id . '.' . $obj->cover, 'ph_simpleblog_' . $obj->id . '.' . $obj->cover, 350, $obj->cover, false);
         $featured = ImageManager::thumbnail(_PS_MODULE_DIR_ . 'ph_simpleblog/featured/' . $obj->id . '.' . $obj->featured, 'ph_simpleblog_featured_' . $obj->id . '.' . $obj->featured, 350, $obj->featured, false);
     } else {
         $this->display = 'add';
     }
     $this->fields_value = array('cover' => $cover ? $cover : false, 'cover_size' => $cover ? filesize(_PS_MODULE_DIR_ . 'ph_simpleblog/covers/' . $obj->id . '.' . $obj->cover) / 1000 : false, 'featured' => $featured ? $featured : false, 'featured_size' => $featured ? filesize(_PS_MODULE_DIR_ . 'ph_simpleblog/featured/' . $obj->id . '.' . $obj->featured) / 1000 : false);
     /**
     
     
                 POST TAGS
                 
     
             **/
     $obj->tags = SimpleBlogTag::getPostTags($obj->id);
     /**
     
     
                 GLOBAL $
                 
     
             **/
     $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
     $this->tpl_form_vars['languages'] = $this->_languages;
     $this->tpl_form_vars['simpleblogpost'] = $obj;
     $this->tpl_form_vars['is_16'] = $this->is_16;
     /**
     
     
                 POST ACCESS
                 
     
             **/
     if (isset($obj->id) && $obj->access) {
         $groupAccess = unserialize($obj->access);
         foreach ($groupAccess as $groupAccessID => $value) {
             $groupBox = 'groupBox_' . $groupAccessID;
             $this->fields_value[$groupBox] = $value;
         }
     } else {
         $groups = Group::getGroups($this->context->language->id);
         $preselected = array(Configuration::get('PS_UNIDENTIFIED_GROUP'), Configuration::get('PS_GUEST_GROUP'), Configuration::get('PS_CUSTOMER_GROUP'));
         foreach ($groups as $group) {
             $this->fields_value['groupBox_' . $group['id_group']] = in_array($group['id_group'], $preselected);
         }
     }
     /**
     
             Default publication date for new posts
     
             **/
     if (!isset($obj->id)) {
         $this->fields_value['date_add'] = date('Y-m-d H:i:s');
     }
     $available_categories = SimpleBlogCategory::getCategories($this->context->language->id, true, false);
     foreach ($available_categories as &$category) {
         if ($category['is_child']) {
             $category['name'] = '     ' . $category['name'];
         }
     }
     $i = 0;
     $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('SimpleBlog Post'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'select', 'label' => $this->l('Post type:'), 'name' => 'id_simpleblog_post_type', 'required' => true, 'options' => array('id' => 'id_simpleblog_post_type', 'query' => SimpleBlogPostType::getAll(), 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Category:'), 'name' => 'id_simpleblog_category', 'required' => true, 'options' => array('id' => 'id', 'query' => $available_categories, 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Author:'), 'name' => 'author'), array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'title', 'required' => true, 'lang' => true, 'id' => 'name', 'class' => 'copyNiceUrl'), array('type' => 'textarea', 'label' => $this->l('Short content:'), 'name' => 'short_content', 'lang' => true, 'rows' => 5, 'cols' => 40, 'autoload_rte' => true), array('type' => 'textarea', 'label' => $this->l('Full post content:'), 'name' => 'content', 'lang' => true, 'rows' => 15, 'cols' => 40, 'autoload_rte' => true), array('type' => 'tags', 'label' => $this->l('Tags:'), 'desc' => $this->l('separate by comma for eg. ipod, apple, something'), 'name' => 'tags', 'required' => false, 'lang' => true), array('type' => 'switch', 'label' => $this->l('Featured?'), 'name' => 'is_featured', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'is_featured_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'is_featured_off', 'value' => 0, 'label' => $this->l('No')))), array('type' => 'switch', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Allow comments?'), 'name' => 'allow_comments', 'required' => false, 'class' => 't', 'values' => array(array('id' => 'allow_comments_1', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'allow_comments_2', 'value' => 2, 'label' => $this->l('No')), array('id' => 'allow_comments_3', 'value' => 3, 'label' => $this->l('Use global setting'))))), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
     $i++;
     if (isset($obj->id)) {
         $this->addjQueryPlugin(array('thickbox', 'ajaxfileupload'));
         // Get images
         $images = SimpleBlogPostImage::getAllById($obj->id);
         foreach ($images as $k => $image) {
             $images[$k] = new SimpleBlogPostImage($image['id_simpleblog_post_image']);
         }
         $image_uploader = new HelperImageUploader('file');
         $image_uploader->setMultiple(!(Tools::getUserBrowser() == 'Apple Safari' && Tools::getUserPlatform() == 'Windows'))->setUseAjax(true)->setUrl(Context::getContext()->link->getAdminLink('AdminSimpleBlogPosts') . '&ajax=1&id_simpleblog_post=' . (int) $obj->id . '&action=addPostImages');
         $this->tpl_form_vars['images'] = $images;
         $this->tpl_form_vars['image_uploader'] = $image_uploader->render();
         $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Post type options'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'text', 'label' => $this->l('External URL:'), 'name' => 'external_url', 'form_group_class' => 'simpleblog-post-type simpleblog-post-type-' . SimpleBlogPostType::getIdBySlug('url'), 'lang' => true), array('type' => 'textarea', 'label' => $this->l('Video embed code:'), 'name' => 'video_code', 'lang' => true, 'form_group_class' => 'simpleblog-post-type simpleblog-post-type-' . SimpleBlogPostType::getIdBySlug('video'), 'desc' => $this->l('Remember to "Allow iframes on HTML fields" in Preferences -> General')), array('type' => 'file', 'multiple' => true, 'ajax' => true, 'name' => 'post_images', 'label' => $this->l('Add images to gallery'), 'required' => false, 'lang' => false, 'form_group_class' => 'simpleblog-post-type simpleblog-post-type-' . SimpleBlogPostType::getIdBySlug('gallery'))), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
         $i++;
     } else {
         $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Post type options'), 'icon' => 'icon-folder-close'), 'description' => $this->l('Specific post type options will be available after saving post'));
         $i++;
     }
     $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Post Images'), 'image' => $this->is_16 ? null : '../img/t/AdminImages.gif', 'icon' => 'icon-picture'), 'input' => array(array('type' => 'file', 'label' => $this->l('Post cover:'), 'display_image' => true, 'name' => 'cover', 'desc' => $this->l('Upload a image from your computer.')), array('type' => 'file', 'label' => $this->l('Post featured image:'), 'display_image' => true, 'name' => 'featured', 'desc' => $this->l('Upload a image from your computer. Featured image will be displayed only if you want on the single post page.'))), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
     $i++;
     $available_products = self::getSimpleProducts($this->context->language->id);
     foreach ($available_products as &$available_related_product) {
         if (empty($available_related_product['product_name'])) {
             if (isset($available_related_product['name']) && !empty($available_related_product['name'])) {
                 $available_related_product['product_name'] = $available_related_product['name'];
             }
         }
     }
     $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Related products')), 'input' => array(array('type' => 'select', 'label' => $this->l('Product:'), 'name' => 'id_product[]', 'id' => 'select_product', 'multiple' => true, 'required' => false, 'options' => array('id' => 'id_product', 'query' => $available_products, 'name' => 'product_name'))), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
     $i++;
     $this->fields_value['id_product[]'] = explode(',', $obj->id_product);
     $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('SEO'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'lang' => true), array('type' => 'text', 'label' => $this->l('Meta description:'), 'name' => 'meta_description', 'lang' => true), array('type' => 'text', 'label' => $this->l('Meta keywords:'), 'name' => 'meta_keywords', 'lang' => true), array('type' => 'text', 'label' => $this->l('Friendly URL:'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true)), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
     $i++;
     $unidentified = new Group(Configuration::get('PS_UNIDENTIFIED_GROUP'));
     $guest = new Group(Configuration::get('PS_GUEST_GROUP'));
     $default = new Group(Configuration::get('PS_CUSTOMER_GROUP'));
     $unidentified_group_information = sprintf($this->l('%s - All people without a valid customer account.'), '<b>' . $unidentified->name[$this->context->language->id] . '</b>');
     $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the guest checkout.'), '<b>' . $guest->name[$this->context->language->id] . '</b>');
     $default_group_information = sprintf($this->l('%s - All people who have created an account on this site.'), '<b>' . $default->name[$this->context->language->id] . '</b>');
     $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Availability')), 'input' => array(array('type' => 'datetime', 'label' => $this->l('Publication date:'), 'name' => 'date_add', 'desc' => $this->l('Remember to set correctly your timezone in Simple Blog -> Settings. Current timezone:') . ' ' . Configuration::get('PH_BLOG_TIMEZONE') . ', ' . $this->l('current time with this setting:') . ' ' . SimpleBlogHelper::now(Configuration::get('PH_BLOG_TIMEZONE')), 'required' => true), array('type' => 'group', 'label' => $this->l('Group access'), 'name' => 'groupBox', 'values' => Group::getGroups(Context::getContext()->language->id), 'info_introduction' => $this->l('You now have three default customer groups.'), 'unidentified' => $unidentified_group_information, 'guest' => $guest_group_information, 'customer' => $default_group_information, 'hint' => $this->l('Mark all of the customer groups which you would like to have access to this category.'))), 'submit' => array('title' => $this->l('Save and stay'), 'class' => 'button', 'stay' => true));
     $i++;
     if (Shop::isFeatureActive()) {
         $this->fields_form[$i]['form'] = array('legend' => array('title' => $this->l('Shop association:')), 'input' => array(array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso')));
     }
     $this->multiple_fieldsets = true;
     return parent::renderForm();
 }
Example #3
0
 public static function getPosts($id_lang, $limit = 10, $id_simpleblog_category = null, $page = null, $active = true, $orderby = false, $orderway = false, $exclude = null, $featured = false, $author = false, $id_shop = null, $filter = false, $selected = array(), $check_access = true)
 {
     $context = Context::getContext();
     $start = $limit * ($page == 0 ? 0 : $page - 1);
     $sql = new DbQuery();
     $sql->select('*');
     $sql->from('simpleblog_post', 'sbp');
     if ($id_lang) {
         $sql->innerJoin('simpleblog_post_lang', 'l', 'sbp.id_simpleblog_post = l.id_simpleblog_post AND l.id_lang = ' . (int) $id_lang);
     }
     if (!$id_shop) {
         $id_shop = $context->shop->id;
     }
     $sql->innerJoin('simpleblog_post_shop', 'sbps', 'sbp.id_simpleblog_post = sbps.id_simpleblog_post AND sbps.id_shop = ' . (int) $id_shop);
     if ($active) {
         $sql->where('sbp.active = 1');
     }
     if (isset($id_simpleblog_category) && (int) $id_simpleblog_category > 0) {
         $childrens = SimpleBlogCategory::getChildrens((int) $id_simpleblog_category);
         if ($childrens && sizeof($childrens)) {
             $child_categories = array((int) $id_simpleblog_category);
             foreach ($childrens as $child) {
                 $child_categories[] = $child['id_simpleblog_category'];
             }
             $sql->where('sbp.id_simpleblog_category IN (' . join(',', $child_categories) . ')');
         } else {
             $sql->where('sbp.id_simpleblog_category = ' . (int) $id_simpleblog_category);
         }
     }
     if ($exclude) {
         $sql->where('sbp.id_simpleblog_post != ' . (int) $exclude);
     }
     if ($featured) {
         $sql->where('sbp.is_featured = 1');
     }
     if ($author && Configuration::get('PH_BLOG_POST_BY_AUTHOR')) {
         $sql->where('sbp.author = \'' . pSQL($author) . '\'');
     }
     if ($filter) {
         $sql->where('sbp.id_simpleblog_post ' . $filter . ' (' . join(',', $selected) . ')');
     }
     $sql->where('sbp.date_add <= \'' . SimpleBlogHelper::now(Configuration::get('PH_BLOG_TIMEZONE')) . '\'');
     if (!$orderby) {
         $orderby = 'sbp.date_add';
     }
     if (!$orderway) {
         $orderway = 'DESC';
     }
     $sql->orderBy($orderby . ' ' . $orderway);
     $sql->limit($limit, $start);
     $result = Db::getInstance()->executeS($sql);
     if (sizeof($result) && $check_access == true) {
         $result = self::checkAccess($result);
     }
     if (sizeof($result)) {
         foreach ($result as &$row) {
             $category_rewrite = SimpleBlogCategory::getRewriteByCategory($row['id_simpleblog_category'], $id_lang);
             $category_obj = new SimpleBlogCategory($row['id_simpleblog_category'], $id_lang);
             $category_url = SimpleBlogCategory::getLink($category_obj->link_rewrite, $id_lang);
             if (file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/covers/' . $row['id_simpleblog_post'] . '.' . $row['cover'])) {
                 $row['banner'] = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $row['id_simpleblog_post'] . '.' . $row['cover'];
                 $row['banner_thumb'] = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $row['id_simpleblog_post'] . '-thumb.' . $row['cover'];
                 $row['banner_wide'] = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $row['id_simpleblog_post'] . '-wide.' . $row['cover'];
             }
             if (file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/featured/' . $row['id_simpleblog_post'] . '.' . $row['featured'])) {
                 $row['featured'] = _MODULE_DIR_ . 'ph_simpleblog/featured/' . $row['id_simpleblog_post'] . '.' . $row['featured'];
             }
             $row['url'] = self::getLink($row['link_rewrite'], $category_obj->link_rewrite, $id_lang);
             $row['category'] = $category_obj->name;
             $row['category_rewrite'] = $category_obj->link_rewrite;
             $row['category_url'] = $category_url;
             $tags = SimpleBlogTag::getPostTags($row['id_simpleblog_post']);
             $row['tags'] = isset($tags[$id_lang]) && sizeof($tags[$id_lang] > 0) ? $tags[$id_lang] : false;
             $row['post_type'] = SimpleBlogPostType::getSlugById($row['id_simpleblog_post_type']);
             if ($row['post_type'] == 'gallery') {
                 $row['gallery'] = SimpleBlogPostImage::getAllById($row['id_simpleblog_post']);
             }
         }
     } else {
         return;
     }
     return $result;
 }
Example #4
0
 public function prepareModuleSettings()
 {
     // Database
     $sql = array();
     include dirname(__FILE__) . '/init/install_sql.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->Execute($s)) {
             die('Error while creating DB');
         }
     }
     /**
     
             Update to 1.6.0.6 problem
     
             **/
     $sql = 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'tab`';
     $tab_columns = Db::getInstance()->executeS($sql);
     $createColumn = true;
     foreach ($tab_columns as $column) {
         if ($column['Field'] == 'hide_host_mode') {
             $createColumn = false;
         }
     }
     if ($createColumn == true) {
         Db::getInstance()->query('ALTER TABLE `' . _DB_PREFIX_ . 'tab` ADD `hide_host_mode` tinyint(1) NOT NULL DEFAULT 0 AFTER  `active`');
     }
     /**
     
             Tabs
     
             **/
     // Tabs
     $parent_tab = new Tab();
     $parent_tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $parent_tab->name[$lang['id_lang']] = $this->l('Blog for PrestaShop');
     }
     $parent_tab->class_name = 'AdminSimpleBlog';
     $parent_tab->id_parent = 0;
     $parent_tab->module = $this->name;
     $parent_tab->add();
     // Categories
     $tab = new Tab();
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->l('Categories');
     }
     $tab->class_name = 'AdminSimpleBlogCategories';
     $tab->id_parent = $parent_tab->id;
     $tab->module = $this->name;
     $tab->add();
     // Posts
     $tab = new Tab();
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->l('Posts');
     }
     $tab->class_name = 'AdminSimpleBlogPosts';
     $tab->id_parent = $parent_tab->id;
     $tab->module = $this->name;
     $tab->add();
     // Authors
     // $tab = new Tab();
     // $tab->name = array();
     // foreach (Language::getLanguages(true) as $lang)
     //     $tab->name[$lang['id_lang']] = $this->l('Authors');
     // $tab->class_name = 'AdminSimpleBlogAuthors';
     // $tab->id_parent = $parent_tab->id;
     // $tab->module = $this->name;
     // $tab->add();
     // Comments
     $tab = new Tab();
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->l('Comments');
     }
     $tab->class_name = 'AdminSimpleBlogComments';
     $tab->id_parent = $parent_tab->id;
     $tab->module = $this->name;
     $tab->add();
     // Tags
     $tab = new Tab();
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->l('Tags');
     }
     $tab->class_name = 'AdminSimpleBlogTags';
     $tab->id_parent = $parent_tab->id;
     $tab->module = $this->name;
     $tab->add();
     // Settings
     $tab = new Tab();
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->l('Settings');
     }
     $tab->class_name = 'AdminSimpleBlogSettings';
     $tab->id_parent = $parent_tab->id;
     $tab->module = $this->name;
     $tab->add();
     $id_lang = $this->context->language->id;
     // Default category
     $simple_blog_category = new SimpleBlogCategory();
     foreach (Language::getLanguages(true) as $lang) {
         $simple_blog_category->name[$lang['id_lang']] = 'News';
     }
     foreach (Language::getLanguages(true) as $lang) {
         $simple_blog_category->link_rewrite[$lang['id_lang']] = 'news';
     }
     $simple_blog_category->add();
     $simple_blog_category->associateTo(Shop::getCompleteListOfShopsID());
     // Post Types
     $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();
     // Settings
     Configuration::updateValue('PH_BLOG_POSTS_PER_PAGE', '10');
     Configuration::updateValue('PH_BLOG_FB_COMMENTS', '1');
     Configuration::updateValue('PH_BLOG_SLUG', 'blog');
     Configuration::updateValue('PH_BLOG_COLUMNS', 'prestashop');
     Configuration::updateValue('PH_BLOG_LAYOUT', 'default');
     Configuration::updateValue('PH_BLOG_LIST_LAYOUT', 'grid');
     Configuration::updateValue('PH_BLOG_GRID_COLUMNS', '2');
     Configuration::updateValue('PH_BLOG_MAIN_TITLE', array($this->context->language->id => 'Blog - whats new?'));
     Configuration::updateValue('PH_BLOG_LOAD_FA', '0');
     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');
     // Thumbnails
     Configuration::updateValue('PH_BLOG_THUMB_METHOD', '1');
     Configuration::updateValue('PH_BLOG_THUMB_X', '600');
     Configuration::updateValue('PH_BLOG_THUMB_Y', '300');
     Configuration::updateValue('PH_BLOG_THUMB_X_WIDE', '900');
     Configuration::updateValue('PH_BLOG_THUMB_Y_WIDE', '350');
     // Recent Posts
     Configuration::updateValue('PH_RECENTPOSTS_NB', '4');
     Configuration::updateValue('PH_RECENTPOSTS_CAT', '0');
     Configuration::updateValue('PH_RECENTPOSTS_POSITION', 'home');
     Configuration::updateValue('PH_RECENTPOSTS_LAYOUT', 'grid');
     // @Since 1.1.4
     // Category description
     Configuration::updateValue('PH_BLOG_DISPLAY_CAT_DESC', '1');
     // @since 1.1.5
     Configuration::updateValue('PH_BLOG_POST_BY_AUTHOR', '1');
     // @since 1.1.7
     Configuration::updateValue('PH_BLOG_FB_INIT', '1');
     // @since 1.1.8
     Configuration::updateValue('PH_BLOG_DISPLAY_FEATURED', '1');
     // @since 1.1.9
     //Configuration::updateValue('PH_BLOG_INSTALL', '1');
     // @since 1.1.9.5
     Configuration::updateValue('PH_BLOG_DISPLAY_BREADCRUMBS', '1');
     // @since 1.2.0.0
     Configuration::updateValue('PH_BLOG_DISPLAY_CATEGORY_IMAGE', '1');
     Configuration::updateValue('PH_BLOG_DISPLAY_LIKES', '1');
     Configuration::updateValue('PH_BLOG_DISPLAY_VIEWS', '1');
     Configuration::updateValue('PH_CATEGORY_IMAGE_X', '900');
     Configuration::updateValue('PH_CATEGORY_IMAGE_Y', '250');
     Configuration::updateValue('PH_CATEGORY_SORTBY', 'position');
     // @since 1.2.0.6
     Configuration::updateValue('PH_BLOG_DATEFORMAT', 'd M Y, H:i');
     Configuration::updateValue('PH_RECENTPOSTS_GRID_COLUMNS', '2');
     Configuration::updateValue('PH_RELATEDPOSTS_GRID_COLUMNS', '2');
     /**
             
             Update 1.2.2.0 - 07.2014
     
             **/
     // Comments
     Configuration::updateGlobalValue('PH_BLOG_NATIVE_COMMENTS', '1');
     Configuration::updateGlobalValue('PH_BLOG_COMMENT_NOTIFICATIONS', '1');
     // Authors
     Configuration::updateGlobalValue('PH_BLOG_NEW_AUTHORS', '0');
     Configuration::updateGlobalValue('PH_BLOG_AUTHOR_INFO', '1');
     /**
             
             Update 1.2.2.3 - 08.2014
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_COMMENT_AUTO_APPROVAL', '0');
     /**
             
             Update 1.2.2.4 - 08.2014
     
             **/
     /**
             
             Update 1.2.2.5 - 08.2014
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_COMMENT_ALLOW', '1');
     Configuration::updateGlobalValue('PH_BLOG_COMMENT_STUFF_HIGHLIGHT', '1');
     Configuration::updateGlobalValue('PH_BLOG_COMMENT_NOTIFY_EMAIL', Configuration::get('PS_SHOP_EMAIL'));
     /**
             
             Update 1.2.2.6 - 09.2014
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_MODERATOR', '');
     Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_APP_ID', '');
     Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_COLOR_SCHEME', 'light');
     /**
     
             Update 1.2.2.8 - 09.2014
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_DISPLAY_MORE', '1');
     /**
     
             Update 1.2.2.9 - 09.2014
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_MASONRY_LAYOUT', '0');
     /**
     
             Update 1.3.1.6 - 10.2014
     
             **/
     if (function_exists('date_default_timezone_get')) {
         $timezone = @date_default_timezone_get();
     } else {
         $timezone = 'Europe/Warsaw';
     }
     Configuration::updateGlobalValue('PH_BLOG_TIMEZONE', $timezone);
     /**
     
             Update 1.3.1.9 - 11.2014
     
             **/
     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);
     /**
     
             Update 1.3.2.5 - 01.2015
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_DISPLAY_RELATED', 1);
     /**
     
             Update 1.3.2.8 - 02.2015
     
             **/
     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');
     /**
     
             Update 1.3.2.9 - 02.2015
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_RELATED_PRODUCTS_USE_DEFAULT_LIST', false);
     /**
     
             Update 1.3.3 - 02.2015
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_ADVERTISING', true);
     /**
     
             Update 1.4.0 - 06.2015
     
             **/
     Configuration::updateGlobalValue('PH_BLOG_COMMENTS_SYSTEM', 'native');
     Configuration::updateGlobalValue('PH_BLOG_DISQUS_SHORTNAME', 'blogforprestashop');
     /**
             
                 For theme developers - you're welcome!
     
             **/
     if (file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/init/my-install.php')) {
         include_once _PS_MODULE_DIR_ . 'ph_simpleblog/init/my-install.php';
     }
     return true;
 }