Thread: SitemapXML v.2

Page 219 of 222 FirstFirst ... 119169209217218219220221 ... LastLast
Results 2,181 to 2,190 of 2213
  1. #2181
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    Quote Originally Posted by wsworx View Post
    Hi lat9

    No, I only have the one cron job running.
    The only difference I see now between the previous cron job setup and the way the new landing page for Sitemap XML indicates wording is listed below:

    Current Cron job:
    Code:
    0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes ping=yes
    New sitemap example:
    Code:
    0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes
    I will correct that, but it doesn't seem like just removing the "ping" statement is going to help this situation.
    I agree; it's something to do with using the php form of invocation for the cron-job. Try the following instead:

    GET 'https://your_domain/index.php?main_page=sitemapxml&rebuild=yes'

  2. #2182
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    64
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Hello, another one short notice...

    As in "box_news" table all datetime columns (not only 'news_modified_date') can be NULL, it would be wise to use IFNULL function also for checking 'news_published_date' column in sql-queries in includes\modules\pages\sitemapxml\sitemapxml_boxnews.php file:

    Code:
    echo '<h3>' . TEXT_HEAD_BOXNEWS . '</h3>';
    $last_date = $db->Execute(
        "SELECT MAX(GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00'))) AS last_date
           FROM " . TABLE_BOX_NEWS . " n
          WHERE n.news_status = 1
            AND NOW() BETWEEN n.news_start_date AND n.news_end_date"
    );
    $table_status = $db->Execute("SHOW TABLE STATUS LIKE '" . TABLE_BOX_NEWS . "'");
    $last_date = max($table_status->fields['Update_time'], $last_date->fields['last_date']);
    if ($sitemapXML->SitemapOpen('boxnews', $last_date)) {
        $news = $db->Execute(
            "SELECT n.box_news_id, GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00')) AS last_date, nc.languages_id AS language_id
               FROM " . TABLE_BOX_NEWS . " n
                    INNER JOIN " . TABLE_BOX_NEWS_CONTENT . " nc
                        ON n.box_news_id = nc.box_news_id
                       AND nc.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
                       AND nc.news_title != ''
              WHERE n.news_status = 1
                AND NOW() BETWEEN n.news_start_date AND n.news_end_date" .
              (SITEMAPXML_BOXNEWS_ORDERBY !== '' ? ' ORDER BY ' . SITEMAPXML_BOXNEWS_ORDERBY : '')
        );
        $sitemapXML->SitemapSetMaxItems($news->RecordCount());
        foreach ($news as $next_item) { 
            $sitemapXML->writeItem(FILENAME_MORE_NEWS, 'news_id=' . $next_item['box_news_id'], $next_item['language_id'], $next_item['last_date'], SITEMAPXML_BOXNEWS_CHANGEFREQ);
        }
    
        $sitemapXML->SitemapClose();
        unset($news);
    }
    This will help to avoid PHP-warnings by passing NULL as parameter

    As "box_news" table is an 'external' table for this addon (created in another module), no additional verification can be excessive, I think
    Last edited by yesaul; 5 Mar 2025 at 03:58 PM.

  3. #2183
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    Quote Originally Posted by yesaul View Post
    Hello, another one short notice...

    As in "box_news" table all datetime columns (not only 'news_modified_date') can be NULL, it would be wise to use IFNULL function also for checking 'news_published_date' column in sql-queries in includes\modules\pages\sitemapxml\sitemapxml_boxnews.php file:

    Code:
    echo '<h3>' . TEXT_HEAD_BOXNEWS . '</h3>';
    $last_date = $db->Execute(
        "SELECT MAX(GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00'))) AS last_date
           FROM " . TABLE_BOX_NEWS . " n
          WHERE n.news_status = 1
            AND NOW() BETWEEN n.news_start_date AND n.news_end_date"
    );
    $table_status = $db->Execute("SHOW TABLE STATUS LIKE '" . TABLE_BOX_NEWS . "'");
    $last_date = max($table_status->fields['Update_time'], $last_date->fields['last_date']);
    if ($sitemapXML->SitemapOpen('boxnews', $last_date)) {
        $news = $db->Execute(
            "SELECT n.box_news_id, GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00')) AS last_date, nc.languages_id AS language_id
               FROM " . TABLE_BOX_NEWS . " n
                    INNER JOIN " . TABLE_BOX_NEWS_CONTENT . " nc
                        ON n.box_news_id = nc.box_news_id
                       AND nc.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
                       AND nc.news_title != ''
              WHERE n.news_status = 1
                AND NOW() BETWEEN n.news_start_date AND n.news_end_date" .
              (SITEMAPXML_BOXNEWS_ORDERBY !== '' ? ' ORDER BY ' . SITEMAPXML_BOXNEWS_ORDERBY : '')
        );
        $sitemapXML->SitemapSetMaxItems($news->RecordCount());
        foreach ($news as $next_item) { 
            $sitemapXML->writeItem(FILENAME_MORE_NEWS, 'news_id=' . $next_item['box_news_id'], $next_item['language_id'], $next_item['last_date'], SITEMAPXML_BOXNEWS_CHANGEFREQ);
        }
    
        $sitemapXML->SitemapClose();
        unset($news);
    }
    This will help to avoid PHP-warnings by passing NULL as parameter

    As "box_news" table is an 'external' table for this addon (created in another module), no additional verification can be excessive, I think
    Yet another GitHub issue opened: https://github.com/lat9/sitemapxml/issues/53

  4. #2184
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    64
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Yet another GitHub issue opened
    I have even more...

    As $from and $where variables can be not empty in 'includes/modules/pages/sitemapxml/sitemapxml_ezpages.php' file after fixing the bug with using of quotes for TABLE_EZPAGES_TEXT constant (see earlier correspondence in this tread), "p." prefix must be added to all columns belonging to TABLE_EZPAGES table in all sql-queries, for ex:

    Code:
        $page_query_sql =
            "SELECT p.toc_chapter
               FROM " . TABLE_EZPAGES . " p " . $from . "
              WHERE p.alt_url_external = ''
                AND (
                    (p.status_header = 1 AND p.header_sort_order > 0)
                     OR (p.status_sidebox = 1 AND p.sidebox_sort_order > 0)
                     OR (p.status_footer = 1 AND p.footer_sort_order > 0)
                    )
               AND p.status_toc != 0" .
               $where . "
             GROUP BY p.toc_chapter";
    Last edited by yesaul; 6 Mar 2025 at 02:25 PM.

  5. #2185
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Quote Originally Posted by lat9 View Post
    I agree; it's something to do with using the php form of invocation for the cron-job. Try the following instead:

    GET 'https://your_domain/index.php?main_page=sitemapxml&rebuild=yes'
    That seems to have taken care of the issue lat9, thank you.
    No more debug logs and no errors in my hosting site error logs so it must have worked.

  6. #2186
    Join Date
    Feb 2014
    Location
    Germany
    Posts
    295
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    I'm using Firefox at the moment and a new sitemap can't be created.
    The popup is being openend and the Url within looks ok but the content of the popup is just blank page and the sitemap is not being re-generated.

    Unfortunately I can't use chromium at the moment to have the job done.

    Is this a known issue?
    My business is GDPR compliant Webhosting and other Web Services.
    Beside that I still have a Zen Cart Shop running for Classic Vespa Spare Parts
    Locations in Germany, Spain and Finland. Other worldwide locations on demand

  7. #2187
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,456
    Plugin Contributions
    11

    Default Re: SitemapXML v.2

    A log file should be generated as it sounds like a partial blank page.

    https://docs.zen-cart.com/user/troub...ng/blank_page/

  8. #2188
    Join Date
    Feb 2014
    Location
    Germany
    Posts
    295
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    You're right. There's one:

    Code:
    PHP Fatal error: Uncaught Error: Undefined constant "NAVBAR_TITLE" in /includes/modules/pages/sitemapxml/header_php.php:28
    Stack trace:
    #0 /index.php(36): require()
    #1 {main}
    thrown in /includes/modules/pages/sitemapxml/header_php.php on line 28
    My business is GDPR compliant Webhosting and other Web Services.
    Beside that I still have a Zen Cart Shop running for Classic Vespa Spare Parts
    Locations in Germany, Spain and Finland. Other worldwide locations on demand

  9. #2189
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    Quote Originally Posted by Shop Suey View Post
    You're right. There's one:

    Code:
    PHP Fatal error: Uncaught Error: Undefined constant "NAVBAR_TITLE" in /includes/modules/pages/sitemapxml/header_php.php:28
    Stack trace:
    #0 /index.php(36): require()
    #1 {main}
    thrown in /includes/modules/pages/sitemapxml/header_php.php on line 28
    What version of Zen Cart is in use? The SitemapXML distribution provides /includes/languages/english/lang.sitemap.xml, which includes that language-constant.

  10. #2190
    Join Date
    Feb 2014
    Location
    Germany
    Posts
    295
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    I now understand this is not a known issue.
    I'm using the PHP 8.3 compatible European branch for German language version (1.5.7h)
    I wrote a bug report at github
    My business is GDPR compliant Webhosting and other Web Services.
    Beside that I still have a Zen Cart Shop running for Classic Vespa Spare Parts
    Locations in Germany, Spain and Finland. Other worldwide locations on demand

 

 

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR