Leaderboard
Popular Content
Showing content with the highest reputation since 11/04/2025 in all areas
-
ok, it works👍... Thanks again for the help2 points
-
Hello, Ok, this makes more sense now. In your ps_facetedsearch module's configuration, in the template used, you are most likely having Search (experimental) checked in the Pages using this template: section. The problem seems to be the fact that ps_facetedsearch does not execute the actionSearch hook. If you uncheck that option, the default search class will be used in the search page, and this class does implement the hook, so you should start seeing the search keywords inserted into that table.2 points
-
It is online again. I found that the problem was a bit wider. The new version - 1.36m - should solve it.2 points
-
Hello, In PrestaShop9 you can still create an assets/css/custom.css file in the themes/<theme-name> directory, and, as you can see here, the FrontController will add it to the front store pages. The caching does seem to be handled a little bit different, especially for the Hummingbird theme. You will actually need to go to Advanced Parameters -> Performance and clear the cache, in order to see the changes. For speeding up development, you can disable the Smart cache for CSS (in the same Performance page) and on refresh you should see the changes.2 points
-
@El plan de Dan Me parece inadecuado que, en lugar de moderar y aportar al foro, se utilice este espacio para atacar a PrestaShop y promocionar servicios personales. Yo estoy aquĂ para colaborar y ayudar a otros usuarios, no para entrar en conflictos. Le ruego que deje de dirigirse a mĂ de manera insistente, ya que me siento acosado y perseguido. Si tiene algĂşn desacuerdo con PrestaShop, no lo traslade contra quienes participamos de buena fe en la comunidad. Mantengamos el foro como un lugar de respeto y apoyo mutuo, que es lo que realmente beneficia a todos los usuarios.2 points
-
Bonjour, Je ne suis pas contre l’idée du Wall of Fame, mais alors vraiment pas en gros dans le menu général d’un backoffice de ecommerce, ça n’apporte rien pour le bizness, rien pour l’usage, ça surcharge le menu et nuis à l’UX pour rien. Et en termes de crédit pour les contributeurs, un énorme placard du genre a tendance à avoir tout l’effet inverse. Par ailleurs, je ne crois pas être le seul que ça ennuis : https://github.com/PrestaShop/ps_distributionapiclient/issues/62 Ne faites pas la bêtise de désactiver le module ps_distributionapiclient, si ça désactive le Wall of Fame, ça désactive aussi les mises à jour des modules natifs de Prestashop. Faites plutôt cette requête SQL pour le masquer : UPDATE ps_tab SET enabled = 0 WHERE class_name = 'AdminPsdistributionapiclient'; Vous pourrez toujours y accéder depuis cette url : https://votre-site.tld/adminrandom/modules/ps_distributionapiclient/top-contributors?_token=votretoken/ Et pour le réactiver : UPDATE ps_tab SET enabled = 1 WHERE class_name = 'AdminPsdistributionapiclient';2 points
-
Many job seekers struggle with fake listing or unverified employers while applying internationally. I am researching reliable platform that: Connect to verified companies Support international job seekers Provide dashboard/workspace to track applications If anyone knows trusted services for this recommendations appreciated!1 point
-
@El Patron I'm not fighting here... I'm not going to apologize cause people this time getting too easy insulted even when nobody was trying to insult them. Statement you're not reading is because @gaminn writes that search result (looking by/for product number) with his product number is given from the post in prestashop forum with domain extension .com and not showing on search results from his eshop with same extention .com (and you state, that the problem is domain extension). I run through google docs for dev about search results, maybe too fast, but found nothing about domain extension influence an search results (btw @gaminn check on these docs maybe some thoughts after that)... FYI .us=USA domain name extension relevant to country. gTLD's are not country associated so my saying that .com=US (is another bullshait is correct). I said reading helps, so put these in search and check "what is gtld by country" , "domain name extensions by country" , "domain name extensions and search results" . I did not dispute your contribution to this community helping with prestashop issues, but sometimes i have doubts about who is the real author of your answers. @El Patron the saying, that someone who has nothing to do but to change what is working properly - was not about you, but if you think so - it's not my problem. Just read, not imagine (the talk was about search engine rules and data rankings, so I don't think you are making them) ...1 point
-
@willsmith79052 Is this answer based on AI or real experience? Best regards.1 point
-
Stripe paypal then it depends on what country you sell in and providing payment options they are comfortable with, klarna etc.1 point
-
Bonjour, peut être essayez de regarder du coté de vos directives PHP, changez les valeurs pour : memory_limit = 512M max_execution_time = 300 upload_max_filesize = 64M post_max_size = 64M max_input_vars = 5000 ça devrait aider entre autres à faire passer les longs scripts d'installation...1 point
-
Buenas de nuevo! He publicado un segundo vĂdeo sobre el tema MCP en PrestaShop, esta vez centrado en una auditorĂa tĂ©cnica mucho más profunda. Se analiza a rasgos generales quĂ© implica realmente conectar un LLM a una tienda PrestaShop a travĂ©s del mĂłdulo MCP Server, quĂ© herramientas expone, dĂłnde están los principales riesgos de seguridad (especialmente el conflicto OAuth vs ws_key) y cĂłmo encaja todo esto con la arquitectura legacy de la plataforma. TambiĂ©n se revisa casos de uso reales y separando lo que es potencial interesante de lo que aĂşn es demasiado arriesgado para producciĂłn. Si os interesa ver hasta dĂłnde llega realmente esta integraciĂłn y quĂ© problemas tĂ©cnicos hay que tener en cuenta, aquĂ lo dejo.1 point
-
Was passiert, wenn Sie eine Zone namens „Sizilien“ erstellen? Wählen Sie dann in den Zonen (nicht Ländern) die Region Sizilien aus und bearbeiten Sie die Einstellungen. Behalten Sie die ISO-Norm und das Land bei, ändern Sie aber die Zone so, dass sie der Zone Sizilien zugeordnet wird.1 point
-
yes my country invented google, you are right I misread but it's all in jest and not important. also I won't learn anything here on the forum...really jajajajajajaja so I have that going for me... good luck with your projects and hope you make a lot of money1 point
-
since we on the topic of performance I wanted to point out the most overlooked but most bang for the work, tuning mysql. Here are some blog posts I created in my spare time to raise awareness. (nvme another day jajajaja) https://prestaheroes.com/blogs/mysql-optimization1 point
-
1. Clean your old logs Many shops accumulate years of logs that were never purged. This leads to extremely slow INSERT operations and can slow down your entire store. 2. If you're on PrestaShop 1.7, upgrade to the latest release (currently 1.7.8.11) Several performance optimizations were added, and the upgrade path is usually safe — just make sure to test on a copy first. 3. Avoid loading spinners They may look nice, but in practice they block the browser from rendering the page as quickly as possible. They hurt perceived performance more than anything. 4. If your shop has been running for years, run a full diagnostic You can check the health of your store with my free Doctor module: https://jpresta.com/en/prestashop-doctor-diagnostic-repair-clean-optimize Hope it helped!1 point
-
Bonjour, Pas besoin, c'est l'état natif de cette balise. On ne doit la mettre que dans le cas d'une restriction.1 point
-
The procedure that I often use is: 1. turn od debug profiling 2. see wchich modules are in use on various pages of the shop 3. optimize it by adding exceptions in Back Office It can help a lot, cutting off unused modules by half from the areas that they have nothing to do anyway.1 point
-
In PS 9 the theme assets are driven by theme.yml. To have your own custom.css and custom.js included, you need: 1, Files in the theme assets folders /themes/<your-theme>/ assets/ css/ custom.css js/ custom.js 2. Declare them in theme.yml Open /themes/<your-theme>/theme.yml and make sure you have an assets section like this (add it if it’s missing): assets: # If you're building a child theme and want to reuse parent assets: # use_parent_assets: true css: all: - id: theme-custom path: assets/css/custom.css media: all priority: 1000 js: all: - id: theme-custom-js path: assets/js/custom.js priority: 1000 position: bottom # before </body>, optional A few notes: path is relative to the theme root (themes/<your-theme>/), so assets/css/custom.css points to /themes/<your-theme>/assets/css/custom.css. PrestaShop+1 css: all: and js: all: mean “load on every front-office page”. You can also target specific page types (product:, category:, etc.) if you want more granular loading. PrestaShop+1 priority controls the order – higher numbers are loaded later, useful if you want to override theme styles.1 point
-
Hello, FAQs can help with indexing if implemented following schema.org markup. Content must be useful and relevant. You can find more details by reading this article https://developers.google.com/search/docs/appearance/structured-data/faqpage There are modules in the addon that allow users to ask questions and the administrator to answer them.1 point
-
With a lot of googling and reading just found a solution which worked for me. Found in github forums for 404 error while trying to log in admin account using terminal or file manager open apache2.conf file for edit (/etc/apache2/apache2.conf) In that config file locate "<Directory /var/www/>" directive and look for "AllowOverride None" line and change to "AllowOverride All" Restart apache server Delete previous presta9 install and reinstall it. It worked for me and I can log into Back Office (admin account) Goodluck1 point
-
I guess these are made full screen width on purpose to give it a more mordern look. To restrict the width you can either change the module tpl (in our child theme) by adding a .container div or change the width in your custom.css1 point
-
1 point
-
Multumesc frumos, da, acolo a fost!1 point
-
public function getOrdersCount(CarrierId $carrierId): int { $qb = $this->connection->createQueryBuilder(); $count = $qb->select('COUNT(*)') ->from($this->prefix . 'order_carrier', 'oc') ->where('oc.id_carrier = :carrierId') ->setParameter('carrierId', $carrierId->getValue()) ->executeQuery() ->fetchOne(); return (int)$count; } Add (int) to the $count edit src\Adapter\Carrier\Repository\CarrierRepository.php1 point
-
neither 9.0.0 or 9.0.1 should be used, both have add to cart issues, you should wait until at least 9.0.2 (soon I think)...but in reality 9.1 would be best as it's stable version that then should have been the one ps released.1 point
-
A adapter suivant votre préfixe et votre id_lang: SELECT p.id_product, p.ean13, m.name, ExtractValue(pl.description, '//text()') as description FROM `ps_product`p INNER JOIN `ps_product_lang`pl ON(pl.id_product = p.id_product AND pl.id_lang = 1) INNER JOIN `ps_manufacturer`m ON(m.id_manufacturer = p.id_manufacturer)1 point
-
if you can budget, 29 euros is a very fair price and mypresta.eu has rock solid modules. https://mypresta.eu/modules/administration-tools/customer-register-spam-protection.html the time you spend now trying to sort this issue manually could be spent on building your business. be careful with prestashop you will find yourself toying with ps and not focusing on your core business.1 point
-
All working temporary email services via DNS are no different from the DNS of real email services such as Gmail or others and temporary email domains has MX record, DKIM-signature, DMARC and SPF. That is, DNS records for temporary email domains are no different from popular email domains.1 point
-
Salut ...et je pense que vous rencontrerez d'autres problèmes en cours de route. Solution : utilisez la dernière version de PS81 point
-
Das Problem entsteht, weil in PrestaShop die Bestellung erst nach Zahlung erstellt wird, PayPal aber die Order-Nummer schon beim Checkout haben möchte. Ein Workaround ist, die Bestellung beim Klick auf „Bestellen“ schon mit Status „Auf Zahlung warten“ anzulegen – dann kann die Order-Nummer an PayPal übergeben werden. Alternativ geht es über die API: PayPal erlaubt, die Transaktion nachträglich mit der richtigen Bestellnummer und Rechnungsnummer zu aktualisieren. Das macht z. B. das Modul PayPal Standard bereits automatisch, und eigene Anpassungen lassen sich meist über einen Pull-Request oder ein kleines Modul-Update integrieren.1 point
-
SEO is dead — long live visitor experience. Search engines no longer reward tricks or keyword stuffing. They reward how real visitors use your site. For large catalogs this means: Keep menus simple — send visitors to category pages where faceted filters make product discovery easy. Ensure speed and above-the-fold content so users see what they need right away. Add instant checkout options (Amazon Pay, Apple Pay, PayPal) and seamless cart access. Use meta titles/descriptions only to improve click-through rates in search results — they don’t drive ranking. Sitemaps are no longer essential. Search engines can crawl and discover content through internal links. They’re useful for large or complex sites, but not the foundation of SEO anymore. In today’s environment, visitor experience is the strongest SEO signal. Google tracks engagement — if your site is fast, simple, and intuitive, rankings follow.1 point
-
Queremos módulo de pago único. Todo lo que sea SaaS/suscripción mensual, es un sacacuartos más.1 point
-
This is very first version of the module, it will be developed and new verification options will be added. Currently, the module only checks two things, it compares name and surname. If both are identical, it does not allow you to create an account in the store. Module aslo check letters in firstname and lastname, if it's unusual it will also block spammer to create account. Accounts like below will not be created in store. ***New version 1.0.1*** in version 1.0.1 there is new option checking letters, lowercase and uppercase. Firstname or Lastname like: mcdonald, Mcdonald, McDonald, MCDONALD, mCDONALD, mCdONALD are valid and allow to create account, but Firstname or Lastname like: McDoNald, mCdOnALD, MCDonald, McDonalD etc. aren't valid and user can't create account. It also should block account like that: ***New version 1.0.2*** In this version was added verifictaion for firstname and lastname that their are same even then some letters are lowercase or uppercase in fistname and not in lastname. Before user with first and last name like: Andrew andreW was able to create account, now he will be blocked. If you have any suggestions for validating a customer account, please post below. All suggestions will be considered and the best ones implemented into the module. It should work with prestashop 8.X and lower like 1.7.8 not tested with lower version then 1.7.7 ***New version 1.1.1*** Added configuration page to module. wfeuserverification1.0.0.zip wfeuserverification1.0.1.zip wfeuserverification1.0.2.zip Version 1.1.0 and newest was not tested, you install it on your own risk! wfeuserverification-1.1.0.zip wfeuserverification-1.1.1.zip1 point
-
Pour ceux qui cherchent à revenir sur la formule Offre Unique de base appelée "Offre Unique Grow": Compte O2S > Gérer mes Services > Sur la ligne "Offre Unique Cloud", allez complètement à droite sur les 3 petits points et sélectionnez "réajuster l'offre" et là vous pourrez reprendre l'ancienne formule "Offre Unique Grow". A savoir qu'à partir de l'année prochaine le nom de domaine ne sera plus inclut dans la formule "Offre Unique Grow". Donc 1.00€ en moyenne en plus par mois. Si vous gardez l'offre qu'ils vous proposent "Offre Unique Cloud": Vous pouvez si vous le désirez prendre l'offre sur 3 ans en cliquant 2 fois sur le flèche à droite de la proposition de renouvellement. Ce qui revient à 9.00€ht au lieu de 16.00€ht mensuel, soit 324.00€ht (252.00€ d'économie, pour faire passer la pilule) Vous y gagnez un support technique Niveau 2 Prioritaire 24/24 7/7 et le TigerGuard. Par contre il faudra sortir 388.80€TTC d'un coup, ou si j'ai bien vu, paiement en 3 fois sans frais. La machine de la formule "Offre Unique Cloud" est plus puissant mais la plupart des sites de vitrine ou site E-commerce de bases n'en ont pas besoin. Après une demande d'analyse au près de O2S des ressources utilisées, un des site e-commerce mis en place avec 30 à 50 commandes par jours peut rester sans soucis sur la formule "Offre Unique Grow". Il est vrai que mettre tout le monde sur l'offre à 16€, sans analyse d'O2S des ressources utilisées par le compte, est un peu radical. Mais c'est à vous de voir.1 point
-
Je suis chez https://www.planethoster.com (Offre Pro) et pas de soucis.1 point
-
You should not set the default category to "Home." Instead, create a main category for your products (e.g., "Catalog") and organize products into relevant subcategories. This will improve navigation, site structure, and SEO. The default category is for technical purposes, not optimization.1 point
-
I have been able to find the issue for my specific situation: I was overriding in my theme a .tpl file of a module, which was using a single digit as a key: {l s='0' d='Modules.Smartblog.Posts'}. As this is is not allowed, I tried to override the .tpl file in my theme and removing this translation, which was anyway useless for translating a 0, but it was not working, still. I had to remove this translation directive also in the original module file, I guess because the Prestashop Translation scanner was scanning also the original module folder and got stuck at that point. After removing it also from the original file, the problem did not happen anymore.1 point
-
Something like this does not require a module, a few lines in .htaccess should be enough. .htaccess file, located in the file root directory. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com$ RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L] </IfModule>1 point
-
It would appear that the CSV import function is buggy and not useful. I have tried and tried and tried and cannot seem to satisfy that option no matter what I do. Has anyone 1) gotten it to work or b) had any luck with developers fixing it? The category ID must be unique. It can't be the same as the one for Root or Home category. I am down to one error but nothing seems to fix it. Each product ID IS UNIQUE number starting with 1 and incrementing. I tried the option to let the import assign ID and that results in the exact same error. I tried with the column for product ID deletes. Get more errors. I tried with the ID column empty and the option to let Presta assign and same error about requiring unique ID. I think this qualifies as a bug. Because of the number of products I am at a stand still with this whole project until the IMPORT issues can be resolved.1 point
-
Hi, you can find everything in administration => Design => Positions In the search field "Search for a hook" write header and check the option "Display non-positionable hooks" Find Header in the list and you will see modules that use the old Header hook. In the main module file (folder name = module name + .php) you can find the Header hook and change it to displayHeader, including the function. After this change, the module hook will need to be registered again. You can do it again in Design => Position ...1 point
-
Hi! I am trying to understand your page. It tries to be translated to Arab ALL THE TIME XD... I can't find how to make this module work. Is there any tutorial?1 point
-
I have a need for a marketplace site that I can install on my web space, and I found out that Siteground can automatically install Prestashop. But I wonder if Prestashop is right for me. Let me describe what I need: I want to be able to offer PDF books both fiction and RPG games and ZIP files that have several documents including maps, a campaign on One Note, printable handouts, and the like. I would like to have a place where I can offer them and connect with those who download them. While I intend to offer them for free, I would like to have a Pay What You Want system for tips and donations. Would Prestashop be able to fill this need? And if so, is there a way I can find out how to do that? Thank you for your time and consideration :)1 point
-
Good evening, just saw in the back office that the icon of the user profile (even default one) is missing in the upper right corner of the dashboard. Opening the image in a new window points to an origin dns error page for https://profile.prestashop.com/ Using 1.6.1.24 Anyone experiencing same issue ? thanks,1 point
-
I have done a bit more digging and can offer something of a solution now! Checking my logs I saw the error PHP message: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. So I increased max_input_vars and restarted php-fpm and voila, imported products can be saved again. I don't see an obvious reason why imported products need the higher allowance and 1000 already seems pretty generous, but it got things working for me.1 point
-
Hi 2 All I want to use infinite scroll module for blog page.In my blog page I have used pagination for blog posts.I want to remove pagination from blog page and use infinite scroll. I have already used infinite scroll for my product categories page,now i want the same for blog page as well. How can I do that kindly help. regards;1 point
-
Thanks for the reply,the following is my module code.I am using smart blog, <?php if (!defined('_PS_VERSION_')) exit; define('_MODULE_SMARTBLOG_DIR_',_PS_MODULE_DIR_. 'smartblog/images/' ); require_once (dirname(__FILE__) . '/classes/BlogCategory.php'); require_once (dirname(__FILE__) . '/classes/Blogcomment.php'); require_once (dirname(__FILE__) . '/classes/BlogPostCategory.php'); require_once (dirname(__FILE__) . '/classes/BlogTag.php'); require_once (dirname(__FILE__) . '/classes/SmartBlogPost.php'); require_once (dirname(__FILE__) . '/classes/BlogImageType.php'); require_once (dirname(__FILE__) . '/controllers/admin/AdminAboutUsController.php'); class smartblog extends Module { public function __construct(){ $this->name = 'smartblog'; $this->tab = 'front_office_features'; $this->version = '2.0'; $this->author = 'SmartDataSoft'; $this->need_upgrade = true; $this->secure_key = Tools::encrypt($this->name); $this->smart_shop_id = Context::getContext()->shop->id; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Smart Blog'); $this->description = $this->l('The Most Powerfull Presta shop Blog Module - by smartdatasoft'); $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); } public function install(){ Configuration::updateValue('smartpostperpage', '5'); Configuration::updateValue('smartshowauthorstyle', '1'); Configuration::updateValue('smartmainblogurl', 'SmartBlog'); Configuration::updateValue('smartusehtml', '1'); Configuration::updateValue('smartshowauthorstyle', '1'); Configuration::updateValue('smartenablecomment', '1'); Configuration::updateValue('smartblogliststyle', '0'); Configuration::updateValue('smartshownoimg', '1'); Configuration::updateValue('smartshowcolumn', '3'); Configuration::updateValue('smartacceptcomment', '1'); Configuration::updateValue('smartcustomcss', ''); Configuration::updateValue('smartblogmetatitle', 'Smart Bolg Title'); Configuration::updateValue('smartblogmetakeyword', 'smart,blog,smartblog,prestashop blog,prestashop,blog'); Configuration::updateValue('smartblogmetadescrip', 'Prestashop powerfull blog site developing module. It has hundrade of extra plugins. This module developed by SmartDataSoft.com'); $langs = Language::getLanguages(); if (!parent::install() || !$this->registerHook('displayHeader') || !$this->SmartHookInsert() || !$this->registerHook('moduleRoutes')) return false; $sql = array(); require_once(dirname(__FILE__) . '/sql/install.php'); foreach ($sql as $sq) : if (!Db::getInstance()->Execute($sq)) return false; endforeach; $this->CreateSmartBlogTabs(); //Blog Tab Creator $this->SampleDataInstall(); // Sample Data InsTall return true; } public function SmartHookInsert() { $hookvalue = array(); require_once(dirname(__FILE__) . '/sql/addhook.php'); foreach ($hookvalue as $hkv) { $hookid = Hook::getIdByName($hkv['name']); if (!$hookid) { $add_hook = new Hook(); $add_hook->name = pSQL($hkv['name']); $add_hook->title = pSQL($hkv['title']); $add_hook->description = pSQL($hkv['description']); $add_hook->position = pSQL($hkv['position']); $add_hook->live_edit = $hkv['live_edit']; $add_hook->add(); $hookid = $add_hook->id; if (!$hookid) return false; }else{ $up_hook = new Hook($hookid); $up_hook->update(); } } return true; } public function uninstall() { if (!parent::uninstall() || !Configuration::deleteByName('smartblogmetatitle') || !Configuration::deleteByName('smartblogmetakeyword') || !Configuration::deleteByName('smartblogmetadescrip') || !Configuration::deleteByName('smartpostperpage') || !Configuration::deleteByName('smartacceptcomment') || !Configuration::deleteByName('smartusehtml') || !Configuration::deleteByName('smartblogliststyle') || !Configuration::deleteByName('smartenablecomment') || !Configuration::deleteByName('smartmainblogurl') || !Configuration::deleteByName('smartshowcolumn') || !Configuration::deleteByName('smartshowauthorstyle') || !Configuration::deleteByName('smartcustomcss') || !Configuration::deleteByName('smartshownoimg') || !Configuration::deleteByName('smartshowauthor') ) return false; require_once(dirname(__FILE__) . '/sql/uninstall_tab.php'); foreach ($idtabs as $tabid): if ($tabid) { $tab = new Tab($tabid); $tab->delete(); } endforeach; $sql = array(); require_once(dirname(__FILE__) . '/sql/uninstall.php'); foreach ($sql as $s) : if (!Db::getInstance()->Execute($s)) return false; endforeach; $this->SmartHookDelete(); return true; } public function SmartHookDelete(){ $hookvalue = array(); require_once(dirname(__FILE__) . '/sql/addhook.php'); foreach ($hookvalue as $hkv){ $hookid = Hook::getIdByName($hkv['name']); if($hookid){ $dlt_hook = new Hook($hookid); $dlt_hook->delete(); } } } public function hookModuleRoutes($params) { $alias = Configuration::get('smartmainblogurl'); $usehtml = (int)Configuration::get('smartusehtml'); if($usehtml != 0){ $html = '.html'; }else{ $html = ''; } $my_link = array( 'smartblog' => array( 'controller' => 'category', 'rule' => $alias, 'keywords' => array(), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_list' => array( 'controller' => 'category', 'rule' => $alias.'/category'.$html, 'keywords' => array(), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_list_module' => array( 'controller' => 'category', 'rule' => 'module/'.$alias.'/category'.$html, 'keywords' => array(), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_list_pagination' => array( 'controller' => 'category', 'rule' => $alias.'/category/page/{page}'.$html, 'keywords' => array( 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_pagination' => array( 'controller' => 'category', 'rule' => $alias.'/page/{page}'.$html, 'keywords' => array( 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_category' => array( 'controller' => 'category', 'rule' => $alias.'/category/{slug}'.$html, 'keywords' => array( 'id_category' => array('regexp' => '[_a-zA-Z0-9-\pL]'), 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_category'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_category_pagination' => array( 'controller' => 'category', 'rule' => $alias.'/category/{slug}/page/{page}'.$html, 'keywords' => array( 'id_category' => array('regexp' => '[_a-zA-Z0-9-\pL]'), 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_category'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_cat_page_mod' => array( 'controller' => 'category', 'rule' => 'module/'.$alias.'/category/{slug}/page/{page}'.$html, 'keywords' => array( 'id_category' => array('regexp' => '[_a-zA-Z0-9-\pL]'), 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_category'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_post' => array( 'controller' => 'details', 'rule' => $alias.'/{slug}'.$html, 'keywords' => array( 'id_post' => array('regexp' => '[_a-zA-Z0-9-\pL]'), 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_post'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_search' => array( 'controller' => 'search', 'rule' => $alias.'/search'.$html, 'keywords' => array(), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_tag' => array( 'controller' => 'tagpost', 'rule' => $alias.'/tag/{tag}'.$html, 'keywords' => array( 'tag' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'tag'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_search_pagination' => array( 'controller' => 'search', 'rule' => $alias.'/search/page/{page}'.$html, 'keywords' => array( 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_archive' => array( 'controller' => 'archive', 'rule' => $alias.'/archive'.$html, 'keywords' => array(), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_archive_pagination' => array( 'controller' => 'archive', 'rule' => $alias.'/archive/page/{page}'.$html, 'keywords' => array( 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_month' => array( 'controller' => 'archive', 'rule' => $alias.'/archive/{year}/{month}'.$html, 'keywords' => array( 'year' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'year'), 'month' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'month'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_month_pagination' => array( 'controller' => 'archive', 'rule' => $alias.'/archive/{year}/{month}/page/{page}'.$html, 'keywords' => array( 'year' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'year'), 'month' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'month'), 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_year' => array( 'controller' => 'archive', 'rule' => $alias.'/archive/{year}'.$html, 'keywords' => array( 'year' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'year'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), 'smartblog_year_pagination' => array( 'controller' => 'archive', 'rule' => $alias.'/archive/{year}/page/{page}'.$html, 'keywords' => array( 'year' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'year'), 'page' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'page'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), ); return $my_link; } public function hookDisplayHeader($params) { $this->context->controller->addCSS($this->_path.'css/smartblogstyle.css', 'all'); } private function CreateSmartBlogTabs() { $langs = Language::getLanguages(); $id_lang = (int)Configuration::get('PS_LANG_DEFAULT'); $smarttab = new Tab(); $smarttab->class_name = "AdminSmartBlog"; $smarttab->module = ""; $smarttab->id_parent = 0; foreach($langs as $l){ $smarttab->name[$l['id_lang']] = $this->l('Blog'); } $smarttab->save(); $tab_id = $smarttab->id; @copy(dirname(__FILE__)."/AdminSmartBlog.gif",_PS_ROOT_DIR_."/img/t/AdminSmartBlog.gif"); require_once(dirname(__FILE__) . '/sql/install_tab.php'); foreach ($tabvalue as $tab){ $newtab = new Tab(); $newtab->class_name = $tab['class_name']; $newtab->id_parent = $tab_id; $newtab->module = $tab['module']; foreach ($langs as $l) { $newtab->name[$l['id_lang']] = $this->l($tab['name']); } $newtab->save(); } return true; } public function getContent(){ $html = ''; if(Tools::isSubmit('savesmartblog')) { Configuration::updateValue('smartblogmetatitle', Tools::getvalue('smartblogmetatitle')); Configuration::updateValue('smartenablecomment', Tools::getvalue('smartenablecomment')); Configuration::updateValue('smartblogmetakeyword', Tools::getvalue('smartblogmetakeyword')); Configuration::updateValue('smartblogmetadescrip', Tools::getvalue('smartblogmetadescrip')); Configuration::updateValue('smartpostperpage', Tools::getvalue('smartpostperpage')); Configuration::updateValue('smartacceptcomment', Tools::getvalue('smartacceptcomment')); Configuration::updateValue('smartblogliststyle', Tools::getvalue('smartblogliststyle')); Configuration::updateValue('smartshowauthorstyle', Tools::getvalue('smartshowauthorstyle')); Configuration::updateValue('smartshowauthor', Tools::getvalue('smartshowauthor')); Configuration::updateValue('smartshowcolumn', Tools::getvalue('smartshowcolumn')); Configuration::updateValue('smartmainblogurl', Tools::getvalue('smartmainblogurl')); Configuration::updateValue('smartusehtml', Tools::getvalue('smartusehtml')); Configuration::updateValue('smartshownoimg', Tools::getvalue('smartshownoimg')); Configuration::updateValue('smartcustomcss', Tools::getvalue('smartcustomcss'),true); $this->processImageUpload($_FILES); $html = $this->displayConfirmation($this->l('The settings have been updated successfully.')); $helper = $this->SettingForm(); $html .= $helper->generateForm($this->fields_form); $helper = $this->regenerateform(); $html .= $helper->generateForm($this->fields_form); $auc = new AdminAboutUsController(); $html .= '<fieldset class="width3" id="smartdatasoft-content"> <style> #smartdatasoft-content { padding: 0; width: 99%; padding-left: 1.3em; background: white; } </style></fieldset> <script type="text/javascript"> $.post( "ajax-tab.php", { tab: \'AdminAboutUs\', token: \''.$auc->token.'\', ajax: \'1\', action:\'GetSmartThemes\', page:\'themes\' }, function(a){ $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a); }); </script>'; return $html; } elseif(Tools::isSubmit('generateimage')) { if(Tools::getvalue('isdeleteoldthumblr') != 1) { BlogImageType::ImageGenerate(); $html = $this->displayConfirmation($this->l('Generate New Thumblr Succesfully.')); $helper = $this->SettingForm(); $html .= $helper->generateForm($this->fields_form); $helper = $this->regenerateform(); $html .= $helper->generateForm($this->fields_form); $auc = new AdminAboutUsController(); $html .= '<fieldset class="width3" id="smartdatasoft-content"> <style> #smartdatasoft-content { padding: 0; width: 99%; padding-left: 1.3em; background: white; } </style></fieldset> <script type="text/javascript"> $.post( "ajax-tab.php", { tab: \'AdminAboutUs\', token: \''.$auc->token.'\', ajax: \'1\', action:\'GetSmartThemes\', page:\'themes\' }, function(a){ $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a); }); </script>'; return $html; } else { BlogImageType::ImageDelete(); BlogImageType::ImageGenerate(); $html = $this->displayConfirmation($this->l('Delete Old Image and Generate New Thumblr Succesfully.')); $helper = $this->SettingForm(); $html .= $helper->generateForm($this->fields_form); $helper = $this->regenerateform(); $html .= $helper->generateForm($this->fields_form); $auc = new AdminAboutUsController(); $html .= '<fieldset class="width3" id="smartdatasoft-content"> <style> #smartdatasoft-content { padding: 0; width: 99%; padding-left: 1.3em; background: white; } </style></fieldset> <script type="text/javascript"> $.post( "ajax-tab.php", { tab: \'AdminAboutUs\', token: \''.$auc->token.'\', ajax: \'1\', action:\'GetSmartThemes\', page:\'themes\' }, function(a){ $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a); }); </script>'; return $html; } } else { $helper = $this->SettingForm(); $html .= $helper->generateForm($this->fields_form); $helper = $this->regenerateform(); $html .= $helper->generateForm($this->fields_form); $auc = new AdminAboutUsController(); $html .= '<fieldset class="width3" id="smartdatasoft-content"> <style> #smartdatasoft-content { padding: 0; width: 99%; padding-left: 1.3em; background: white; } </style></fieldset> <script type="text/javascript"> $.post( "ajax-tab.php", { tab: \'AdminAboutUs\', token: \''.$auc->token.'\', ajax: \'1\', action:\'GetSmartThemes\', page:\'themes\' }, function(a){ $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a); }); </script>'; return $html; } } public function SettingForm() { $img_desc = ''; $img_desc .= ''.$this->l('Upload a Avatar from your computer.<br/>N.B : Only jpg image is allowed'); $img_desc .= '<br/><img style="clear:both;border:1px solid black;" alt="" src="'.__PS_BASE_URI__.'modules/smartblog/images/avatar/avatar.jpg" height="100" width="100"/><br />'; $default_lang = (int) Configuration::get('PS_LANG_DEFAULT'); $this->fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Setting'), ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Meta Title'), 'name' => 'smartblogmetatitle', 'size' => 70, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Meta Keyword'), 'name' => 'smartblogmetakeyword', 'size' => 70, 'required' => true ), array( 'type' => 'textarea', 'label' => $this->l('Meta Description'), 'name' => 'smartblogmetadescrip', 'rows' => 7, 'cols' => 66, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Main Blog Url'), 'name' => 'smartmainblogurl', 'size' => 15, 'required' => true ), array( 'type' => 'radio', 'label' => $this->l('Use .html with Friendly Url'), 'name' => 'smartusehtml', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'smartusehtml', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'smartusehtml', 'value' => 0, 'label' => $this->l('Disabled') ) ) ), array( 'type' => 'text', 'label' => $this->l('Number of posts per page'), 'name' => 'smartpostperpage', 'size' => 15, 'required' => true ), array( 'type' => 'radio', 'label' => $this->l('Auto accepted comment'), 'name' => 'smartacceptcomment', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'smartacceptcomment', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'smartacceptcomment', 'value' => 0, 'label' => $this->l('Disabled') ) ) ), array( 'type' => 'radio', 'label' => $this->l('Enable Comment'), 'name' => 'smartenablecomment', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'smartenablecomment', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'smartenablecomment', 'value' => 0, 'label' => $this->l('Disabled') ) ) ), array( 'type' => 'radio', 'label' => $this->l('Show Author Name'), 'name' => 'smartshowauthor', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'smartshowauthor', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'smartshowauthor', 'value' => 0, 'label' => $this->l('Disabled') ) ) ), array( 'type' => 'radio', 'label' => $this->l('Show Author Name Style'), 'name' => 'smartshowauthorstyle', 'required' => false, 'class' => 't', 'values' => array( array( 'id' => 'smartshowauthorstyle', 'value' => 1, 'label' => $this->l('First Name, Last Name') ), array( 'id' => 'smartshowauthorstyle', 'value' => 0, 'label' => $this->l('Last Name, First Name') ) ) ), array( 'type' => 'file', 'label' => $this->l('AVATAR Image:'), 'name' => 'avatar', 'display_image' => false, 'desc' => $img_desc ), array( 'type' => 'radio', 'label' => $this->l('Show No Image'), 'name' => 'smartshownoimg', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'smartshownoimg', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'smartshownoimg', 'value' => 0, 'label' => $this->l('Disabled') ) ) ), array( 'type' => 'radio', 'label' => $this->l('Blog List View Style'), 'name' => 'smartblogliststyle', 'required' => false, 'class' => 't', 'values' => array( array( 'id' => 'smartblogliststyle', 'value' => 0, 'label' => $this->l('Single View') ), array( 'id' => 'smartblogliststyle', 'value' => 1, 'label' => $this->l('Grid View') ), array( 'id' => 'smartblogliststyle', 'value' => 2, 'label' => $this->l('List View') ) ) ), array( 'type' => 'radio', 'label' => $this->l('Blog Page Column Setting'), 'name' => 'smartshowcolumn', 'required' => false, 'class' => 't', 'values' => array( array( 'id' => 'smartshowcolumn', 'value' => 0, 'label' => $this->l('Use Both SmartBlog Column') ), array( 'id' => 'smartshowcolumn', 'value' => 1, 'label' => $this->l('Use Only SmartBlog Left Column') ), array( 'id' => 'smartshowcolumn', 'value' => 2, 'label' => $this->l('Use Only SmartBlog Right Column') ), array( 'id' => 'smartshowcolumn', 'value' => 3, 'label' => $this->l('Use Prestashop Column') ) ) ), array( 'type' => 'textarea', 'label' => $this->l('Custom CSS'), 'name' => 'smartcustomcss', 'rows' => 7, 'cols' => 66, 'required' => false ), ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'button' ) ); $helper = new HelperForm(); $helper->module = $this; $helper->name_controller = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; foreach (Language::getLanguages(false) as $lang) $helper->languages[] = array( 'id_lang' => $lang['id_lang'], 'iso_code' => $lang['iso_code'], 'name' => $lang['name'], 'is_default' => ($default_lang == $lang['id_lang'] ? 1 : 0) ); $helper->toolbar_btn = array( 'save' => array( 'desc' => $this->l('Save'), 'href' => AdminController::$currentIndex . '&configure=' . $this->name . '&save'.$this->name.'token=' . Tools::getAdminTokenLite('AdminModules'), ) ); $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; $helper->title = $this->displayName; $helper->show_toolbar = true; $helper->toolbar_scroll = true; $helper->submit_action = 'save'.$this->name; $helper->fields_value['smartpostperpage'] = Configuration::get('smartpostperpage'); $helper->fields_value['smartacceptcomment'] = Configuration::get('smartacceptcomment'); $helper->fields_value['smartshowauthorstyle'] = Configuration::get('smartshowauthorstyle'); $helper->fields_value['smartshowauthor'] = Configuration::get('smartshowauthor'); $helper->fields_value['smartmainblogurl'] = Configuration::get('smartmainblogurl'); $helper->fields_value['smartusehtml'] = Configuration::get('smartusehtml'); $helper->fields_value['smartshowcolumn'] = Configuration::get('smartshowcolumn'); $helper->fields_value['smartblogmetakeyword'] = Configuration::get('smartblogmetakeyword'); $helper->fields_value['smartblogmetatitle'] = Configuration::get('smartblogmetatitle'); $helper->fields_value['smartblogmetadescrip'] = Configuration::get('smartblogmetadescrip'); $helper->fields_value['smartblogliststyle'] = Configuration::get('smartblogliststyle'); $helper->fields_value['smartenablecomment'] = Configuration::get('smartenablecomment'); $helper->fields_value['smartcustomcss'] = Configuration::get('smartcustomcss'); $helper->fields_value['smartshownoimg'] = Configuration::get('smartshownoimg'); return $helper; } protected function regenerateform() { $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); $this->fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Blog Thumblr Configuration'), ), 'input' => array( array( 'type' => 'radio', 'label' => $this->l('Delete Old Thumblr'), 'name' => 'isdeleteoldthumblr', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'isdeleteoldthumblr', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'isdeleteoldthumblr', 'value' => 0, 'label' => $this->l('Disabled') ) ) ) ), 'submit' => array( 'title' => $this->l('Re Generate Thumblr'), 'class' => 'button' ) ); $helper = new HelperForm(); $helper->module = $this; $helper->name_controller = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); foreach (Language::getLanguages(false) as $lang) $helper->languages[] = array( 'id_lang' => $lang['id_lang'], 'iso_code' => $lang['iso_code'], 'name' => $lang['name'], 'is_default' => ($default_lang == $lang['id_lang'] ? 1 : 0) ); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; $helper->toolbar_scroll = true; $helper->show_toolbar = false; $helper->submit_action = 'generateimage'; $helper->fields_value['isdeleteoldthumblr'] = Configuration::get('isdeleteoldthumblr'); return $helper; } public function processImageUpload($FILES) { if (isset($FILES['avatar']) && isset($FILES['avatar']['tmp_name']) && !empty($FILES['avatar']['tmp_name'])) { if ($error = ImageManager::validateUpload($FILES['avatar'], 4000000)) return $this->displayError($this->l('Invalid image')); else { $ext = substr($FILES['avatar']['name'], strrpos($FILES['avatar']['name'], '.') + 1); $file_name = 'avatar.' . $ext; $path = _PS_MODULE_DIR_ .'smartblog/images/avatar/' . $file_name; if (!move_uploaded_file($FILES['avatar']['tmp_name'], $path)) return $this->displayError($this->l('An error occurred while attempting to upload the file.')); else { $author_types = BlogImageType::GetImageAllType('author'); foreach ($author_types as $image_type) { $dir = _PS_MODULE_DIR_ .'smartblog/images/avatar/avatar-'.stripslashes($image_type['type_name']).'.jpg'; if (file_exists($dir)) unlink($dir); } $images_types = BlogImageType::GetImageAllType('author'); foreach ($images_types as $image_type) { ImageManager::resize($path,_PS_MODULE_DIR_ .'smartblog/images/avatar/avatar-'.stripslashes($image_type['type_name']).'.jpg', (int)$image_type['width'], (int)$image_type['height'] ); } } } } } public function SampleDataInstall() { $damisql = "INSERT INTO "._DB_PREFIX_."smart_blog_category (id_parent,active) VALUES (0,1);"; Db::getInstance()->execute($damisql); $damisq1l = "INSERT INTO "._DB_PREFIX_."smart_blog_category_shop (id_smart_blog_category,id_shop) VALUES (1,'".(int)$this->smart_shop_id."');"; Db::getInstance()->execute($damisq1l); $languages = Language::getLanguages(false); foreach ($languages as $language) { $damisql2 = "INSERT INTO "._DB_PREFIX_."smart_blog_category_lang (id_smart_blog_category,meta_title,id_lang,link_rewrite) VALUES (1,'Uncategories','".(int)$language['id_lang']."','uncategories');"; Db::getInstance()->execute($damisql2); } for ($i = 1; $i <= 4; $i++){ Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'smart_blog_post`(`id_author`, `id_category`, `position`, `active`, `available`, `created`, `viewed`, `comment_status`, `post_type`) VALUES(1,1,0,1,1,"'.Date('y-m-d H:i:s').'",0,1,0)'); } $languages = Language::getLanguages(false); for ($i = 1; $i <= 4; $i++){ if($i==1): $title='From Now we are certified web agency'; $slug='From Now we are certified web agency'; $des='Smartdatasoft is an offshore web development company located in Bangladesh. We are serving this sector since 2010. Our team is committed to develop high quality web based application and theme for our clients and also for the global marketplace. As your web development partner we will assist you in planning, development, implementation and upgrade! Why Smartdatasoft? Smartdatasoft released their first prestashop theme in November 2012. Till now we have 6+ prestashop theme which are getting sold on global renowned marketplace. Those themes are getting used in more than 400 customers eCommerce websites. Those themes are very user friendly and highly customize able from admin dashboard. For these reason these theme are very popular among the end users and developers'; elseif($i==2): $title='What is Bootstrap? – The History and the Hype'; $slug='Another-title-here-2'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; elseif($i==3): $title='Answers to your Questions about PrestaShop 1.6'; $slug='Another-title-here-3'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; elseif($i==4): $title='Share the Love for PrestaShop 1.6'; $slug='Another-title-here-4'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; elseif($i==5): $title='Christmas Sale is here 5'; $slug='Another-title-here-5'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; elseif($i==6): $title='Christmas Sale is here 6'; $slug='Another-title-here-6'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; elseif($i==7): $title='Christmas Sale is here 7'; $slug='Another-title-here-7'; $des='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; endif; foreach ($languages as $language){ if(!Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'smart_blog_post_lang`(`id_smart_blog_post`,`id_lang`,`meta_title`,`meta_description`,`short_description`,`content`,`link_rewrite`) VALUES('.$i.','.(int)$language['id_lang'].', "'.htmlspecialchars($title).'", "'.htmlspecialchars($des).'","'.substr($des,0,200).'","'.htmlspecialchars($des).'","'.$slug.'" )')) return false; } } for ($i = 1; $i <= 4; $i++){ Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'smart_blog_post_shop`(`id_smart_blog_post`, `id_shop`) VALUES('.$i.','.(int)$this->smart_shop_id.')'); } /* end default data insert*/ for($i=1;$i <= 7;$i++){ if($i==1): $type_name = 'home-default'; $width = '240'; $height = '160'; $type = 'post'; elseif($i==2): $type_name = 'home-small'; $width = '65'; $height = '45'; $type = 'post'; elseif($i==3): $type_name = 'single-default'; $width = '840'; $height = '420'; $type = 'post'; elseif($i==4): $type_name = 'home-small'; $width = '65'; $height = '45'; $type = 'Category'; elseif($i==5): $type_name = 'home-default'; $width = '240'; $height = '160'; $type = 'Category'; elseif($i==6): $type_name = 'single-default'; $width = '840'; $height = '420'; $type = 'Category'; elseif($i==7): $type_name = 'author-default'; $width = '54'; $height = '54'; $type = 'Author'; endif; $damiimgtype = "INSERT INTO "._DB_PREFIX_."smart_blog_imagetype (type_name,width,height,type,active) VALUES ('".$type_name."','".$width."','".$height."','".$type."',1);"; Db::getInstance()->execute($damiimgtype); } return true; } public static function GetSmartBlogUrl() { $id_lang = Context::getContext()->language->id; $id_shop = (int)Context::getContext()->shop->id; $rewrite_set = (int)Configuration::get('PS_REWRITING_SETTINGS'); $ssl = null; static $force_ssl = null; if ($ssl === null) { if ($force_ssl === null) $force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')); $ssl = $force_ssl; } if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null) $shop = new Shop($id_shop); else $shop = Context::getContext()->shop; $langUrl = ''; if ((!$rewrite_set && in_array($id_shop, array((int)Context::getContext()->shop->id, null))) || !Language::isMultiLanguageActivated($id_shop) || !(int)Configuration::get('PS_REWRITING_SETTINGS', null, null, $id_shop)) $langUrl = ''; return $base.$shop->getBaseURI().$langUrl; } public static function GetSmartBlogLink($rewrite = 'smartblog',$params = null, $id_shop = null,$id_lang = null){ $url = smartblog::GetSmartBlogUrl(); $dispatcher = Dispatcher::getInstance(); if($params != null){ return $url.$dispatcher->createUrl($rewrite, $id_lang, $params); }else{ return $url.$dispatcher->createUrl($rewrite); } } }1 point
.png.022b5452a8f28f552bc9430097a16da2.png)