diff --git a/NEUE DATEIEN/DEINADMIN/includes/installers/sitemapxml/4_2_1.php b/NEUE DATEIEN/DEINADMIN/includes/installers/sitemapxml/4_2_1.php new file mode 100644 index 0000000..94f40a7 --- /dev/null +++ b/NEUE DATEIEN/DEINADMIN/includes/installers/sitemapxml/4_2_1.php @@ -0,0 +1,2 @@ +Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '4.2.1' WHERE configuration_key = 'SITEMAPXML_VERSION' LIMIT 1;"); \ No newline at end of file diff --git a/NEUE DATEIEN/includes/classes/sitemapxml.php b/NEUE DATEIEN/includes/classes/sitemapxml.php index 1e449ac..3dcfc21 100644 --- a/NEUE DATEIEN/includes/classes/sitemapxml.php +++ b/NEUE DATEIEN/includes/classes/sitemapxml.php @@ -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'); @@ -124,7 +124,13 @@ 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'], @@ -132,7 +138,7 @@ public function __construct(bool $inline = false, bool $rebuild = false, bool $g ]; $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') { @@ -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; } @@ -819,6 +825,10 @@ protected function _fileClose() protected function _fileSize(string $fn): int { + if (!file_exists($fn)) { + return 0; + } + clearstatcache(); return (int)filesize($fn); } diff --git a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_manufacturers.php b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_manufacturers.php index 00868b2..2679c25 100644 --- a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_manufacturers.php +++ b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_manufacturers.php @@ -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 '

' . TEXT_HEAD_MANUFACTURERS . '

'; @@ -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(); diff --git a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php index 03fb3d5..7e499cb 100644 --- a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php +++ b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php @@ -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 '

' . TEXT_HEAD_PRODUCTS_REVIEWS . '

'; @@ -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(); diff --git a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_reviews.php b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_reviews.php index a309a7b..4631e88 100644 --- a/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_reviews.php +++ b/NEUE DATEIEN/includes/modules/pages/sitemapxml/sitemapxml_reviews.php @@ -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 '

' . TEXT_HEAD_REVIEWS . '

