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
-
@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
-
Let me know what problems you have with this module, and i am more then happy to help. (even though i guess you simply posted this to promote your own *paid* module)1 point
-
I had too many problems with this module. I found one (the only one, actually) on the PrestaShop store, and it works perfectly. For me, free modules are a thing of the past; too many problems and no support in case of issues or PrestaShop updates. Module : https://addons.prestashop.com/en/invoicing-accounting/96104-hs-codes-international-customs-nomenclature.html1 point
-
I forgot, the best fishng lure? apple/amazon/little bit google....paypal instant pay. what is the best checkout? no checkout....when you pay with with instant payments, the automatically create account if none exists and updates orders after they pay via one of these 3 parties. it's not always easy in ps because you have to buy 3 modules (I don't use prestashop checkout as it can be limiting)...then on product/view cart/checkout(top) you offer instantpayments. then..we will wait to see if ps will update to offer agenic payments, i.e. via AI...however this is initially (last I heard) in US only.1 point
-
1 point
-
SEO can feel vague at times — what matters isn’t always clear, and figuring out where to start can be confusing, especially with older PrestaShop shops or newly upgraded 8.x/9.x installs. I created a free on-page SEO checklist based on real-world work I’ve done on customer shops over the years. This isn’t an attempt to solicit work — just sharing experience that might help merchants and developers get a cleaner starting point. The checklist covers: What matters most on product & category pages Practical meta title/description guidance Rich snippets & structured data basics Improving UX to reduce friction (terms popup, unnecessary modals, newsletter walls, etc.) Using FAQs, Q&A sections, and better attribute selection to boost engagement Simple steps that make long-term SEO easier to build on If you’re starting SEO cleanup, planning a redesign, or upgrading to PrestaShop 9, you may find it useful. Link to the checklist: https://prestaheroes.com/blogs/prestashop-alerts/the-on-page-seo-checklist-for-modern-prestashop-stores1 point
-
TikTok is not supported in v2.3.3 of the Social Media links module. You will need to add it manually in the template or use another update module that includes TikTok.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
-
Had to google what the hell CCC is/means 😊 Anyway always thanks for all your advises.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
-
Hi there, I have an issue with google merchant center, I have installed the module google marketing by prestashop but: - Product out of stocks on my website still appear on stock in Google merchant center - Need to add GTIN, is there a way to do it in bulk? Because all my product are getting rejected on Google Merchant center due to this. Thank you1 point
-
Eolia est magique! Merci, le problème est réparé. Au top. Que la force soit avec vous.1 point
-
1 point
-
Multumesc frumos, da, acolo a fost!1 point
-
If you sell unique products using store level review JSON-LD on every page can be risky for SEO. Google prefer product specific reviews on product pages. Best approach: Strong review schema > Homepage and about page Product review schema > Only on product pages Avoid duplicate or misleading structured data This keeps everything accurate for Google and helps build trust safely.1 point
-
Salutare, Modificarile ar trebui facute in themes/classic/modules/ps_categorytree/views/templates/hook/ps_categorytree.tpl1 point
-
Je suis d'accord sur le point 1, il est préférable de laisser les testeurs et experts se casser les dents sur les nouvelles version majeurs et surtout attendre que les développeurs de thème et module mettent à jour leurs productions pour les rendre parfaitement compatibles et optimisés pour la V9. Pour le point 2, je ne suis pas d'accord. Oui, une installation avec une version non supporté de PHP ne va pas s'arrêter du jour au lendemain mais à partir de moment où elle n'est plus supporté, il n'y a plus de patch de sécurité. Si une faille critique apparait, votre site devient vulnérable, avec les risques que ça implique sur son business (perte de commande en cours, toujours génial pour la facturation, interruption de service le temps de mettre à jour le site, envoie de spam en son nom, arnaque depuis le serveur, et l'image de marque, j'en parle même pas), et sur la confidentialité des données client (avec ce que ça implique du genre arnaque ciblé, etc). Et dans le cas présent, PHP8.1 n'auras plus de mises à jour critique (de sécurité) dans un mois. Pour rappel, des failles de sécurité, il y en a toutes les semaines. Et c'est aussi le cas sur Prestashop. Et quant aux hébergeurs qui font payer pour des version antique de PHP, il y a peut-être une raison ? Comme le fait d'avoir du support prolonger sur ces version, avec des patchs de sécurité maison ?1 point
-
Nosotros estamos mirando si es posible gestionar todo el tema de VeriFactu directamente en Dolibarr para simplificar el proceso, especialmente si funciona el enlace que estamos creando entre dolibar y prestashop pasar los pedidos de prestashop al erp. Creo que se puede gestionar todo el tema de verifactu en dolibar para simplivicar Si alguien mas esta investigando en esta linea nos gustaria formar equipo con el y ayudarnos mutuamente1 point
-
Simple, PrestaShop ne propose plus de version 9 open source installable, il faut se tourner vers les membres de la communauté ayant pris le temps d'en proposer des versions packagées vierges des modules tiers imposés par PrestaShop comme sur https://presta.zip/1 point
-
Hola, Esto depende mucho del nivel de personalización que necesites. Si todos los productos llevan los mismos iconos, bastaría con crear un bloque HTML con los gráficos y enganchar el hook en el lugar donde se muestran esas vistas. Por el contrario, si necesitas definir los iconos producto por producto, entonces sí sería necesario desarrollar o utilizar un módulo que permita guardar la relación entre productos e iconos.1 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
-
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
-
Yes, you’re absolutely correct — temporary email services do have proper DNS setup. Most of them include valid MX, DKIM, DMARC, and SPF records, so from a DNS perspective, they look exactly like Gmail or Outlook. That’s why simple DNS or MX checks alone can’t really catch disposable addresses — they pass those tests just fine. There are actually many different ways to handle this, and the approach really depends on which PrestaShop version you’re using and what you’re trying to block (fake registrations, spam checkouts, etc.). The example shown earlier is just one possible method. Because of what you pointed out, most shop owners end up using a layered approach — something like this: Use a blacklist or API service to detect disposable email domains. Keep basic MX/DNS validation just to block obvious typos. Add behavior or IP filters to stop bots reusing the same IPs.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
-
hola, primero que todo mala decisión actualizar a esa version, para los modulos verifica que no existe la carpeta via FTP en la la carpeta modules y en la base de datos dale una mirada a ps_module1 point
-
Hey, Here is the fastest and best performing Headless solution for PrestaShop: https://www.binshops.com/prestashop-headless-pwa you can check the performance with demo: https://react.binshops.com/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
-
I am trying to upgrade from Prestashop v9.0.0 to v9.0.1 I am using PHP 8.4 and v7.4.3 of the upgrade assistant. I have tried this with 3rd party modules and overrides enabled and disabled, The file and database updates completed correctly, but I get this error when trying to install assets. INFO - CoreUpgrader - Database update OK [2025-10-21 12:35:03] INFO - CoreUpgrader - Installing assets [2025-10-21 12:35:03] CRITICAL - ErrorHandler - /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/UpgradeTools/CoreConsoleExecutable.php line 74 - Symfony\Component\ErrorHandler\Error\UndefinedFunctionError: Attempted to call function "exec" from namespace "PrestaShop\Module\AutoUpgrade\UpgradeTools". #0 /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/UpgradeTools/CoreConsoleExecutable.php(45): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreConsoleExecutable->getBaseCommand() #1 /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(890): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreConsoleExecutable->callCommand('assets:install ...') #2 /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(124): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->installAssets() #3 /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/Task/Update/UpdateDatabase.php(73): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->finalizeCoreUpdate() #4 /home/sites/testsites/domains/testnv/modules/autoupgrade/classes/Task/Runner/ChainedTasks.php(66): PrestaShop\Module\AutoUpgrade\Task\Update\UpdateDatabase->run() #5 /home/sites/testsites/domains/testnv/**admin_folder**/autoupgrade/ajax-upgradetab.php(58): PrestaShop\Module\AutoUpgrade\Task\Runner\ChainedTasks->run() #6 {main} If I refresh the screen or reopen the update assistant, the screen tells me that v9.0.1 has been installed correctly. Any ideas?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
-
Hello, I just tested with PS 8.1.7 and it does work as expected. Can you add the following CSS code to admin/themes/default/css/overrides.css file: .bootstrap .page-head .page-title { color: green !important; } Then go to the dashboard page and hard reload the browser window (Ctrl + Shift + R or Ctrl + F5 in Chrome). At this point, the title of the page should be green, as shown in my screenshot below. For the new admin pages (the ones that do not follow the index.php?controller= URL pattern), you will need to create the admin/themes/new-theme/css/overrides.css file and add your custom styles there1 point
-
Hi how are things? This post has been around for some time and has no answers so since I found it myself, I'm posting it here for anyone who can help. Previously in the php of our module we have to have issued the corresponding errors when adding the product to the cart, likewise it would be necessary to make a previous verification that these are versions with this incidence: 8.0.0 or greater. It is simply adding the following code to the javascript of our module: if (typeof prestashop !== 'undefined') { prestashop.on('handleError',(function (e) { if (e.eventType == 'addProductToCart' && e.resp.hasError) { $('.alert.alert-danger.ajax-error').remove(); var htt = '<div class="alert alert-danger ajax-error" role="alert">' + e.resp.errors[0] + '</div>'; $(htt).insertAfter($('.product-quantity.clearfix')); } })); prestashop.on('updateCart', (function (e) { $('.alert.alert-danger.ajax-error').remove(); })); } I hope it works for you. Greetings and have a great day.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
-
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
-
1 point
-
If you want to complete hide shipping lines form the cart follow my steps: 1) Enter root folder list of ps. 2) Find and enter "your current theme folder". 3) Then "templates" > "checkout" > "_partials" 4) Here find "cart-detailed-totals.tpl" file and open it in text editor. Here you must change 2 parts. First: here you will see (line 33-37) {if 'products' == $subtotal.type} {$cart.summary_string} {else} {$subtotal.label} {/if} Change it to: {if 'products' == $subtotal.type} {$cart.summary_string} {else} {if $subtotal.type !== 'shipping'} {$subtotal.label} {/if} {/if} Second: here you will see line 40: {if 'discount' == $subtotal.type}- {/if}{$subtotal.value} Change it to: {if 'discount' == $subtotal.type}- {/if} {if $subtotal.type !== 'shipping'} {$subtotal.value} {/if} Finally save the file + clear cache of the shop and check the result.1 point
-
Witam Chce zrobić żeby elementy w menu mobilnym smartblog były od razu rozwinięte. tak jak po lewej stronie obrazka. Nie mogę znaleźć elementu odpowiadającego za to. wersja smartblog 2.1 prestashop 1.6.1.4 Link do bloga http://healthyfreak.co.uk/smartblog.html Z góry dzięki za pomoc1 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)