Mask all pages

This commit is contained in:
Michael RICOIS 2018-03-19 11:57:01 +01:00
parent 3fa1118554
commit 0b451e2fc2

View File

@ -119,7 +119,7 @@ XML;
}
/* Categories Generator */
$exclude_categories = array();
/*$exclude_categories = array();
if (Module::isInstalled('privatesales')) {
include(dirname(__FILE__).'/../privatesales/Sale.php');
$has_trailers = file_exists(dirname(__FILE__).'/../privatesales/trailer.php');
@ -192,7 +192,7 @@ XML;
}
}
}
}
}*/
/*if (Configuration::get('PS_REWRITING_SETTINGS')) {
$categories = Db::getInstance()->ExecuteS('
@ -226,7 +226,7 @@ XML;
$this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($category['date_upd'], 0, 10));
}
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
/*$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
@ -254,29 +254,31 @@ XML;
'.(count($exclude_categories) > 0? ' AND p.id_category_default NOT IN ('.implode(', ', $exclude_categories).')': '').'
'.(Configuration::get('GSITEMAP_ALL_PRODUCTS') ? '' : 'HAVING level_depth IS NOT NULL').'
ORDER BY pl.id_product, pl.id_lang ASC
');
');*/
$tmp = NULL;
$res = NULL;
foreach($products as $product) {
if ($tmp == $product['id_product']) {
$res[$tmp]['images'][] = array('id_image' => $product['id_image'], 'legend_image' => $product['legend_image']);
} else {
$tmp = $product['id_product'];
$res[$tmp] = $product;
unset($res[$tmp]['id_image'], $res[$tmp]['legend_image']);
$res[$tmp]['images'][] = array('id_image' => $product['id_image'], 'legend_image' => $product['legend_image']);
if (count($products) > 0) {
foreach($products as $product) {
if ($tmp == $product['id_product']) {
$res[$tmp]['images'][] = array('id_image' => $product['id_image'], 'legend_image' => $product['legend_image']);
} else {
$tmp = $product['id_product'];
$res[$tmp] = $product;
unset($res[$tmp]['id_image'], $res[$tmp]['legend_image']);
$res[$tmp]['images'][] = array('id_image' => $product['id_image'], 'legend_image' => $product['legend_image']);
}
}
}
foreach($res as $product) {
if (($priority = 0.7 - ($product['level_depth'] / 10)) < 0.1) {
$priority = 0.1;
foreach($res 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);
}
$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...) */