'; @@ -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(); diff --git a/UNINSTALL/uninstall.sql b/UNINSTALL/uninstall.sql index 4b69699..bfb590d 100644 --- a/UNINSTALL/uninstall.sql +++ b/UNINSTALL/uninstall.sql @@ -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! ################################################################################## diff --git a/liesmich.txt b/liesmich.txt index 7379066..5b1df6c 100644 --- a/liesmich.txt +++ b/liesmich.txt @@ -1,4 +1,4 @@ -Sitemap XML 4.2.0 für Zen Cart 1.5.7 deutsch +Sitemap XML 4.2.1 für Zen Cart 1.5.7 deutsch Dieses Modul generiert für Google und Bing geeignete XML Sitemaps nach den hier beschriebenen Spezifikationen: https://support.google.com/webmasters/answer/156184?hl=de&topic=8476&ctx=topic @@ -8,11 +8,17 @@ Falls Zusatzmodule wie Testimonial Manager oder News Box Manager im Shop verwend Anpassung und Überarbeitung des Moduls Sitemap XML 3.9.5 von Andrew Berezin zur Verwendung in der deutschen Zen Cart Version 1.5.7 -Dieses Modul setzt mindestens Zen Cart 1.5.7h deutsch voraus! +Dieses Modul setzt mindestens Zen Cart 1.5.7i deutsch voraus! Changelog: +Version 4.2.1 +webchills - Dezember 2024 + +Anpassungen für 1.5.7i und PHP 8.3.x + + Version 4.2.0 webchills - März 2024 @@ -76,7 +82,7 @@ DELETE FROM configuration_language WHERE configuration_key LIKE '%SITEMAPXML%'; DELETE FROM configuration_group WHERE configuration_group_title = 'Sitemap XML'; DELETE FROM admin_pages WHERE language_key LIKE '%SITEMAPXML%'; -Erst dann Version 4.2.0 installieren +Erst dann Version 4.2.1 installieren Die Installation ist sehr einfach, es werden keinerlei bestehende Dateien geändert oder überschrieben. @@ -98,234 +104,13 @@ Infos dazu unter Tools > Sitemap XML UPDATE VON VERSION 4.x -Einfach die 4.2.0 Dateien hochladen und alle bestehenden 4.x Dateien damit überschreiben. Modul aktualisiert die Versionsnummer dann automatisch. +Einfach die 4.2.1 Dateien hochladen und alle bestehenden 4.x Dateien damit überschreiben. Modul aktualisiert die Versionsnummer dann automatisch. -Falls Sie für das Generieren der Sitemaps bereits einen Cronjob eingerichtet haben, beachten Sie bitte, dass die Ping Funktionalität in Version 4.2.0 entfernt wurde, da die Suchmaschinen das nicht mehr unterstützen. +Falls Sie für das Generieren der Sitemaps bereits einen Cronjob eingerichtet haben, beachten Sie bitte, dass die Ping Funktionalität seit Version 4.2.0 entfernt wurde, da die Suchmaschinen das nicht mehr unterstützen. Sollte Ihre Cronjob URL also noch &ping=yes enthalten, dann entfernen Sie das aus Ihrer URL! DEINSTALLATION: Alle von diesem Modul hinzugefügten Dateien wieder vom Server löschen -Dann im Ordner UNINSTALL die uninstall.sql mit einem Texteditor öffnen, Inhalt kopieren und absenden unter Tools > SQL Patches installieren - - - -ORIGINAL ENGLISCHE README: - - -(Die Hinweise zu Installation und Upgrade in der englischen readme sind NICHT für dieses Modul zu gebrauchen, sie liefert aber einige wichtige detaillierte Infos zur Funktionsweise dieses Moduls) - -# SitemapXML - -## Version -v 3.9.3 16.04.2017 18:35 - -Author -Andrew Berezin http://eCommerce-Service.com - -Thanks -Special thanks to DivaVocals for the quality of the readme. - -## Description -This Script generates an Sitemap as described here: -http://www.sitemaps.org/ -http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156184&topic=8476&ctx=topic - -Zen-Cart Version --------------- -1.3.8, 1.3.9x, 1.5.5 - -Support thread --------------- -http://www.zen-cart.com/showthread.php?126810-SitemapXML-v-2 - -http://zen-cart.su/plugins/sitemap-xml/msg7/ - -https://github.com/AndrewBerezin/zen-cart-sitemap-xml - -Affected files --------------- -None - -Affects DB --------------- -Yes (creates new records into configuration_group, configuration and admin_pages tables). - -DISCLAIMER --------------- -Installation of this contribution is done at your own risk. -Backup your ZenCart database and any and all applicable files before proceeding. - -Features: --------------- -* supports Search-Engine Safe URLs (including MagicSeo) -* could be accessed by http or command line -* autogenerates multiple sitemaps for sites with over 50.000 URLs -* autogenerates multiple sitemaps if filesize exceeded 10MB -* writes files compressed or uncompressed (You can use the gzip feature or compress your Sitemap files using gzip) -* using index.php wrapper - http://domain.com/index.php?main_page=sitemapxml -* using languages file and etc. -* auto-notify Google and other SE. -* generation of a sitemap index file -* generation of xml-sitemaps for (separate files): - 1. Products with images (supports multilangual products, support hideCategories) - 2. Categories with images (supports multilangual categories, support hideCategories) - 3. Manufacturers with images - 4. Main (Home) page - 5. Reviews - 6. EZ-pages - * multi-language support, - * 'EZ pages rel=nofollow attribute' support (http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=944), - * 'date_added'/'last_modified' support, - * check internal links ('alt_url') by "noindex" rule (main_page in ROBOTS_PAGES_TO_SKIP), - * toc_chapter proccessing - 7. Testimonial Manager http://www.zen-cart.com/downloads.php?do=file&id=299 - 8. News Box Manager http://www.zen-cart.com/downloads.php?do=file&id=147 - 9. News and Article Manager & Optional Sideboxes http://www.zen-cart.com/downloads.php?do=file&id=791 - 10. Product reviews page - -If the products, categories, reviews have not changed since the last generation (time creation corresponding xml-sitemap file), a new xml-sitemap file not created (using existing xml-sitemap). - -Priority is calculated on the basis of the positions in the selection from the database, ie the operator ORDER BY in the sql query. First item have priority=1.00, last=0.10. So can no longer be situations where all items in the file have the same priority. -* Products - ORDER BY p.products_sort_order ASC, last_date DESC -* Categories - ORDER BY c.sort_order ASC, last_date DESC -* Reviews - ORDER BY r.reviews_rating ASC, last_date DESC -* EZ-pages - ORDER BY p.sidebox_sort_order ASC, last_date DESC -* Testimonials - ORDER BY last_date DESC -* Box News - ORDER BY last_date DESC - -$_GET parameters: -------------------------- -ping=yes - Pinging Search Engine Systems. - -inline=yes - output file sitemapindex.xml. In Google Webmaster Tools you can define your "Sitemap URL": - http://your_domain/index.php?main_page=sitemapxml&inline=yes - And every time Google will get index.php?main_page=sitemapxml he will receive a fresh sitemapindex.xml. - -genxml=no - don't generate xml-files. - -rebuild=yes - force rebuild all sitemap*.xml files. - -Comments and suggestions are welcome. -If you need any more sitemaps (faq, news, etc) you may ask me, but I will do only if it matches with my interests. - -Install: --------------- -0. BACK UP your database & store. -1. Unzip the SitemapXML package to your local hard drive, retaining the folder structure. -2. Rename the "YOUR_Admin" folder in the "sitemapXML" folder to match the name of your admin folder. - sitemapXML/YOUR_Admin/ -3. Upload the files from "sitemapXML" to the root of your store. (DO NOT upload the "sitemapXML" folder, just the CONTENTS of this folder (copy ALL of the add-on files to your store!! Most issues are caused by store owners who decide to NOT load ALL of the module files) -4. Set permissions on the directory /sitemap/ to 777. -5. Go to Admin -> Configuration -> Sitemap XML and setup all parameters. -6. Go to Admin -> Tools -> Sitemap XML (If error messages occur, change permissions on the XML files to 777). -7. To have this update and automatically notify Google, you will need to set up a Cron job via your host's control panel. -8. For Zen-Cart version 1.3.9f and earlier. Edit file includes/.htaccess: - Find - - Replace by - - -Upgrade: --------------- -0. BACK UP your database & store. -1. Unzip the SitemapXML package to your local hard drive, retaining the folder structure. -2. Rename the "YOUR_Admin" folder in the "sitemapXML" folder to match the name of your admin folder. - sitemapXML/YOUR_Admin/ -3. Upload the files from "sitemapXML" to the root of your store. (DO NOT upload the "sitemapXML" folder, just the CONTENTS of this folder (copy ALL of the add-on files to your store!! Most issues are caused by store owners who decide to NOT load ALL of the module files) - -Deleting OLD copies of this mod (circa 1.3.8 - such as version 2.1.0, which was around for a number of years) --------------- -a) Delete the following files from your admin directory: -- ./includes/boxes/extra_boxes/googlesitemap_tools_dhtml.php -- ./includes/extra_datafiles/googlesitemap.php -- ./includes/languages/english/googlesitemap.php -- ./includes/languages/english/extra_definitions/googlesitemap.php -- ./includes/languages/italian/extra_definitions/googlesitemap.php -- ./includes/languages/italian/googlesitemap.php -- ./includes/languages/russian/googlesitemap.php -- ./includes/languages/russian/extra_definitions/googlesitemap.php -- ./googlesitemap.php - -b) Run the following SQL in admin->tools->install SQL Patches: -- SET @configuration_group_id=0; -- SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'Google XML Sitemap' LIMIT 1; -- DELETE FROM configuration WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0; -- DELETE FROM configuration_group WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0; - -Un-Install: --------------- -1. Go to Admin -> Tools -> Sitemap XML and click "Un-Install SitemapXML SQL". -2. Delete all files that were copied from the installation package. - -History --------------- -v 2.0.0 02.02.2009 19:21 - Initial version - -v 2.1.0 30.04.2009 10:35 - Lot of changes and bug fixed - -v 3.0.2 11.08.2011 16:14 - Lot of changes and bug fixed, Zen-Cart 1.5.0 Support, MagicSeo Support - -v 3.0.3 27.08.2011 13:11 - Small bug fix, delete Zen-Cart 1.5.0 Autoinstall - -v 3.0.4 30.09.2011 14:58 - Code cleaning, Readme corrected, Small bug fix, Zen-Cart 1.5.0 compliant - replace admin $_GET by $_POST - -v 3.0.5 02.12.2011 02:11 - Support Box News module, cleaning - -v 3.1.0 14.12.2011 13:32 - Code cleaning, Readme corrected, Small bug fix, - Replace Configuration parameter 'Generate language for default language' by 'Using parameter language in links', - Modified algorithm for processing multi-language links - Add Sitemap Files List to admin - -v 3.2.2 07.05.2012 19:12 - Bug fixes - Traditional code cleaning - Correct MagicSeo Support - Truncate additional multi files - Add sitemapXML simple file manager - Add 'Start Security Token' - Rename sitemapxml_homepage.php to sitemapxml_mainpage.php - Add image sitemap support http://support.google.com/webmasters/bin/answer.py?answer=178636 for products, categories, manufacturers - -v 3.2.4 28.05.2012 13:38 - Bug fixes - Add parameter "Check Dublicates" - Add parameter "Sitemap directory" - -v 3.2.5 31.05.2012 14:52 - Add parameter "Use cPath parameter in products url". Coordinate this value with the value of variable $includeCPath in file init_canonical.php - -v 3.2.6 17.06.2012 16:13 - Bug fixes - Rewrite gss.xls - -v 3.2.7 24.09.2012 13:23 - ReadMe editing - thanks to Scott C Wilson aka swguy (http://www.zen-cart.com/member.php?22320-swguy) - Products additional images sitemap support - Bug fix 'inline=yes' - -v 3.2.8 24.01.2013 18:10 - Add url encoded for RFC 3986 compatibility. - -v 3.2.9 24.02.2013 13:48 - Bug fixes - Delete xml validations - Delete absolute path from information message - -v 3.2.10 22.04.2013 8:15 - Add confirm() to delete/truncate - -v 3.2.12 19.09.2013 8:06 - Replace absolute path to .xsl - -v 3.3.1 31.01.2015 16:27 - Bug fixes - Add Product reviews pages - Add plugin control - -v 3.6.0 26.04.2016 10:33 - Bug fixes - -v 3.7.0 07.07.2016 11:25 - Add configuration parameter for categories paging - -v 3.8.0 07.07.2016 12:39 - Code Review. Thanks to steve aka torvista - -v 3.9.1 29.08.2016 18:56 - Add auto installer. Thanks to Frank Riegel aka frank18 - -v 3.9.2 09.11.2016 13:37 - Bug fixes (Select plugins) - -v 3.9.3 16.04.2017 18:35 - Auto installer Bug fixes - -v 3.9.4 17.04.2017 14:27 - Another Auto installer Bug fixes - -v 3.9.5 17.04.2017 15:55 - Add configuration multilanguage support \ No newline at end of file +Dann im Ordner UNINSTALL die uninstall.sql mit einem Texteditor öffnen, Inhalt kopieren und absenden unter Tools > SQL Patches installieren \ No newline at end of file