Skip to content

Commit

Permalink
Version 4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
webchills committed Dec 12, 2024
1 parent c01530b commit 35b5d61
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 238 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '4.2.1' WHERE configuration_key = 'SITEMAPXML_VERSION' LIMIT 1;");
18 changes: 14 additions & 4 deletions NEUE DATEIEN/includes/classes/sitemapxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Zen Cart German Version - www.zen-cart-pro.at
* @copyright Portions Copyright 2003 osCommerce
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
* @version $Id: sitemapxml.php 2024-02-19 15:37:16Z webchills $
* @version $Id: sitemapxml.php 2024-12-12 10:16:16Z webchills $
*/

zen_define_default('TABLE_SITEMAPXML_TEMP', DB_PREFIX . 'sitemapxml_temp');
Expand Down Expand Up @@ -124,15 +124,21 @@ public function __construct(bool $inline = false, bool $rebuild = false, bool $g
'languages_code' => $_SESSION['languages_code'],
];
$languagesIDsArray = [];
foreach ($lng->catalog_languages as $language) {
// -----
// The language::catalog_languages is deprecated since 1.5.7i, so
// retrieve the languages via the zc200+ method, if present, else
// the prior versions' public array.
//
$catalog_languages = (method_exists($lng, 'get_languages_by_code')) ? $lng->get_languages_by_code() : $lng->catalog_languages;
foreach ($catalog_languages as $language) {
$this->languages[$language['id']] = [
'directory' => $language['directory'],
'id' => $language['id'],
'code' => $language['code'],
];
$languagesIDsArray[] = $language['id'];
if ($language['code'] === DEFAULT_LANGUAGE) {
$this->default_language_id = $language['id'];
$this->default_language_id = (int)$language['id'];
}
}
if (SITEMAPXML_USE_ONLY_DEFAULT_LANGUAGE === 'true') {
Expand Down Expand Up @@ -289,7 +295,7 @@ protected function SitemapWriteItem($loc, int $lastmod = 0, $changefreq = '', $x

if ($this->sitemapFileItems >= $this->sitemapxml_max_entries || ($this->sitemapFileSize + strlen($itemRecord)) >= $this->sitemapxml_max_size) {
$this->_SitemapCloseFile();
$this->sitemapFileName = $this->_getNameFileXML($this->sitemapFile . str_pad($this->sitemapFileNameNumber, 3, '0', STR_PAD_LEFT));
$this->sitemapFileName = $this->_getNameFileXML($this->sitemapFile . str_pad((string)$this->sitemapFileNameNumber, 3, '0', STR_PAD_LEFT));
if (!$this->_fileOpen($this->sitemapFileName)) {
return false;
}
Expand Down Expand Up @@ -819,6 +825,10 @@ protected function _fileClose()

protected function _fileSize(string $fn): int
{
if (!file_exists($fn)) {
return 0;
}

clearstatcache();
return (int)filesize($fn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Zen Cart German Version - www.zen-cart-pro.at
* @copyright Portions Copyright 2003 osCommerce
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
* @version $Id: sitemapxml_manufacturers.php 2024-02-19 15:37:16Z webchills $
* @version $Id: sitemapxml_manufacturers.php 2024-12-12 10:37:16Z webchills $
*/

echo '<h3>' . TEXT_HEAD_MANUFACTURERS . '</h3>';
Expand Down Expand Up @@ -38,7 +38,14 @@
];
$xtra = $sitemapXML->imagesTags($images, SITEMAPXML_MANUFACTURERS_IMAGES_CAPTION, SITEMAPXML_MANUFACTURERS_IMAGES_LICENSE);
}
$sitemapXML->writeItem(FILENAME_DEFAULT, 'manufacturers_id=' . $next_manufacturer['manufacturers_id'], $next_manufacturer['languages_id'], $next_manufacturer['last_date'], SITEMAPXML_MANUFACTURERS_CHANGEFREQ, $xtra);
$sitemapXML->writeItem(
FILENAME_DEFAULT,
'manufacturers_id=' . $next_manufacturer['manufacturers_id'],
$next_manufacturer['languages_id'],
$next_manufacturer['last_date'] ?? $last_date,
SITEMAPXML_MANUFACTURERS_CHANGEFREQ,
$xtra
);
}

$sitemapXML->SitemapClose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Zen Cart German Version - www.zen-cart-pro.at
* @copyright Portions Copyright 2003 osCommerce
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
* @version $Id: sitemapxml_products_reviews.php 2024-02-19 15:49:16Z webchills $
* @version $Id: sitemapxml_products_reviews.php 2024-12-12 10:49:16Z webchills $
*/

echo '<h3>' . TEXT_HEAD_PRODUCTS_REVIEWS . '</h3>';
Expand Down Expand Up @@ -34,7 +34,13 @@

$sitemapXML->SitemapSetMaxItems($reviews->RecordCount());
foreach ($reviews as $next_review) {
$sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $next_review['products_id'], $next_review['languages_id'], $next_review['last_date'], SITEMAPXML_PRODUCTS_REVIEWS_CHANGEFREQ);
$sitemapXML->writeItem(
FILENAME_PRODUCT_REVIEWS,
'products_id=' . $next_review['products_id'],
$next_review['languages_id'],
$next_review['last_date'] ?? $last_date,
SITEMAPXML_PRODUCTS_REVIEWS_CHANGEFREQ
);
}

$sitemapXML->SitemapClose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Zen Cart German Version - www.zen-cart-pro.at
* @copyright Portions Copyright 2003 osCommerce
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
* @version $Id: sitemapxml_reviews.php 2024-02-19 15:32:16Z webchills $
* @version $Id: sitemapxml_reviews.php 2024-12-12 10:13:16Z webchills $
*/

echo '<h3>' . TEXT_HEAD_REVIEWS . '</h3>';
Expand All @@ -29,7 +29,13 @@
);
$sitemapXML->SitemapSetMaxItems($reviews->RecordCount());
foreach ($reviews as $next_review) {
$sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $next_review['products_id'] . '&reviews_id=' . $next_review['reviews_id'], $next_review['language_id'], $next_review['last_date'], SITEMAPXML_REVIEWS_CHANGEFREQ);
$sitemapXML->writeItem(
FILENAME_PRODUCT_REVIEWS_INFO,
'products_id=' . $next_review['products_id'] . '&reviews_id=' . $next_review['reviews_id'],
$next_review['language_id'],
$next_review['last_date'] ?? $last_date,
SITEMAPXML_REVIEWS_CHANGEFREQ
);
}

$sitemapXML->SitemapClose();
Expand Down
2 changes: 1 addition & 1 deletion UNINSTALL/uninstall.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##################################################################################
# UNINSTALL Sitemap XML 4.2.0 - 2024-02-25 - webchills
# UNINSTALL Sitemap XML 4.2.1 - 2024-12-12 - webchills
# UNINSTALL - NUR AUSFÜHREN WENN SIE DAS MODUL KOMPLETT ENTFERNEN WOLLEN!
##################################################################################

Expand Down
Loading

0 comments on commit 35b5d61

Please sign in to comment.