File: /var/www/vhosts/paiskincare.com/httpdocs2/sitemaps/specials.php
<?php
/**
* MSU Sitemaps - Magic SEO URL URL for ZenCart
* http://www.magic-seo-url.com/zencart/
*
* 2009, (c) Inveo s.r.o.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
**/
if(!defined('SM_IN_SITEMAPS')) exit();
global $cache, $sm, $db;
$result = $db->Execute("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE configuration_key = 'MAX_DISPLAY_SEARCH_RESULTS'");
$perPage = $result->fields['configuration_value'];
$result = $db->Execute("SELECT COUNT(s.products_id) AS numProducts FROM ".TABLE_SPECIALS." s, ".TABLE_PRODUCTS." p WHERE p.products_id = s.products_id AND products_status = '1' AND s.status = '1'");
if(!$result->EOF) {
foreach($GLOBALS['smInstalledLang'] as $langId => $langCode) {
$url = 'specials/';
if($GLOBALS['smMultilang']) {
$url = $langCode.'/'.$url;
$sm->addUrlToSiteMap($url, 'weekly');
} else {
$sm->addUrlToSiteMap($url, 'weekly');
break;
}
}
return;
}
while(!$result->EOF) {
foreach($GLOBALS['smInstalledLang'] as $langId => $langCode) {
$url = 'specials/';
if($GLOBALS['smMultilang']) {
$url = $langCode.'/'.$url;
}
//$sm->addUrlToSiteMap($url, 'weekly', '0.8');
$sm->addUrlToSiteMap($url, 'weekly');
$pages = ceil($result->fields['numProducts'] / $perPage);
$pagination = 'index'.URI_DELIMETER.'__PAGE__'.URI_EXTENSION;
for ($i = 2; $i <= $pages; $i++) {
//$sm->addUrlToSiteMap($url.str_replace('__PAGE__', $i, $pagination), 'weekly', '0.8');
$sm->addUrlToSiteMap($url.str_replace('__PAGE__', $i, $pagination), 'weekly');
}
}
$result->MoveNext();
}
?>