Thread: SitemapXML v.2

Page 1 of 2 12 LastLast
Results 1 to 10 of 2228

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,839
    Plugin Contributions
    31

    Default Re: SitemapXML v.2

    Thanks for the comments.

    In the end I put
    ini_set('memory_limit','512M');
    in the sitemapxml.php file called by the cron, to keep it self contained.

    I just thought I'd post this to save others wondering why the two approaches (admin/cron) may have different results. It took me too long to work it out.

    I don't need to call the 7.3 binary explicitly. I just left it in there as I was using 7.1 for this until I started investigating it recently and wanted to keep the command intact for reference.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    115
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    I'm using the plugin for Zen Cart 1.5.7 on PHP 7.3 and got this fatal error when trying to update the sitemap settings in admin:

    --> PHP Fatal error: Uncaught Error: Call to undefined function zen_admin_demo() in /home/USER/public_html/ADMIN/sitemapxml.php:35

    For now I've commented it out. I can't find any reference to zen_admin_demo(), is this a function that was removed from ZC? Does commenting out the switch statement suffice or will it have any unintended consequences?

    Many thanks, Edith

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: SitemapXML v.2

    Yes, the zen_admin_demo function was removed in zc157; commenting that line out is the thing to do.

  4. #4
    Join Date
    Jun 2008
    Location
    UK
    Posts
    209
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Quote Originally Posted by lat9 View Post
    Yes, the zen_admin_demo function was removed in zc157; commenting that line out is the thing to do.

    Please could you clarify as Im not a coder.

    I have just loaded sitemap onto a v157 site.

    And am getting a ....

    Call to undefined function zen_admin_demo() in zcadmin/sitemapxml.php line 35.

    You say to comment it out ... so I commented out that 1 line - case (zen_admin_demo()): and the line below shows an error.


    What lines do I comment out please ?

    Code:
    if (zen_not_null($action)) {
    
      switch ($action) {
        // demo active test
        case (zen_admin_demo()):
          $action = '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_SITEMAPXML));
          break;
    
        case 'upgrade':
        case 'install':

  5. #5
    Join Date
    Jun 2008
    Location
    UK
    Posts
    209
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    woops. Have found the answer ... as there is another post

  6. #6
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: SitemapXML v.2

    Quote Originally Posted by toyseller View Post
    woops. Have found the answer ... as there is another post
    Glad you found it, it is always helpful to also include the link to where that particular post is. This way it helps you (in the future) and anyone else attempting to do the same... BTW, yes, probably too late to modify the above post, so help yourself/others as seen fit...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: SitemapXML v.2

    Running Sitemap XML v3.9.6 on zc157c with strict MySQL. Running the admin tool to create the base sitemaps results in a MySQL fatal error:
    Code:
    [03-Jan-2022 21:23:52 Europe/Berlin] Request URI: /mysite/index.php?main_page=sitemapxml&rebuild=yes, IP address: 127.0.0.1
    #1 trigger_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:171]
    #2 queryFactory->show_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:143]
    #3 queryFactory->set_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:270]
    #4 queryFactory->Execute() called at [C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php:30]
    #5 include(C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php) called at [C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php:21]
    #6 require(C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php) called at [C:\xampp\htdocs\mysite\index.php:94]
    --> PHP Fatal error: 1055:'canadianllama157.rd.languages_id' isn't in GROUP BY :: SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
    FROM reviews r
    LEFT JOIN reviews_description rd ON (r.reviews_id = rd.reviews_id),
    products p
    WHERE p.products_id=r.products_id
    AND p.products_status=1
    AND r.status = 1
    AND rd.languages_id IN (1,2)
    GROUP BY r.products_id ORDER BY last_date DESC ==> (as called by) C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php on line 30 <== in C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php on line 171.
    I was able to correct the issue via update to /includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php, adding the highlighted change to the GROUP BY clause:
    Code:
    <?php
    /**
     * Sitemap XML
     *
     * @package Sitemap XML
     * @copyright Copyright 2005-2015 Andrew Berezin eCommerce-Service.com
     * @copyright Copyright 2003-2015 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: sitemapxml_products_reviews.php, v 1.1 31.01.2015 15:29:52 AndrewBerezin $
     */
    
    echo '<h3>' . TEXT_HEAD_PRODUCTS_REVIEWS . '</h3>';
    $last_date = $db->Execute("SELECT MAX(GREATEST(r.date_added, IFNULL(r.last_modified, '0001-01-01 00:00:00'))) AS last_date
                               FROM " . TABLE_REVIEWS . " r
                               WHERE r.status = '1'");
    $table_status = $db->Execute("SHOW TABLE STATUS LIKE '" . TABLE_REVIEWS . "'");
    $last_date = max($table_status->fields['Update_time'], $last_date->fields['last_date']);
    if ($sitemapXML->SitemapOpen('products_reviews', $last_date)) {
    //-bof-20220103-lat9-Correcting MySQL fatal error, missing rd.languages_id from GROUP BY
      $sql = "SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
              FROM " . TABLE_REVIEWS . " r
                LEFT JOIN " . TABLE_REVIEWS_DESCRIPTION . " rd ON (r.reviews_id = rd.reviews_id),
                   " . TABLE_PRODUCTS . " p
              WHERE p.products_id=r.products_id
                AND p.products_status=1
                AND r.status = 1
                AND rd.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
              GROUP BY r.products_id, rd.languages_id" .
              (SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY != '' ? " ORDER BY " . SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY : '');
    //-eof-20220103-lat9
      $reviews = $db->Execute($sql);
    /*
    	if (zen_not_null($result['last_modified']) ){
    		$lastmod = $reviews->fields['last_modified'];
    	} else {
    		$lastmod = $reviews->fields['date_added'];
    	}
    */
      $sitemapXML->SitemapSetMaxItems($reviews->RecordCount());
      while (!$reviews->EOF) {
        $sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $reviews->fields['products_id'], $reviews->fields['languages_id'], $reviews->fields['last_date'], SITEMAPXML_PRODUCTS_REVIEWS_CHANGEFREQ);
        $reviews->MoveNext();
      }
      $sitemapXML->SitemapClose();
      unset($reviews);
    }
    
    // EOF

  8. #8
    Join Date
    Feb 2009
    Location
    atlanta GA
    Posts
    296
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Using sitemapXML 3.9.6. And also getting the Call to undefined function zen_admin_demo() in zcadmin/sitemapxml.php line 35 error log that the other user was getting in this post

    https://www.zen-cart.com/showthread....74#post1384774

    Would love to lean the fix. Any time i try to save any settings in sitemapxml it gives me a blank page from admin and generates another error log.
    Last edited by jasonshanks; 14 Feb 2022 at 12:53 AM.
    Zencart 1.5.6c PHP 7.2 Order Replacement AC Adapters and Power Cords Online www.missingcord.com

  9. #9
    Join Date
    Feb 2009
    Location
    atlanta GA
    Posts
    296
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Quote Originally Posted by toyseller View Post
    woops. Have found the answer ... as there is another post
    Could you post how you fixed it here ? Thanks friend :)
    Zencart 1.5.6c PHP 7.2 Order Replacement AC Adapters and Power Cords Online www.missingcord.com

  10. #10
    Join Date
    Jun 2021
    Posts
    42
    Plugin Contributions
    2

    Default Re: SitemapXML v.2

    Quote Originally Posted by jasonshanks View Post
    Could you post how you fixed it here ? Thanks friend :)
    Comment lines 35 to 39 of sitemapxml.php, like this:

    HTML Code:
        /*case (zen_admin_demo()):
          $action = '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_SITEMAPXML));
          break;*/

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg