This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>gsitemap</name>
|
||||
<displayName>Google sitemap</displayName>
|
||||
<version>1.6</version>
|
||||
<description>Generate your Google sitemap file</description>
|
||||
<author>PrestaShop</author>
|
||||
<tab>seo</tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Generieren Sie Ihre Google Sitemap-Datei';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Kann nicht erstellt werden';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'sitemap.xml Datei.';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'Sitemap-Datei erfolgreich erzeugt';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Fehler beim Erstellen der Sitemap-Datei';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Ihr Google-Sitemap-Datei ist online unter folgender Adresse:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Aktualisierung:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Dateigröße:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Indizierte Seiten:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Sitemap enthält alle Produkte';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Standardeinstellung, nur Produkte in aktiven Kategorien sind auf der Sitemap enthalten';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Sitemap enthält alle CMS-Seiten';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Standardeinstellung, nur CMS-Seiten auf CMS-Block sind auf der Sitemap enthalten';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Sitemap-Datei erzeugen';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Sitemap-Datei aktualisieren';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Search Engine Optimization';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Siehe';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'diese Seite';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'für weitere Informationen';
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Genere su fichero de Google Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Creación imposible';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'fichero sitemap.xml';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'El fichero sitemap fue generado correctamente';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Error mientras se creaba el fichero sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Su fichero de google sitemap está online en la siguiente dirección:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Actualizar:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Tamaño';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Páginas Indexadas:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'El sitemap contiene todas los productos';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Por defecto, sólo los productos en categorías activos se incluyen en Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'El sitemap contiene todas las páginas CMS';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Por defecto, sólo las páginas de CMS en el bloque de CMS se incluyen en Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Generar fichero Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Actualizar fichero Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Optimizar Motor de Búsqueda';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Lea';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'esta página';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'para más información';
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Génère votre fichier sitemap pour Google';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Impossible de créer';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'sitemap.xml.';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'Fichier Sitemap généré avec succès';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Erreur durant la création du fichier Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Votre fichier Google Sitemap est en ligne à l\'adresse suivante :';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Mise à jour';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Taille du fichier';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Nombre de pages indexées';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Le sitemap doit contenir tous les produits';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Par défaut, seuls les produits présents dans les catégories actives sont inclus dans le Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Le sitemap doit contenir toutes les pages CMS';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Par défaut, seulement les pages CMS présentes dans le block CMS sont incluses dans le Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Générer le fichier sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Mettre à jour le fichier sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Optimisation pour les moteurs de recherche (SEO)';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Voir';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'cette page';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'pour plus d\'informations';
|
||||
@@ -1,292 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class Gsitemap extends Module
|
||||
{
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->name = 'gsitemap';
|
||||
$this->tab = 'seo';
|
||||
$this->version = '1.6';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Google sitemap');
|
||||
$this->description = $this->l('Generate your Google sitemap file');
|
||||
|
||||
if (!defined('GSITEMAP_FILE'))
|
||||
define('GSITEMAP_FILE', dirname(__FILE__).'/../../sitemap.xml');
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
{
|
||||
file_put_contents(GSITEMAP_FILE, '');
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
private function _postValidation()
|
||||
{
|
||||
file_put_contents(GSITEMAP_FILE, '');
|
||||
if (!($fp = fopen(GSITEMAP_FILE, 'w')))
|
||||
$this->_postErrors[] = $this->l('Cannot create').' '.realpath(dirname(__FILE__.'/../..')).'/'.$this->l('sitemap.xml file.');
|
||||
else
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
private function getUrlWith($url, $key, $value)
|
||||
{
|
||||
if (empty($value))
|
||||
return $url;
|
||||
if (strpos($url, '?') !== false)
|
||||
return $url.'&'.$key.'='.$value;
|
||||
return $url.'?'.$key.'='.$value;
|
||||
}
|
||||
|
||||
private function _postProcess()
|
||||
{
|
||||
Configuration::updateValue('GSITEMAP_ALL_CMS', (int)(Tools::getValue('GSITEMAP_ALL_CMS')));
|
||||
Configuration::updateValue('GSITEMAP_ALL_PRODUCTS', (int)(Tools::getValue('GSITEMAP_ALL_PRODUCTS')));
|
||||
$link = new Link();
|
||||
$langs = Language::getLanguages();
|
||||
|
||||
$xmlString = <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
||||
</urlset>
|
||||
XML;
|
||||
|
||||
$xml = new SimpleXMLElement($xmlString);
|
||||
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') AND count($langs) > 1)
|
||||
foreach($langs as $lang)
|
||||
$this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__.$lang['iso_code'].'/', '1.00', 'daily', date('Y-m-d'));
|
||||
else
|
||||
$this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__, '1.00', 'daily', date('Y-m-d'));
|
||||
|
||||
/* CMS Generator */
|
||||
if (Configuration::get('GSITEMAP_ALL_CMS') OR !Module::isInstalled('blockcms'))
|
||||
$sql_cms = '
|
||||
SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
|
||||
' FROM '._DB_PREFIX_.'cms_lang cl
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
WHERE l.`active` = 1
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
elseif (Module::isInstalled('blockcms'))
|
||||
$sql_cms = '
|
||||
SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
|
||||
' FROM '._DB_PREFIX_.'cms_block_page b
|
||||
LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (b.id_cms = cl.id_cms)
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
WHERE l.`active` = 1
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
|
||||
$cmss = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql_cms);
|
||||
foreach($cmss AS $cms)
|
||||
{
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $link->getCMSLink((int)($cms['id_cms']), $cms['link_rewrite'], false, (int)($cms['id_lang'])) : $link->getCMSLink((int)($cms['id_cms']));
|
||||
$this->_addSitemapNode($xml, $tmpLink, '0.8', 'daily');
|
||||
}
|
||||
|
||||
/* Categories Generator */
|
||||
if(Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$categories = Db::getInstance()->ExecuteS('
|
||||
SELECT c.id_category, c.level_depth, link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd, cl.id_lang
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON c.id_category = cl.id_category
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON cl.id_lang = l.id_lang
|
||||
WHERE l.`active` = 1 AND c.`active` = 1 AND c.id_category != 1
|
||||
ORDER BY cl.id_category, cl.id_lang ASC');
|
||||
else
|
||||
$categories = Db::getInstance()->ExecuteS(
|
||||
'SELECT c.id_category, c.level_depth, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
ORDER BY c.id_category ASC');
|
||||
|
||||
|
||||
foreach($categories as $category)
|
||||
{
|
||||
if (($priority = 0.9 - ($category['level_depth'] / 10)) < 0.1)
|
||||
$priority = 0.1;
|
||||
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $link->getCategoryLink((int)($category['id_category']), $category['link_rewrite'], (int)($category['id_lang'])) : $link->getCategoryLink((int)($category['id_category']));
|
||||
|
||||
$this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($category['date_upd'], 0, 10));
|
||||
}
|
||||
|
||||
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT p.id_product, pl.link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') date_upd, pl.id_lang, cl.`link_rewrite` category, ean13, i.id_image, il.legend legend_image, (
|
||||
SELECT MIN(level_depth)
|
||||
FROM '._DB_PREFIX_.'product p2
|
||||
LEFT JOIN '._DB_PREFIX_.'category_product cp2 ON p2.id_product = cp2.id_product
|
||||
LEFT JOIN '._DB_PREFIX_.'category c2 ON cp2.id_category = c2.id_category
|
||||
WHERE p2.id_product = p.id_product AND p2.`active` = 1 AND c2.`active` = 1) AS level_depth
|
||||
FROM '._DB_PREFIX_.'product p
|
||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product)
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND pl.`id_lang` = cl.`id_lang`)
|
||||
LEFT JOIN '._DB_PREFIX_.'image i ON p.id_product = i.id_product
|
||||
LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image)
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (pl.id_lang = l.id_lang)
|
||||
WHERE l.`active` = 1 AND p.`active` = 1
|
||||
'.(Configuration::get('GSITEMAP_ALL_PRODUCTS') ? '' : 'HAVING level_depth IS NOT NULL').'
|
||||
ORDER BY pl.id_product, pl.id_lang ASC');
|
||||
|
||||
foreach($products AS $product)
|
||||
{
|
||||
if (($priority = 0.7 - ($product['level_depth'] / 10)) < 0.1)
|
||||
$priority = 0.1;
|
||||
|
||||
$tmpLink = $link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang']));
|
||||
$sitemap = $this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($product['date_upd'], 0, 10));
|
||||
$sitemap = $this->_addSitemapNodeImage($sitemap, $product);
|
||||
}
|
||||
|
||||
/* Add classic pages (contact, best sales, new products...) */
|
||||
$pages = array(
|
||||
'authentication' => true,
|
||||
'best-sales' => false,
|
||||
'contact-form' => true,
|
||||
'discount' => false,
|
||||
'index' => false,
|
||||
'manufacturer' => false,
|
||||
'new-products' => false,
|
||||
'prices-drop' => false,
|
||||
'supplier' => false,
|
||||
'store' => false);
|
||||
|
||||
foreach ($pages AS $page => $ssl)
|
||||
foreach($langs as $lang)
|
||||
$this->_addSitemapNode($xml, $link->getPageLink($page, $ssl, $lang['id_lang']), '0.5', 'monthly');
|
||||
|
||||
if(Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
foreach ($pages AS $page => $ssl)
|
||||
foreach($langs as $lang)
|
||||
$this->_addSitemapNode($xml, $link->getPageLink($page.'.php', $ssl, $lang['id_lang']), '0.5', 'monthly');
|
||||
else
|
||||
foreach($pages AS $page => $ssl)
|
||||
$this->_addSitemapNode($xml, $link->getPageLink($page.'.php', $ssl), '0.5', 'monthly');
|
||||
|
||||
$xmlString = $xml->asXML();
|
||||
|
||||
$fp = fopen(GSITEMAP_FILE, 'w');
|
||||
fwrite($fp, $xmlString);
|
||||
fclose($fp);
|
||||
|
||||
$res = file_exists(GSITEMAP_FILE);
|
||||
$this->_html .= '<h3 class="'. ($res ? 'conf confirm' : 'alert error') .'" style="margin-bottom: 20px">';
|
||||
$this->_html .= $res ? $this->l('Sitemap file generated') : $this->l('Error while creating sitemap file');
|
||||
$this->_html .= '</h3>';
|
||||
}
|
||||
|
||||
private function _addSitemapNode($xml, $loc, $priority, $change_freq, $last_mod = NULL)
|
||||
{
|
||||
$sitemap = $xml->addChild('url');
|
||||
$sitemap->addChild('loc', $loc);
|
||||
$sitemap->addChild('priority', $priority);
|
||||
if ($last_mod)
|
||||
$sitemap->addChild('lastmod', $last_mod);
|
||||
$sitemap->addChild('changefreq', $change_freq);
|
||||
return $sitemap;
|
||||
}
|
||||
|
||||
private function _addSitemapNodeImage($xml, $product)
|
||||
{
|
||||
$link = new Link();
|
||||
$image = $xml->addChild('image', null, 'http://www.google.com/schemas/sitemap-image/1.1');
|
||||
$image->addChild('loc', $link->getImageLink($product['link_rewrite'], (int)$product['id_product'].'-'.(int)$product['id_image']), 'http://www.google.com/schemas/sitemap-image/1.1');
|
||||
$image->addChild('caption', $product['legend_image'], 'http://www.google.com/schemas/sitemap-image/1.1');
|
||||
$image->addChild('title', $product['legend_image'], 'http://www.google.com/schemas/sitemap-image/1.1');
|
||||
}
|
||||
|
||||
private function _displaySitemap()
|
||||
{
|
||||
if (file_exists(GSITEMAP_FILE) AND filesize(GSITEMAP_FILE))
|
||||
{
|
||||
$fp = fopen(GSITEMAP_FILE, 'r');
|
||||
$fstat = fstat($fp);
|
||||
fclose($fp);
|
||||
$xml = simplexml_load_file(GSITEMAP_FILE);
|
||||
|
||||
$nbPages = sizeof($xml->url);
|
||||
|
||||
$this->_html .= '<p>'.$this->l('Your Google sitemap file is online at the following address:').'<br />
|
||||
<a href="'.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml" target="_blank"><b>'.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml</b></a></p><br />';
|
||||
|
||||
$this->_html .= $this->l('Update:').' <b>'.utf8_encode(strftime('%A %d %B %Y %H:%M:%S',$fstat['mtime'])).'</b><br />';
|
||||
$this->_html .= $this->l('Filesize:').' <b>'.number_format(($fstat['size']*.000001), 3).'MB</b><br />';
|
||||
$this->_html .= $this->l('Indexed pages:').' <b>'.$nbPages.'</b><br /><br />';
|
||||
}
|
||||
}
|
||||
|
||||
private function _displayForm()
|
||||
{
|
||||
$this->_html .=
|
||||
'<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||
<div style="margin:0 0 20px 0;">
|
||||
<input type="checkbox" name="GSITEMAP_ALL_PRODUCTS" id="GSITEMAP_ALL_PRODUCTS" style="vertical-align: middle;" value="1" '.(Configuration::get('GSITEMAP_ALL_PRODUCTS') ? 'checked="checked"' : '').' /> <label class="t" for="GSITEMAP_ALL_PRODUCTS">'.$this->l('Sitemap contains all products').'</label>
|
||||
<p style="color:#7F7F7F;">'.$this->l('Default: only products in active categories are included on Sitemap').'</p>
|
||||
</div>
|
||||
<div style="margin:0 0 20px 0;">
|
||||
<input type="checkbox" name="GSITEMAP_ALL_CMS" id="GSITEMAP_ALL_CMS" style="vertical-align: middle;" value="1" '.(Configuration::get('GSITEMAP_ALL_CMS') ? 'checked="checked"' : '').' /> <label class="t" for="GSITEMAP_ALL_CMS">'.$this->l('Sitemap contains all CMS pages').'</label>
|
||||
<p style="color:#7F7F7F;"><img src="'.__PS_BASE_URI__.'img/admin/information.png" alt="" style="float:left;vertical-align: middle;margin-right:5px;" /> '.$this->l('Default: only CMS pages on block CMS are included on Sitemap').'</p>
|
||||
</div>
|
||||
<input name="btnSubmit" class="button" type="submit"
|
||||
value="'.((!file_exists(GSITEMAP_FILE)) ? $this->l('Generate sitemap file') : $this->l('Update sitemap file')).'" />
|
||||
</form>';
|
||||
}
|
||||
|
||||
function getContent()
|
||||
{
|
||||
$this->_html .= '<h2>'.$this->l('Search Engine Optimization').'</h2>
|
||||
'.$this->l('See').' <a href="https://www.google.com/webmasters/tools/docs/en/about.html" style="font-weight:bold;text-decoration:underline;" target="_blank">
|
||||
'.$this->l('this page').'</a> '.$this->l('for more information').'<br /><br />';
|
||||
if (!empty($_POST))
|
||||
{
|
||||
$this->_postValidation();
|
||||
if (!sizeof($this->_postErrors))
|
||||
$this->_postProcess();
|
||||
else
|
||||
foreach ($this->_postErrors AS $err)
|
||||
$this->_html .= '<div class="alert error">'.$err.'</div>';
|
||||
}
|
||||
|
||||
$this->_displaySitemap();
|
||||
$this->_displayForm();
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Genera il tuo file sitemap di Google';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Non è possibile creare';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'file sitemap.xml.';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'File Sitemap generato con successo';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Errore durante la creazione del file sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Il tuo file sitemap di Google è online al seguente indirizzo:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Aggiornamento:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Dimensioni:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Pagine indicizzate:';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Sitemap contiene tutti i prodotti';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Default, solo i prodotti delle categorie attive sono inclusi nel Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Sitemap contiene tutte le pagine CMS';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Default, solo le pagine CMS nel blocco CMS sono inclusi nel Sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Genera file sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Aggiornamento file sitemap';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Search Engine Optimization';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Vedi';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'questa pagina';
|
||||
$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'per maggiori informazioni';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 378 B |
Reference in New Issue
Block a user