Ankündigung

Einklappen
Keine Ankündigung bisher.

RSS Feed Problem mit MySQL 5.7

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    RSS Feed Problem mit MySQL 5.7

    Hallo zusammen,

    kann mir wer bei den Logfiles helfen?
    Ich werde mal wieder nicht schlau daraus. Ist erst gekommen nach meinen Providerwechsel.
    PHP-Code:
    [02-Aug-2017 20:24:28 Europe/BerlinRequest URI: /, IP address66.249.79.27
    #1  zen_categories_ul_generator->buildBranch() called at [/XXX/XXX/ZC_SHOP_155/includes/classes/categories_ul_generator.php:73]
    #2  zen_categories_ul_generator->buildTree() called at [/XXX/XXX/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php:38]
    #3  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php) called at [/XXX/XXX/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php:264]
    #4  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/XXX/XXX/ZC_SHOP_155/index.php:97]

    [02-Aug-2017 20:24:28 Europe/BerlinPHP Warning:  A non-numeric value encountered in /XXXX/XXX/ZC_SHOP_155/includes/classes/categories_ul_generator.php on line 46
    [02-Aug-2017 20:24:28 Europe/BerlinRequest URI: /, IP address66.249.79.27
    #1  zen_categories_ul_generator->buildBranch() called at [/XXX/XXX/ZC_SHOP_155/includes/classes/categories_ul_generator.php:73]
    #2  zen_categories_ul_generator->buildTree() called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php:38]
    #3  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php) called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php:264]
    #4  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/index.php:97]

    [02-Aug-2017 20:24:28 Europe/BerlinPHP Warning:  A non-numeric value encountered in /XXX/XXX/ZC_SHOP_155/includes/classes/categories_ul_generator.php on line 61
    [02-Aug-2017 20:24:28 Europe/BerlinRequest URI: /, IP address66.249.79.27
    #1  zen_categories_ul_generator->buildBranch() called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/includes/classes/categories_ul_generator.php:73]
    #2  zen_categories_ul_generator->buildTree() called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php:38]
    #3  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/templates/tpl_modules_mobile_menu.php) called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php:264]
    #4  require(/home/www/ZC_SHOP_155/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/XXX/XXX/ZC_SHOP_155/ZC_SHOP_155/index.php:97] 
    Der Log wiederholt sich ständig im Stunden Takt.

    Danke schon mal für eine Info

    Guido
    Zuletzt geändert von bumerang24; 03.08.2017, 16:37.

    #2
    Du scheinst PHP 7.1 zu verwenden. Mit 7.1. ist mit solchen Errors zu rechnen, da es nach der Release von 1.5.5 erschienen ist.
    Stelle wenn möglich auf PHP 7.0.x um.

    Kommentar


      #3
      Richtig, habe gerade umgestellt auf 7.0
      Danke dir erst mal

      Kommentar


        #4
        Der eine Log ist weg, der nächste ist da, im Minutentakt...


        PHP-Code:
        [04-Aug-2017 04:22:00 Europe/BerlinRequest URI:  /index.php?main_page=rss_feed&feed=products&products_id=120IP  address66.249.79.25
        #1  trigger_error() called at [/home/www/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php:167]
        #2  queryFactory->show_error() called at [/home/www/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php:139]
        #3  queryFactory->set_error() called at [/home/www/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php:266]
        #4  queryFactory->Execute() called at [/home/www/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php:375]
        #5  zen_rss_products() called at [/home/www/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php:360]
        #6  require(/home/www/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php) called at [/home/www/ZC_SHOP_155/index.php:36]

        [04-Aug-2017 04:22:00 Europe/BerlinPHP Fatal error:  3065:Expression  #2 of ORDER BY clause is not in SELECT list, references column  'web105_db3.p.products_sort_order' which is not in SELECT list; this is  incompatible with DISTINCT :: SELECT DISTINCT p.products_id,  pd.products_name, pd.products_description, p.products_image,  p.products_date_added, p.products_last_modified, p.master_categories_id,  p.products_price_sorter AS price, p.products_tax_class_id,  p.products_quantity, p.products_model, p.products_weight,  p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                               
        FROM ZC155_products p
                                 LEFT JOIN ZC155_products_description pd ON 
        (p.products_id pd.products_id)
                                 
        LEFT JOIN ZC155_manufacturers m ON (p.manufacturers_id m.manufacturers_id)
                                 
        LEFT JOIN ZC155_reviews r ON (p.products_id r.products_id)
                                 , 
        ZC155_products_to_categories p2cZC155_categories c 
                               WHERE pd
        .language_id 43
                                 
        AND p.products_status 1
                                 
        AND p.products_id p2c.products_id
                              
        AND c.categories_id 20
                              
        AND p2c.categories_id 20 
                                 
                                  
        AND p.products_id=120
                                  ORDER BY p
        .products_last_modified DESCp.products_sort_order
                                  LIMIT 1 
        ==> (as called by)  /XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php on  line 375 <== in  /XXX/XXX/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php on  line 167 
        Grüße

        Guido
        Zuletzt geändert von bumerang24; 04.08.2017, 09:16.

        Kommentar


          #5
          Und noch ein Log vom RSS

          Hallo zusammen, der neuste Log Eintrag ist jetzt folgender...
          Liegt wahrscheinlich wieder an der Person vorn PC, trotzdem bräuchte ich Hilfe.

          HTML-Code:
          [05-Aug-2017 16:08:29 Europe/Berlin] Request URI:  /index.php?main_page=rss_feed&feed=products&products_id=151, IP  address: 66.249.66.145
          #1  trigger_error() called at [/XXX/XXX/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php:167]
          #2  queryFactory->show_error() called at [/XXX/XXX/ZC_SHOP_1555/includes/classes/db/mysql/query_factory.php:139]
          #3  queryFactory->set_error() called at[/XXX/XXX/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php:266]
          #4  queryFactory->Execute() called at [/XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php:375]
          #5  zen_rss_products() called at [/XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php:360]
          #6  require(/XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php) called at [/home/www/ZC_SHOP_155/index.php:36]
          
          [05-Aug-2017 16:08:29 Europe/Berlin] PHP Fatal error:  3065:Expression  #2 of ORDER BY clause is not in SELECT list, references column  'web105_db3.p.products_sort_order' which is not in SELECT list; this is  incompatible with DISTINCT :: SELECT DISTINCT p.products_id,  pd.products_name, pd.products_description, p.products_image,  p.products_date_added, p.products_last_modified, p.master_categories_id,  p.products_price_sorter AS price, p.products_tax_class_id,  p.products_quantity, p.products_model, p.products_weight,  p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                 FROM ZC155_products p
                                   LEFT JOIN ZC155_products_description pd ON (p.products_id = pd.products_id)
                                   LEFT JOIN ZC155_manufacturers m ON (p.manufacturers_id = m.manufacturers_id)
                                   LEFT JOIN ZC155_reviews r ON (p.products_id = r.products_id)
                                   , ZC155_products_to_categories p2c, ZC155_categories c 
                                 WHERE pd.language_id = 43
                                   AND p.products_status = 1
                                   AND p.products_id = p2c.products_id
                                AND c.categories_id = 25
                                AND p2c.categories_id = 25 
                                   
                                    AND p.products_id=151
                                    ORDER BY p.products_last_modified DESC, p.products_sort_order
                                    LIMIT 1 ==> (as called by)  /XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php on  line 375 <== in  /home/www/ZC_SHOP_155/includes/classes/db/mysql/query_factory.php on  line 167

          Danke schon mal

          Grüße

          Guido

          Kommentar


            #6
            Welche MySQL Version wird hier genau verwendet? Ist das MySQL 5.7.5? Ändere mal in includes/modules/pages/rss_feed/header_php.php ca. Zeile 345 von
            Code:
            if(!isset($order_by)) $order_by = " ORDER BY p.products_last_modified DESC, p.products_sort_order";       if(!isset($where_days)) $where_days = '';     $sql_products = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
            auf
            Code:
             if(!isset($order_by)) $order_by = " ORDER BY p.products_last_modified DESC, p.products_sort_order";       if(!isset($where_days)) $where_days = '';   $sql_products = "SELECT DISTINCT p.products_sort_order, p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
            Zuletzt geändert von webchills; 08.08.2017, 12:10.

            Kommentar


              #7
              Danke Webchills,

              ich habe mal die Datei geändert.

              Die DB Daten:
              Datenbank: MySQL 5.7.16-log
              Datenbank Datum: 08.08.2017 12:43:19

              MySQL Slow Query Log Status: On
              MySQL Slow Query Log File: /var/log/mysql/mysql-slow.log

              Ich schau mal ob die Logs ausbleiben.

              Kommentar


                #8
                Hallo Webchills,

                jetzt kommt folgender Log zum Vorschein:
                Code:
                [08-Aug-2017 19:38:17 Europe/Berlin] PHP Parse error:  syntax error,  unexpected 'SELECT' (T_STRING) in  /XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php on  line 347

                Der Eintrag bei mir im Shop Zeile 347:

                Code:
                 $sql_products = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                Kannst du noch mal schauen bitte?

                Danke und Grüße

                Guido

                Kommentar


                  #9
                  Du hast beim Ändern irgendwas vorher oder nachher rausgelöscht, es ist wohl einfacher, wenn Du die Datei komplett übernimmst, hier der gesamte Inhalt:
                  Code:
                  <?php/**
                   * rss_feed header_php.php
                   *
                   * @package rss feed
                   * @copyright Copyright 2004-2008 Andrew Berezin eCommerce-Service.com
                   * @copyright Portions Copyright 2003-2016 Zen Cart Development Team
                   * @copyright Portions Copyright 2003 osCommerce
                   * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
                   * @version $Id: header_php.php, 2017-08-08 22:23:04 webchills $
                   */
                  //  @ini_set('display_errors', '1');
                  //  error_reporting(E_ALL);
                  
                  
                  @define('RSS_UTM_ACTIVE', 'true');
                  @define('RSS_UTM_SOURCE', 'rss');
                  @define('RSS_UTM_MEDIUM', 'rssfeed');
                  @define('RSS_UTM_TERM', '');
                  @define('RSS_UTM_CONTENT', '');
                  @define('RSS_UTM_CAMPAIGN', '');
                  
                  
                  @define('RSS_BUYNOW_LINK', 'false');
                  @define('RSS_DEFAULT_IMAGE_SIZE', 'small'); // \'small\', \'medium\', \'large\'
                  @define('RSS_CACHE_TIME', '10');
                  
                  
                  @define('DIR_FS_RSSFEED_CACHE', DIR_FS_SQL_CACHE . '/rss');
                  @define('RSS_ERROR_CACHE_DIR', 'Cache directory not found "' . DIR_FS_RSSFEED_CACHE . '"');
                  
                  
                  
                  
                  require_once(DIR_WS_CLASSES . 'rss_feed.php');
                  
                  
                  $rss = new rss_feed();
                  
                  
                  if(RSS_CACHE_TIME > 0) {
                      $rss->rssFeedCacheSet(true);
                  } else {
                      $rss->rssFeedCacheSet(false);
                  }
                  
                  
                    $rss->rss_feed_encoding(CHARSET);
                    $rss->rss_feed_content_type('text/xml'); // 'application/rss+xml'
                    $rss->rss_feed_set('ttl', RSS_TTL);
                  
                  
                  if(!$rss->rss_feed_cache($_SERVER['QUERY_STRING'], RSS_CACHE_TIME*60)) {
                  
                  
                    
                    $rss->rss_feed_xmlns('xmlns:g="http://base.google.com/ns/1.0"');
                    $rss->rss_feed_xmlns('xmlns:c="http://base.google.com/cns/1.0"');
                  
                  
                   
                  
                  
                    $directory_array = array();
                    $tpl_dir = $template->get_template_dir('rss(.*)\.css', DIR_WS_TEMPLATE, $current_page_base, 'css');
                    $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.css');
                    foreach ($directory_array as $value) {
                      $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                    }
                    $tpl_dir = $template->get_template_dir('rss(.*)\.xsl', DIR_WS_TEMPLATE, $current_page_base, 'css');
                    $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.xsl');
                    foreach ($directory_array as $value) {
                      $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                    }
                  
                  
                    if (is_file($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE)) {
                      $image = zen_href_link($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE, '', 'NONSSL', false, true, true);
                    } elseif (is_file(DIR_FS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE)) {
                      $image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE;
                    } else {
                      $image = false;
                    }
                    $rss->rss_feed_image((RSS_IMAGE_NAME == '' ? STORE_NAME : RSS_IMAGE_NAME), HTTP_SERVER . DIR_WS_CATALOG, $image);
                  
                  
                    $rss_title = (RSS_TITLE == '' ? STORE_NAME : RSS_TITLE);
                    $rss_title .= RSS_TITLE_DELIMITER . rss_feed_title();
                  
                  
                    $rss->rss_feed_description_set(RSS_ITEMS_DESCRIPTION, RSS_ITEMS_DESCRIPTION_MAX_LENGTH);
                    $rss->rss_feed_set('title', $rss_title);
                    $rss->rss_feed_set('link', HTTP_SERVER . DIR_WS_CATALOG);
                    $rss->rss_feed_set('description', RSS_DESCRIPTION);
                    $rss->rss_feed_set('lastBuildDate', date('r'));
                    $rss->rss_feed_set('generator', 'Zen-Cart v. ' . RSS_FEED_VERSION . ' RSS 2.0 Feed');
                    $rss->rss_feed_set('copyright', 'Copyright &copy; ' . date('Y') . ' ' . (RSS_COPYRIGHT == ''? STORE_OWNER : RSS_COPYRIGHT));
                    $rss->rss_feed_set('managingEditor', (RSS_MANAGING_EDITOR == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_MANAGING_EDITOR));
                    $rss->rss_feed_set('webMaster', (RSS_WEBMASTER == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_WEBMASTER));
                    $rss->rss_feed_set('language', $_SESSION["languages_code"]);
                  
                  
                    $additionalURL = '';
                    if($_SESSION["languages_code"] != DEFAULT_LANGUAGE) {
                      $additionalURL .= '&language=' . $_SESSION["languages_code"];
                    }
                    if(isset($_GET["ref"])) {
                      $additionalURL .= '&ref=' . $_GET["ref"];
                    }
                    if(isset($_GET["utm_source"]) && isset($_GET["utm_medium"])) {
                      $additionalURL .= '&utm_source=' . $_GET["utm_source"] . '&utm_medium=' . $_GET["utm_medium"];
                      if($_GET["utm_term"] != '') $additionalURL .= '&utm_term=' . $_GET["utm_term"];
                      if($_GET["utm_content"] != '') $additionalURL .= '&utm_content=' . $_GET["utm_content"];
                      if($_GET["utm_campaign"] != '') $additionalURL .= '&utm_campaign=' . $_GET["utm_campaign"];
                    } elseif (RSS_UTM_ACTIVE == 'true' && RSS_UTM_SOURCE != '' && RSS_UTM_MEDIUM != '') {
                      $additionalURL .= '&utm_source=' . RSS_UTM_SOURCE . '&utm_medium=' . RSS_UTM_MEDIUM;
                      if(RSS_UTM_TERM != '') $additionalURL .= '&utm_term=' . RSS_UTM_TERM;
                      if(RSS_UTM_CONTENT != '') $additionalURL .= '&utm_content=' . RSS_UTM_CONTENT;
                      if(RSS_UTM_CAMPAIGN != '') $additionalURL .= '&utm_campaign=' . RSS_UTM_CAMPAIGN;
                    }
                  
                  
                    $random = false;
                  
                  
                    if(isset($_GET['products_id'])) $_GET['products_id'] = (int)$_GET['products_id'];
                  
                  
                    $limit = "";
                    if(isset($_GET['limit'])) {
                      if((int)$_GET['limit'] > 0) {
                        $limit = " LIMIT " . (int)$_GET['limit'];
                      }
                    } elseif ((int)RSS_PRODUCTS_LIMIT > 0) {
                      $limit = " LIMIT " . (int)RSS_PRODUCTS_LIMIT;
                    }
                  
                  
                    switch($_GET["feed"]) {
                  
                  
                  
                  
                  
                  
                      case "news":
                        require_once(DIR_WS_FUNCTIONS . 'news.php');
                        $date_selector = $db->Execute("SELECT news_date_published
                                                       FROM " . TABLE_NEWS_ARTICLES . "
                                                       WHERE news_status = '1'
                                                         AND to_days(news_date_published) <= to_days(now())
                                                       GROUP BY news_date_published DESC
                                                       LIMIT " . (int)NEWS_RSS_FEED_NUMBER_OF_DAYS);
                        while (!$date_selector->EOF) {
                          $article = $db->Execute("SELECT n.article_id, na.author_name, na.author_email, nt.news_article_name, nt.news_article_text, nt.news_article_shorttext, n.news_image, nt.news_image_text, n.news_date_published
                                                   FROM " . TABLE_NEWS_ARTICLES . " n
                                                     LEFT JOIN " . TABLE_NEWS_ARTICLES_TEXT . " nt ON (n.article_id = nt.article_id AND nt.language_id = " . (int)$_SESSION['languages_id'] . "), " .
                                                            TABLE_NEWS_AUTHORS . " na
                                                   WHERE n.authors_id = na.authors_id
                                                     AND n.news_status = '1'
                                                     AND n.news_date_published = '" . $date_selector->fields['news_date_published'] . "'
                                                   ORDER BY n.sort_order");
                          while (!$article->EOF) {
                            $xtags = array();
                            $link = zen_href_link(FILENAME_NEWS_ARTICLE, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false);
                            $rss->rss_feed_item($article->fields['news_article_name'],
                                                $link,
                                                array('url' => $link, 'PermaLink' => true),
                                                date('r', strtotime($article->fields['news_date_published'])),
                                                news_create_news_summary($article->fields['news_article_text'], $article->fields['news_article_shorttext']),
                                                $article->fields['news_image'],
                                                zen_href_link(FILENAME_NEWS_COMMENTS, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false),
                                                $article->fields['author_name'] . " <" . $article->fields['author_email'] . ">",
                                                false,
                                                false,
                                                $xtags
                                                );
                            $article->MoveNext();
                          }
                          $date_selector->MoveNext();
                        }
                        break;
                  
                  
                      case "categories":
                        // don't build a tree when no categories
                        $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status = '1' limit 1");
                        if ($check_categories->RecordCount() > 0) {
                          if(isset($_GET['cPath'])) {
                            $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                                        FROM " . TABLE_CATEGORIES . " c
                                                          LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                                        WHERE c.parent_id = " . (int)$id_parent . "
                                                          AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                          AND c.categories_status= '1'
                                                        ORDER BY c.sort_order, cd.categories_name",
                                                        '', false, 150);
                  
                  
                            if(!$categories->EOF) {
                              $link_categories = addslashes(zen_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath . $additionalURL, 'NONSSL', false));
                              $rss->rss_feed_item($categories->fields['categories_name'],
                                                  $link_categories,
                                                  array('url' => $link_categories, 'PermaLink' => true),
                                                  date('r', strtotime($categories->fields['categories_date'])),
                                                  $categories->fields['categories_description'],
                                                  $categories->fields['categories_image'],
                                                  false,
                                                  (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                                  );
                              if(!isset($_GET['limit']) || (int)$_GET['limit'] >1) {
                                zen_rss_category_tree($current_category_id, $cPath, isset($_GET['limit']) ? ((int)$_GET['limit']-1) : 32767);
                              }
                            }
                          } else {
                            zen_rss_category_tree(0, '', isset($_GET['limit']) ? (int)$_GET['limit'] : 32767);
                          }
                        }
                        break;
                  
                  
                      case "specials_random":
                        $random = true;
                        $rss->rssFeedCacheSet(false);
                        $limit = " LIMIT " . MAX_RANDOM_SELECT_SPECIALS;
                      case "specials":
                      $sale_categories = $db->Execute("SELECT sale_categories_all FROM " . TABLE_SALEMAKER_SALES . " WHERE sale_status = 1");
                      
                      
                      if ($sale_categories->RecordCount() > 0){
                      $sale_categories_all = '';
                      while(!$sale_categories->EOF) {
                            $sale_categories_all .= substr($sale_categories->fields['sale_categories_all'], 0, -1); 
                            $sale_categories->MoveNext();
                      }
                      $sale_categories_all = substr($sale_categories_all, 1); 
                  
                  
                         $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, p.master_categories_id, m.manufacturers_name, r.reviews_rating
                                                   FROM " . TABLE_PRODUCTS . " p
                                                     LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                     LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                     LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                     LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                   WHERE p.products_status = 1
                                                     AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                     AND (s.status = 1 OR (p.master_categories_id IN ($sale_categories_all))) " . $limit;
                  
                  
                  } else {
                    
                         $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                   FROM " . TABLE_PRODUCTS . " p
                                                     LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                     LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                     LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                     LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                   WHERE p.products_status = 1
                                                     AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                     AND s.status = 1  " . $limit;
                  }
                        zen_rss_products($specials_product_query, $random);
                        break;
                  
                  
                      case "featured_random":
                        $random = true;
                        $rss->rssFeedCacheSet(false);
                        $limit = " LIMIT " . MAX_RANDOM_SELECT_FEATURED_PRODUCTS;
                      case "featured":
                        $featured_products_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                    FROM " . TABLE_PRODUCTS . " p
                                                      LEFT JOIN " . TABLE_FEATURED . " f on p.products_id = f.products_id
                                                      LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id
                                                      LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                      LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                    WHERE p.products_status = 1
                                                     AND f.status = '1'
                                                     AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                    ORDER BY pd.products_name DESC" . $limit;
                        zen_rss_products($featured_products_query, $random);
                        break;
                  
                  
                      case "best_sellers_random":
                        $random = true;
                        $rss->rssFeedCacheSet(false);
                        $limit = " LIMIT " . MAX_DISPLAY_BESTSELLERS;
                      case "best_sellers":
                        $where_cat = $from_cat = "";
                        if (isset($current_category_id) && ($current_category_id > 0)) {
                          if (RSS_PRODUCTS_CATEGORIES == 'all') {
                            $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                            $where_cat = " AND p.products_id = p2c.products_id
                                           AND c.categories_id = " . (int)$current_category_id . "
                                           AND p2c.categories_id = " . (int)$current_category_id . " ";
                          } else {
                            $where_cat = " AND p.master_categories_id = " . (int)$current_category_id . " ";
                          }
                        }
                        $best_sellers_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_ordered, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                               FROM " . TABLE_PRODUCTS . " p
                                                 LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                 LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                 LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                               " . $from_cat . "
                                               WHERE p.products_status = 1
                                                 AND p.products_ordered > 0
                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . $where_cat ."
                                               ORDER BY p.products_ordered DESC, pd.products_name" . $limit;
                        zen_rss_products($best_sellers_query, $random);
                        break;
                  
                  
                      case "upcoming_random":
                        $random = true;
                        $rss->rssFeedCacheSet(false);
                        $limit = " LIMIT " . MAX_DISPLAY_UPCOMING_PRODUCTS;
                      case "upcoming":
                        $where_cat = $from_cat = "";
                        $display_limit = zen_get_upcoming_date_range();
                        if (isset($current_category_id) && ($current_category_id > 0)) {
                          if (RSS_PRODUCTS_CATEGORIES == 'all') {
                            $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                            $where_cat = "AND p.products_id = p2c.products_id
                                          AND c.categories_id = " . (int)$current_category_id . "
                                          AND p2c.categories_id = " . (int)$current_category_id . " ";
                          } else {
                            $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                          }
                        }
                        $expected_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_date_available as date_expected, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                           FROM " . TABLE_PRODUCTS . " p
                                             LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                             LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                             LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                           " . $from_cat . "
                                           WHERE to_days(products_date_available) >= to_days(now())
                                             AND p.products_status = 1
                                             AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                           " . $where_cat . "
                                           " . $display_limit . "
                                           ORDER BY " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . $limit;
                        zen_rss_products($expected_query, $random);
                        break;
                  
                  
                      case "new_products_random":
                        $random = true;
                        $rss->rssFeedCacheSet(false);
                        $limit = " LIMIT " . MAX_RANDOM_SELECT_NEW;
                      case "new_products":
                        $disp_order_default = PRODUCT_NEW_LIST_SORT_DEFAULT;
                        require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
                        $where_days = zen_get_new_date_range();
                  
                  
                      case "products":
                      default:
                        $where_cat = $from_cat = "";
                        if (isset($current_category_id) && ($current_category_id > 0)) {
                          if (RSS_PRODUCTS_CATEGORIES == 'all') {
                          $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                          $where_cat = "AND p.products_id = p2c.products_id
                                        AND c.categories_id = " . (int)$current_category_id . "
                                        AND p2c.categories_id = " . (int)$current_category_id . " ";
                          } else {
                            $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                          }
                        }
                        $where_prod = '';
                        if(isset($_GET['products_id'])) {
                          $where_prod = " AND p.products_id=" . (int)$_GET['products_id'];
                          $limit = " LIMIT 1";
                        } else if(isset($_GET['products_model'])) {
                          $where_prod = " AND p.products_model=" . zen_db_input(zen_db_prepare_input($_GET['products_model']));
                        }
                        if(!isset($order_by)) $order_by = " ORDER BY p.products_last_modified DESC, p.products_sort_order";
                        if(!isset($where_days)) $where_days = '';
                        $sql_products = "SELECT DISTINCT p.products_sort_order, p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                         FROM " . TABLE_PRODUCTS . " p
                                           LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (p.products_id = pd.products_id)
                                           LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                           LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                           " . $from_cat . "
                                         WHERE pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                           AND p.products_status = 1
                                           " . $where_cat . "
                                           " . $where_days . "
                                           " . $where_prod . "
                                           " . $order_by . "
                                           " . $limit;
                        zen_rss_products($sql_products, $random);
                        break;
                    }
                  
                  
                  }
                  
                  
                    function zen_rss_products($sql_products, $random){
                      global $db, $currencies, $rss, $additionalURL;
                  
                  
                      $imageSize = (isset($_GET['imgsize']) ? $_GET['imgsize'] : RSS_DEFAULT_IMAGE_SIZE);
                  
                  
                  
                  
                        if ($random) {
                        $products = zen_random_select($sql_products);
                      } else {
                        $products = $db->Execute($sql_products);
                      }
                      $cashTaxRate = array();
                      while(!$products->EOF) {
                        $info_page = zen_get_info_page($products->fields['products_id']);
                        $xtags = array();
                  
                  
                        $link = zen_href_link($info_page, 'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false);
                  
                  
                        $products_description = $products->fields['products_description'];
                        if (RSS_PRODUCTS_DESCRIPTION_IMAGE == 'true' && zen_not_null($products->fields['products_image'])) {
                          $image_url = zen_image(DIR_WS_IMAGES . $products->fields['products_image'], $products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="float: left; margin: 0px 8px 8px 0px;"');
                          $image_url = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, $image_url);
                          $image_link = '<a href="' . $link . '">' . $image_url . '</a>';
                          if(RSS_STRIP_TAGS == 'true') {
                            $products_description = '<![CDATA[' . $image_link . ']]>' . $products_description;
                          } else {
                            $products_description = $image_link . $products_description;
                          }
                        }
                  
                  
                        if (RSS_PRODUCTS_DESCRIPTION_BUYNOW == 'true') {
                  
                  
                          $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                          $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                          $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                          $buynow_button = str_replace(' >', '>', $buynow_button);
                  
                  
                          $buynow_link = '<br /><br />' . '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false) . '" target="_blank">' . $buynow_button . '</a>' . "\n";
                          if(RSS_STRIP_TAGS == 'true') {
                            $products_description .= "\n" . '<![CDATA[' . $buynow_link . ']]>';
                          } else {
                            $products_description .= "\n" . $buynow_link;
                          }
                        }
                  
                  
                        if (RSS_BUYNOW_LINK == 'true') {
                  
                  
                          $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                          $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                          $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                          $buynow_button = str_replace(' >', '>', $buynow_button);
                  
                  
                          $buynow_link = zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false);
                          $xtags['zencart:buynow_link'] = $buynow_link;
                          $xtags['zencart:buynow_button'] = $buynow_button;
                        }
                  
                  
                  
                  
                  date_default_timezone_set('Europe/Vienna');
                        $rss->rss_feed_item($products->fields['products_name'],
                                            $link,
                                            array('url' => $link, 'PermaLink' => true),
                                            date('r', strtotime($products->fields['products_date_added'])),
                                            $products_description,
                                            $rss->_clear_url($products->fields['products_image']),
                                            zen_href_link(FILENAME_PRODUCT_REVIEWS,'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false),
                                            (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR),
                                            false,
                                            false,
                                            $xtags
                                            );
                        if ($random)
                          break;
                        $products->MoveNext();
                      }
                    }
                  
                  
                    function zen_rss_category_tree($id_parent=0, $str_cPath='', $limit = 32767){
                      global $db, $rss, $additionalURL;
                      if($limit < 0) return;
                      $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                         FROM " . TABLE_CATEGORIES . " c
                                           LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                         WHERE c.parent_id = " . (int)$id_parent . "
                                           AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                           AND c.categories_status = 1
                                         ORDER BY c.sort_order, cd.categories_name",
                                         '', false, 150);
                      if ($categories->RecordCount() == 0)
                        return;
                      while(!$categories->EOF && $limit>0) {
                        $new_str_cPath = (zen_not_null($str_cPath) ? $str_cPath . '_' . $categories->fields['categories_id'] : $categories->fields['categories_id']);
                        $products_in_category = zen_count_products_in_category($categories->fields['categories_id']);
                        if ((CATEGORIES_COUNT_ZERO == '1' && $products_in_category == 0) or $products_in_category >= 1) {
                          $limit--;
                          $link = zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_str_cPath . $additionalURL, 'NONSSL', false);
                          $rss->rss_feed_item($categories->fields['categories_name'],
                                              $link,
                                              array('url' => $link, 'PermaLink' => true),
                                              date('r', strtotime($categories->fields['categories_date'])),
                                              $categories->fields['categories_description'],
                                              $categories->fields['categories_image'],
                                              false,
                                              (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                              );
                        }
                        if (zen_has_category_subcategories($categories->fields['categories_id'])) {
                          zen_rss_category_tree($categories->fields['categories_id'], $new_str_cPath, $limit);
                        }
                        $categories->MoveNext();
                      }
                    }
                  // EOF

                  Kommentar


                    #10
                    Hallo Webchills,

                    habe ich so kopiert....
                    Der Erfolg:
                    Code:
                    [09-Aug-2017 06:58:13 Europe/Berlin] PHP Parse error:  syntax error,  unexpected '@' in  /XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php on  line 15
                    irgendwo läuft immer noch was schief, ich kann aber nicht verstehen was

                    Kommentar


                      #11
                      Da Du beim Bearbeiten dieser Datei immer etwas rauslöschst ist es wohl besser, wenn Du die angehängte Datei per FTP hochlädst nach includes/modules/pages/rss_feed/header_php.php
                      Angehängte Dateien
                      Zuletzt geändert von webchills; 17.08.2017, 08:15.

                      Kommentar


                        #12
                        Ich habe die Datei von dir 1 zu 1 kopiert in Wordpad++
                        Nicht mehr oder weniger ist passiert.
                        Jetzt habe ich den Ordner Includes komplett per FTP hochgeladen, mal sehen was passiert....

                        Kommentar


                          #13
                          Also, ich verzweifle schön langsam...

                          Der nächste Log für die nächste Zeile

                          Code:
                          [09-Aug-2017 11:50:18 Europe/Berlin] PHP Parse error:  syntax error,  unexpected '@' in  /XXX/XXX/ZC_SHOP_155/includes/modules/pages/rss_feed/header_php.php on  line 14
                          Und ich hab garantiert alles richtig hochgeladen von dem BugFix ( 2 X sogar )

                          Kommentar


                            #14
                            Exakt die oben angehängte Datei wird hier verwendet:
                            Zen Cart 1.5.7 - - Hardware Software DVD Geschenkgutscheine Verlinkte Artikel Testbeispiele Für Preis anrufen Test 10% per Attribut Test 10% Abverkauf nach % Abverkauf Fixbetrag Abverkauf neuer Preis Big Unlinked Spezialfunktionen Musik Dokumente Gemischte Artikeltypen ecommerce, open source, shop, online shopping

                            PHP 7.0.20
                            Keinerlei Errorlogs

                            Die einzige Änderung gegenüber der Originaldatei ist in Zeile 346 eine zusätzliche Angabe von p.products_sort_order
                            Code:
                            $sql_products = "SELECT DISTINCT [COLOR=#ff0000]p.products_sort_order,[/COLOR] p.products_id, pd.products_name
                            statt
                            Code:
                            $sql_products = "SELECT DISTINCT p.products_id, pd.products_name

                            Kommentar


                              #15
                              Hallo Webchills,

                              jetzt habe ich das Problem gelöst.
                              Dein Code macht bei mir im frontend eine Weiße Seite beim aufruf des RSS ( Ist genau der aus dem Bugfix )
                              Code:
                              <?php/**
                               * rss_feed header_php.php
                               *
                               * @package rss feed
                               * @copyright Copyright 2004-2008 Andrew Berezin eCommerce-Service.com
                               * @copyright Portions Copyright 2003-2016 Zen Cart Development Team
                               * @copyright Portions Copyright 2003 osCommerce
                               * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
                               * @version $Id: header_php.php, 2017-08-08 22:23:04 webchills $
                               */
                              //  @ini_set('display_errors', '1');
                              //  error_reporting(E_ALL);
                              
                              @define('RSS_UTM_ACTIVE', 'true');
                              @define('RSS_UTM_SOURCE', 'rss');
                              @define('RSS_UTM_MEDIUM', 'rssfeed');
                              @define('RSS_UTM_TERM', '');
                              @define('RSS_UTM_CONTENT', '');
                              @define('RSS_UTM_CAMPAIGN', '');
                              
                              @define('RSS_BUYNOW_LINK', 'false');
                              @define('RSS_DEFAULT_IMAGE_SIZE', 'small'); // \'small\', \'medium\', \'large\'
                              @define('RSS_CACHE_TIME', '10');
                              
                              @define('DIR_FS_RSSFEED_CACHE', DIR_FS_SQL_CACHE . '/rss');
                              @define('RSS_ERROR_CACHE_DIR', 'Cache directory not found "' . DIR_FS_RSSFEED_CACHE . '"');
                              
                              
                              require_once(DIR_WS_CLASSES . 'rss_feed.php');
                              
                              $rss = new rss_feed();
                              
                              if(RSS_CACHE_TIME > 0) {
                                  $rss->rssFeedCacheSet(true);
                              } else {
                                  $rss->rssFeedCacheSet(false);
                              }
                              
                                $rss->rss_feed_encoding(CHARSET);
                                $rss->rss_feed_content_type('text/xml'); // 'application/rss+xml'
                                $rss->rss_feed_set('ttl', RSS_TTL);
                              
                              if(!$rss->rss_feed_cache($_SERVER['QUERY_STRING'], RSS_CACHE_TIME*60)) {
                              
                                
                                $rss->rss_feed_xmlns('xmlns:g="http://base.google.com/ns/1.0"');
                                $rss->rss_feed_xmlns('xmlns:c="http://base.google.com/cns/1.0"');
                              
                               
                              
                                $directory_array = array();
                                $tpl_dir = $template->get_template_dir('rss(.*)\.css', DIR_WS_TEMPLATE, $current_page_base, 'css');
                                $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.css');
                                foreach ($directory_array as $value) {
                                  $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                                }
                                $tpl_dir = $template->get_template_dir('rss(.*)\.xsl', DIR_WS_TEMPLATE, $current_page_base, 'css');
                                $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.xsl');
                                foreach ($directory_array as $value) {
                                  $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                                }
                              
                                if (is_file($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE)) {
                                  $image = zen_href_link($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE, '', 'NONSSL', false, true, true);
                                } elseif (is_file(DIR_FS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE)) {
                                  $image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE;
                                } else {
                                  $image = false;
                                }
                                $rss->rss_feed_image((RSS_IMAGE_NAME == '' ? STORE_NAME : RSS_IMAGE_NAME), HTTP_SERVER . DIR_WS_CATALOG, $image);
                              
                                $rss_title = (RSS_TITLE == '' ? STORE_NAME : RSS_TITLE);
                                $rss_title .= RSS_TITLE_DELIMITER . rss_feed_title();
                              
                                $rss->rss_feed_description_set(RSS_ITEMS_DESCRIPTION, RSS_ITEMS_DESCRIPTION_MAX_LENGTH);
                                $rss->rss_feed_set('title', $rss_title);
                                $rss->rss_feed_set('link', HTTP_SERVER . DIR_WS_CATALOG);
                                $rss->rss_feed_set('description', RSS_DESCRIPTION);
                                $rss->rss_feed_set('lastBuildDate', date('r'));
                                $rss->rss_feed_set('generator', 'Zen-Cart v. ' . RSS_FEED_VERSION . ' RSS 2.0 Feed');
                                $rss->rss_feed_set('copyright', 'Copyright &copy; ' . date('Y') . ' ' . (RSS_COPYRIGHT == ''? STORE_OWNER : RSS_COPYRIGHT));
                                $rss->rss_feed_set('managingEditor', (RSS_MANAGING_EDITOR == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_MANAGING_EDITOR));
                                $rss->rss_feed_set('webMaster', (RSS_WEBMASTER == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_WEBMASTER));
                                $rss->rss_feed_set('language', $_SESSION["languages_code"]);
                              
                                $additionalURL = '';
                                if($_SESSION["languages_code"] != DEFAULT_LANGUAGE) {
                                  $additionalURL .= '&language=' . $_SESSION["languages_code"];
                                }
                                if(isset($_GET["ref"])) {
                                  $additionalURL .= '&ref=' . $_GET["ref"];
                                }
                                if(isset($_GET["utm_source"]) && isset($_GET["utm_medium"])) {
                                  $additionalURL .= '&utm_source=' . $_GET["utm_source"] . '&utm_medium=' . $_GET["utm_medium"];
                                  if($_GET["utm_term"] != '') $additionalURL .= '&utm_term=' . $_GET["utm_term"];
                                  if($_GET["utm_content"] != '') $additionalURL .= '&utm_content=' . $_GET["utm_content"];
                                  if($_GET["utm_campaign"] != '') $additionalURL .= '&utm_campaign=' . $_GET["utm_campaign"];
                                } elseif (RSS_UTM_ACTIVE == 'true' && RSS_UTM_SOURCE != '' && RSS_UTM_MEDIUM != '') {
                                  $additionalURL .= '&utm_source=' . RSS_UTM_SOURCE . '&utm_medium=' . RSS_UTM_MEDIUM;
                                  if(RSS_UTM_TERM != '') $additionalURL .= '&utm_term=' . RSS_UTM_TERM;
                                  if(RSS_UTM_CONTENT != '') $additionalURL .= '&utm_content=' . RSS_UTM_CONTENT;
                                  if(RSS_UTM_CAMPAIGN != '') $additionalURL .= '&utm_campaign=' . RSS_UTM_CAMPAIGN;
                                }
                              
                                $random = false;
                              
                                if(isset($_GET['products_id'])) $_GET['products_id'] = (int)$_GET['products_id'];
                              
                                $limit = "";
                                if(isset($_GET['limit'])) {
                                  if((int)$_GET['limit'] > 0) {
                                    $limit = " LIMIT " . (int)$_GET['limit'];
                                  }
                                } elseif ((int)RSS_PRODUCTS_LIMIT > 0) {
                                  $limit = " LIMIT " . (int)RSS_PRODUCTS_LIMIT;
                                }
                              
                                switch($_GET["feed"]) {
                              
                              
                              
                                  case "news":
                                    require_once(DIR_WS_FUNCTIONS . 'news.php');
                                    $date_selector = $db->Execute("SELECT news_date_published
                                                                   FROM " . TABLE_NEWS_ARTICLES . "
                                                                   WHERE news_status = '1'
                                                                     AND to_days(news_date_published) <= to_days(now())
                                                                   GROUP BY news_date_published DESC
                                                                   LIMIT " . (int)NEWS_RSS_FEED_NUMBER_OF_DAYS);
                                    while (!$date_selector->EOF) {
                                      $article = $db->Execute("SELECT n.article_id, na.author_name, na.author_email, nt.news_article_name, nt.news_article_text, nt.news_article_shorttext, n.news_image, nt.news_image_text, n.news_date_published
                                                               FROM " . TABLE_NEWS_ARTICLES . " n
                                                                 LEFT JOIN " . TABLE_NEWS_ARTICLES_TEXT . " nt ON (n.article_id = nt.article_id AND nt.language_id = " . (int)$_SESSION['languages_id'] . "), " .
                                                                        TABLE_NEWS_AUTHORS . " na
                                                               WHERE n.authors_id = na.authors_id
                                                                 AND n.news_status = '1'
                                                                 AND n.news_date_published = '" . $date_selector->fields['news_date_published'] . "'
                                                               ORDER BY n.sort_order");
                                      while (!$article->EOF) {
                                        $xtags = array();
                                        $link = zen_href_link(FILENAME_NEWS_ARTICLE, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false);
                                        $rss->rss_feed_item($article->fields['news_article_name'],
                                                            $link,
                                                            array('url' => $link, 'PermaLink' => true),
                                                            date('r', strtotime($article->fields['news_date_published'])),
                                                            news_create_news_summary($article->fields['news_article_text'], $article->fields['news_article_shorttext']),
                                                            $article->fields['news_image'],
                                                            zen_href_link(FILENAME_NEWS_COMMENTS, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false),
                                                            $article->fields['author_name'] . " <" . $article->fields['author_email'] . ">",
                                                            false,
                                                            false,
                                                            $xtags
                                                            );
                                        $article->MoveNext();
                                      }
                                      $date_selector->MoveNext();
                                    }
                                    break;
                              
                                  case "categories":
                                    // don't build a tree when no categories
                                    $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status = '1' limit 1");
                                    if ($check_categories->RecordCount() > 0) {
                                      if(isset($_GET['cPath'])) {
                                        $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                                                    FROM " . TABLE_CATEGORIES . " c
                                                                      LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                                                    WHERE c.parent_id = " . (int)$id_parent . "
                                                                      AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                      AND c.categories_status= '1'
                                                                    ORDER BY c.sort_order, cd.categories_name",
                                                                    '', false, 150);
                              
                                        if(!$categories->EOF) {
                                          $link_categories = addslashes(zen_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath . $additionalURL, 'NONSSL', false));
                                          $rss->rss_feed_item($categories->fields['categories_name'],
                                                              $link_categories,
                                                              array('url' => $link_categories, 'PermaLink' => true),
                                                              date('r', strtotime($categories->fields['categories_date'])),
                                                              $categories->fields['categories_description'],
                                                              $categories->fields['categories_image'],
                                                              false,
                                                              (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                                              );
                                          if(!isset($_GET['limit']) || (int)$_GET['limit'] >1) {
                                            zen_rss_category_tree($current_category_id, $cPath, isset($_GET['limit']) ? ((int)$_GET['limit']-1) : 32767);
                                          }
                                        }
                                      } else {
                                        zen_rss_category_tree(0, '', isset($_GET['limit']) ? (int)$_GET['limit'] : 32767);
                                      }
                                    }
                                    break;
                              
                                  case "specials_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_SPECIALS;
                                  case "specials":
                                  $sale_categories = $db->Execute("SELECT sale_categories_all FROM " . TABLE_SALEMAKER_SALES . " WHERE sale_status = 1");
                                  
                                  
                                  if ($sale_categories->RecordCount() > 0){
                                  $sale_categories_all = '';
                                  while(!$sale_categories->EOF) {
                                        $sale_categories_all .= substr($sale_categories->fields['sale_categories_all'], 0, -1); 
                                        $sale_categories->MoveNext();
                                  }
                                  $sale_categories_all = substr($sale_categories_all, 1); 
                              
                                     $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, p.master_categories_id, m.manufacturers_name, r.reviews_rating
                                                               FROM " . TABLE_PRODUCTS . " p
                                                                 LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                                 LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                 LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                 LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                               WHERE p.products_status = 1
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                 AND (s.status = 1 OR (p.master_categories_id IN ($sale_categories_all))) " . $limit;
                              
                              } else {
                                
                                     $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                               FROM " . TABLE_PRODUCTS . " p
                                                                 LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                                 LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                 LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                 LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                               WHERE p.products_status = 1
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                 AND s.status = 1  " . $limit;
                              }
                                    zen_rss_products($specials_product_query, $random);
                                    break;
                              
                                  case "featured_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_FEATURED_PRODUCTS;
                                  case "featured":
                                    $featured_products_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                                FROM " . TABLE_PRODUCTS . " p
                                                                  LEFT JOIN " . TABLE_FEATURED . " f on p.products_id = f.products_id
                                                                  LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id
                                                                  LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                  LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                WHERE p.products_status = 1
                                                                 AND f.status = '1'
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                ORDER BY pd.products_name DESC" . $limit;
                                    zen_rss_products($featured_products_query, $random);
                                    break;
                              
                                  case "best_sellers_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_DISPLAY_BESTSELLERS;
                                  case "best_sellers":
                                    $where_cat = $from_cat = "";
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                        $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                        $where_cat = " AND p.products_id = p2c.products_id
                                                       AND c.categories_id = " . (int)$current_category_id . "
                                                       AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = " AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $best_sellers_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_ordered, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                           FROM " . TABLE_PRODUCTS . " p
                                                             LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                             LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                             LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                           " . $from_cat . "
                                                           WHERE p.products_status = 1
                                                             AND p.products_ordered > 0
                                                             AND pd.language_id = " . (int)$_SESSION['languages_id'] . $where_cat ."
                                                           ORDER BY p.products_ordered DESC, pd.products_name" . $limit;
                                    zen_rss_products($best_sellers_query, $random);
                                    break;
                              
                                  case "upcoming_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_DISPLAY_UPCOMING_PRODUCTS;
                                  case "upcoming":
                                    $where_cat = $from_cat = "";
                                    $display_limit = zen_get_upcoming_date_range();
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                        $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                        $where_cat = "AND p.products_id = p2c.products_id
                                                      AND c.categories_id = " . (int)$current_category_id . "
                                                      AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $expected_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_date_available as date_expected, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                       FROM " . TABLE_PRODUCTS . " p
                                                         LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                         LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                         LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                       " . $from_cat . "
                                                       WHERE to_days(products_date_available) >= to_days(now())
                                                         AND p.products_status = 1
                                                         AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       " . $where_cat . "
                                                       " . $display_limit . "
                                                       ORDER BY " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . $limit;
                                    zen_rss_products($expected_query, $random);
                                    break;
                              
                                  case "new_products_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_NEW;
                                  case "new_products":
                                    $disp_order_default = PRODUCT_NEW_LIST_SORT_DEFAULT;
                                    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
                                    $where_days = zen_get_new_date_range();
                              
                                  case "products":
                                  default:
                                    $where_cat = $from_cat = "";
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                      $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                      $where_cat = "AND p.products_id = p2c.products_id
                                                    AND c.categories_id = " . (int)$current_category_id . "
                                                    AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $where_prod = '';
                                    if(isset($_GET['products_id'])) {
                                      $where_prod = " AND p.products_id=" . (int)$_GET['products_id'];
                                      $limit = " LIMIT 1";
                                    } else if(isset($_GET['products_model'])) {
                                      $where_prod = " AND p.products_model=" . zen_db_input(zen_db_prepare_input($_GET['products_model']));
                                    }
                                    if(!isset($order_by)) $order_by = " ORDER BY p.products_last_modified DESC, p.products_sort_order";
                                    if(!isset($where_days)) $where_days = '';
                                    $sql_products = "SELECT DISTINCT p.products_sort_order, p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                     FROM " . TABLE_PRODUCTS . " p
                                                       LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (p.products_id = pd.products_id)
                                                       LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                       LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                       " . $from_cat . "
                                                     WHERE pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       AND p.products_status = 1
                                                       " . $where_cat . "
                                                       " . $where_days . "
                                                       " . $where_prod . "
                                                       " . $order_by . "
                                                       " . $limit;
                                    zen_rss_products($sql_products, $random);
                                    break;
                                }
                              
                              }
                              
                                function zen_rss_products($sql_products, $random){
                                  global $db, $currencies, $rss, $additionalURL;
                              
                                  $imageSize = (isset($_GET['imgsize']) ? $_GET['imgsize'] : RSS_DEFAULT_IMAGE_SIZE);
                              
                              
                                    if ($random) {
                                    $products = zen_random_select($sql_products);
                                  } else {
                                    $products = $db->Execute($sql_products);
                                  }
                                  $cashTaxRate = array();
                                  while(!$products->EOF) {
                                    $info_page = zen_get_info_page($products->fields['products_id']);
                                    $xtags = array();
                              
                                    $link = zen_href_link($info_page, 'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false);
                              
                                    $products_description = $products->fields['products_description'];
                                    if (RSS_PRODUCTS_DESCRIPTION_IMAGE == 'true' && zen_not_null($products->fields['products_image'])) {
                                      $image_url = zen_image(DIR_WS_IMAGES . $products->fields['products_image'], $products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="float: left; margin: 0px 8px 8px 0px;"');
                                      $image_url = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, $image_url);
                                      $image_link = '<a href="' . $link . '">' . $image_url . '</a>';
                                      if(RSS_STRIP_TAGS == 'true') {
                                        $products_description = '<![CDATA[' . $image_link . ']]>' . $products_description;
                                      } else {
                                        $products_description = $image_link . $products_description;
                                      }
                                    }
                              
                                    if (RSS_PRODUCTS_DESCRIPTION_BUYNOW == 'true') {
                              
                                      $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                                      $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = str_replace(' >', '>', $buynow_button);
                              
                                      $buynow_link = '<br /><br />' . '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false) . '" target="_blank">' . $buynow_button . '</a>' . "\n";
                                      if(RSS_STRIP_TAGS == 'true') {
                                        $products_description .= "\n" . '<![CDATA[' . $buynow_link . ']]>';
                                      } else {
                                        $products_description .= "\n" . $buynow_link;
                                      }
                                    }
                              
                                    if (RSS_BUYNOW_LINK == 'true') {
                              
                                      $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                                      $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = str_replace(' >', '>', $buynow_button);
                              
                                      $buynow_link = zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false);
                                      $xtags['zencart:buynow_link'] = $buynow_link;
                                      $xtags['zencart:buynow_button'] = $buynow_button;
                                    }
                              
                              
                              date_default_timezone_set('Europe/Vienna');
                                    $rss->rss_feed_item($products->fields['products_name'],
                                                        $link,
                                                        array('url' => $link, 'PermaLink' => true),
                                                        date('r', strtotime($products->fields['products_date_added'])),
                                                        $products_description,
                                                        $rss->_clear_url($products->fields['products_image']),
                                                        zen_href_link(FILENAME_PRODUCT_REVIEWS,'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false),
                                                        (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR),
                                                        false,
                                                        false,
                                                        $xtags
                                                        );
                                    if ($random)
                                      break;
                                    $products->MoveNext();
                                  }
                                }
                              
                                function zen_rss_category_tree($id_parent=0, $str_cPath='', $limit = 32767){
                                  global $db, $rss, $additionalURL;
                                  if($limit < 0) return;
                                  $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                                     FROM " . TABLE_CATEGORIES . " c
                                                       LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                                     WHERE c.parent_id = " . (int)$id_parent . "
                                                       AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       AND c.categories_status = 1
                                                     ORDER BY c.sort_order, cd.categories_name",
                                                     '', false, 150);
                                  if ($categories->RecordCount() == 0)
                                    return;
                                  while(!$categories->EOF && $limit>0) {
                                    $new_str_cPath = (zen_not_null($str_cPath) ? $str_cPath . '_' . $categories->fields['categories_id'] : $categories->fields['categories_id']);
                                    $products_in_category = zen_count_products_in_category($categories->fields['categories_id']);
                                    if ((CATEGORIES_COUNT_ZERO == '1' && $products_in_category == 0) or $products_in_category >= 1) {
                                      $limit--;
                                      $link = zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_str_cPath . $additionalURL, 'NONSSL', false);
                                      $rss->rss_feed_item($categories->fields['categories_name'],
                                                          $link,
                                                          array('url' => $link, 'PermaLink' => true),
                                                          date('r', strtotime($categories->fields['categories_date'])),
                                                          $categories->fields['categories_description'],
                                                          $categories->fields['categories_image'],
                                                          false,
                                                          (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                                          );
                                    }
                                    if (zen_has_category_subcategories($categories->fields['categories_id'])) {
                                      zen_rss_category_tree($categories->fields['categories_id'], $new_str_cPath, $limit);
                                    }
                                    $categories->MoveNext();
                                  }
                                }
                              // EOF
                              Ich habe jetzt einen Uralt Code eingefügt, und der Läuft ohne Logs, wieso habe ich natürlich nicht verstanden.

                              Code:
                              <?php
                              /**
                               * rss_feed header_php.php
                               *
                               * @package rss feed
                               * @copyright Copyright 2004-2008 Andrew Berezin eCommerce-Service.com
                               * @copyright Portions Copyright 2003-2016 Zen Cart Development Team
                               * @copyright Portions Copyright 2003 osCommerce
                               * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
                               * @version $Id: header_php.php, 2015-03-06 20:23:04 webchills $
                               */
                              //  @ini_set('display_errors', '1');
                              //  error_reporting(E_ALL);
                              
                              @define('RSS_UTM_ACTIVE', 'true');
                              @define('RSS_UTM_SOURCE', 'rss');
                              @define('RSS_UTM_MEDIUM', 'rssfeed');
                              @define('RSS_UTM_TERM', '');
                              @define('RSS_UTM_CONTENT', '');
                              @define('RSS_UTM_CAMPAIGN', '');
                              
                              @define('RSS_BUYNOW_LINK', 'false');
                              @define('RSS_DEFAULT_IMAGE_SIZE', 'small'); // \'small\', \'medium\', \'large\'
                              @define('RSS_CACHE_TIME', '10');
                              
                              @define('DIR_FS_RSSFEED_CACHE', DIR_FS_SQL_CACHE . '/rss');
                              @define('RSS_ERROR_CACHE_DIR', 'Cache directory not found "' . DIR_FS_RSSFEED_CACHE . '"');
                              
                              
                              require_once(DIR_WS_CLASSES . 'rss_feed.php');
                              
                              $rss = new rss_feed();
                              
                              if(RSS_CACHE_TIME > 0) {
                                  $rss->rssFeedCacheSet(true);
                              } else {
                                  $rss->rssFeedCacheSet(false);
                              }
                              
                                $rss->rss_feed_encoding(CHARSET);
                                $rss->rss_feed_content_type('text/xml'); // 'application/rss+xml'
                                $rss->rss_feed_set('ttl', RSS_TTL);
                              
                              if(!$rss->rss_feed_cache($_SERVER['QUERY_STRING'], RSS_CACHE_TIME*60)) {
                              
                                
                                $rss->rss_feed_xmlns('xmlns:g="http://base.google.com/ns/1.0"');
                                $rss->rss_feed_xmlns('xmlns:c="http://base.google.com/cns/1.0"');
                              
                               
                              
                                $directory_array = array();
                                $tpl_dir = $template->get_template_dir('rss(.*)\.css', DIR_WS_TEMPLATE, $current_page_base, 'css');
                                $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.css');
                                foreach ($directory_array as $value) {
                                  $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                                }
                                $tpl_dir = $template->get_template_dir('rss(.*)\.xsl', DIR_WS_TEMPLATE, $current_page_base, 'css');
                                $directory_array = $template->get_template_part($tpl_dir ,'/^rss/', '.xsl');
                                foreach ($directory_array as $value) {
                                  $rss->rss_feed_style(HTTP_SERVER . DIR_WS_CATALOG . $tpl_dir . '/' . $value);
                                }
                              
                                if (is_file($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE)) {
                                  $image = zen_href_link($template->get_template_dir(RSS_IMAGE, DIR_WS_TEMPLATE, $current_page_base, 'images') . '/' . RSS_IMAGE, '', 'NONSSL', false, true, true);
                                } elseif (is_file(DIR_FS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE)) {
                                  $image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . RSS_IMAGE;
                                } else {
                                  $image = false;
                                }
                                $rss->rss_feed_image((RSS_IMAGE_NAME == '' ? STORE_NAME : RSS_IMAGE_NAME), HTTP_SERVER . DIR_WS_CATALOG, $image);
                              
                                $rss_title = (RSS_TITLE == '' ? STORE_NAME : RSS_TITLE);
                                $rss_title .= RSS_TITLE_DELIMITER . rss_feed_title();
                              
                                $rss->rss_feed_description_set(RSS_ITEMS_DESCRIPTION, RSS_ITEMS_DESCRIPTION_MAX_LENGTH);
                                $rss->rss_feed_set('title', $rss_title);
                                $rss->rss_feed_set('link', HTTP_SERVER . DIR_WS_CATALOG);
                                $rss->rss_feed_set('description', RSS_DESCRIPTION);
                                $rss->rss_feed_set('lastBuildDate', date('r'));
                                $rss->rss_feed_set('generator', 'Zen-Cart v. ' . RSS_FEED_VERSION . ' RSS 2.0 Feed');
                                $rss->rss_feed_set('copyright', 'Copyright &copy; ' . date('Y') . ' ' . (RSS_COPYRIGHT == ''? STORE_OWNER : RSS_COPYRIGHT));
                                $rss->rss_feed_set('managingEditor', (RSS_MANAGING_EDITOR == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_MANAGING_EDITOR));
                                $rss->rss_feed_set('webMaster', (RSS_WEBMASTER == ''? STORE_OWNER_EMAIL_ADDRESS . " (" . STORE_OWNER . ")" : RSS_WEBMASTER));
                                $rss->rss_feed_set('language', $_SESSION["languages_code"]);
                              
                                $additionalURL = '';
                                if($_SESSION["languages_code"] != DEFAULT_LANGUAGE) {
                                  $additionalURL .= '&language=' . $_SESSION["languages_code"];
                                }
                                if(isset($_GET["ref"])) {
                                  $additionalURL .= '&ref=' . $_GET["ref"];
                                }
                                if(isset($_GET["utm_source"]) && isset($_GET["utm_medium"])) {
                                  $additionalURL .= '&utm_source=' . $_GET["utm_source"] . '&utm_medium=' . $_GET["utm_medium"];
                                  if($_GET["utm_term"] != '') $additionalURL .= '&utm_term=' . $_GET["utm_term"];
                                  if($_GET["utm_content"] != '') $additionalURL .= '&utm_content=' . $_GET["utm_content"];
                                  if($_GET["utm_campaign"] != '') $additionalURL .= '&utm_campaign=' . $_GET["utm_campaign"];
                                } elseif (RSS_UTM_ACTIVE == 'true' && RSS_UTM_SOURCE != '' && RSS_UTM_MEDIUM != '') {
                                  $additionalURL .= '&utm_source=' . RSS_UTM_SOURCE . '&utm_medium=' . RSS_UTM_MEDIUM;
                                  if(RSS_UTM_TERM != '') $additionalURL .= '&utm_term=' . RSS_UTM_TERM;
                                  if(RSS_UTM_CONTENT != '') $additionalURL .= '&utm_content=' . RSS_UTM_CONTENT;
                                  if(RSS_UTM_CAMPAIGN != '') $additionalURL .= '&utm_campaign=' . RSS_UTM_CAMPAIGN;
                                }
                              
                                $random = false;
                              
                                if(isset($_GET['products_id'])) $_GET['products_id'] = (int)$_GET['products_id'];
                              
                                $limit = "";
                                if(isset($_GET['limit'])) {
                                  if((int)$_GET['limit'] > 0) {
                                    $limit = " LIMIT " . (int)$_GET['limit'];
                                  }
                                } elseif ((int)RSS_PRODUCTS_LIMIT > 0) {
                                  $limit = " LIMIT " . (int)RSS_PRODUCTS_LIMIT;
                                }
                              
                                switch($_GET["feed"]) {
                              
                              
                              
                                  case "news":
                                    require_once(DIR_WS_FUNCTIONS . 'news.php');
                                    $date_selector = $db->Execute("SELECT news_date_published
                                                                   FROM " . TABLE_NEWS_ARTICLES . "
                                                                   WHERE news_status = '1'
                                                                     AND to_days(news_date_published) <= to_days(now())
                                                                   GROUP BY news_date_published DESC
                                                                   LIMIT " . (int)NEWS_RSS_FEED_NUMBER_OF_DAYS);
                                    while (!$date_selector->EOF) {
                                      $article = $db->Execute("SELECT n.article_id, na.author_name, na.author_email, nt.news_article_name, nt.news_article_text, nt.news_article_shorttext, n.news_image, nt.news_image_text, n.news_date_published
                                                               FROM " . TABLE_NEWS_ARTICLES . " n
                                                                 LEFT JOIN " . TABLE_NEWS_ARTICLES_TEXT . " nt ON (n.article_id = nt.article_id AND nt.language_id = " . (int)$_SESSION['languages_id'] . "), " .
                                                                        TABLE_NEWS_AUTHORS . " na
                                                               WHERE n.authors_id = na.authors_id
                                                                 AND n.news_status = '1'
                                                                 AND n.news_date_published = '" . $date_selector->fields['news_date_published'] . "'
                                                               ORDER BY n.sort_order");
                                      while (!$article->EOF) {
                                        $xtags = array();
                                        $link = zen_href_link(FILENAME_NEWS_ARTICLE, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false);
                                        $rss->rss_feed_item($article->fields['news_article_name'],
                                                            $link,
                                                            array('url' => $link, 'PermaLink' => true),
                                                            date('r', strtotime($article->fields['news_date_published'])),
                                                            news_create_news_summary($article->fields['news_article_text'], $article->fields['news_article_shorttext']),
                                                            $article->fields['news_image'],
                                                            zen_href_link(FILENAME_NEWS_COMMENTS, 'article_id=' . $article->fields['article_id'] . $additionalURL, 'NONSSL', false),
                                                            $article->fields['author_name'] . " <" . $article->fields['author_email'] . ">",
                                                            false,
                                                            false,
                                                            $xtags
                                                            );
                                        $article->MoveNext();
                                      }
                                      $date_selector->MoveNext();
                                    }
                                    break;
                              
                                  case "categories":
                                    // don't build a tree when no categories
                                    $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status = '1' limit 1");
                                    if ($check_categories->RecordCount() > 0) {
                                      if(isset($_GET['cPath'])) {
                                        $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                                                    FROM " . TABLE_CATEGORIES . " c
                                                                      LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                                                    WHERE c.parent_id = " . (int)$id_parent . "
                                                                      AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                      AND c.categories_status= '1'
                                                                    ORDER BY c.sort_order, cd.categories_name",
                                                                    '', false, 150);
                              
                                        if(!$categories->EOF) {
                                          $link_categories = addslashes(zen_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath . $additionalURL, 'NONSSL', false));
                                          $rss->rss_feed_item($categories->fields['categories_name'],
                                                              $link_categories,
                                                              array('url' => $link_categories, 'PermaLink' => true),
                                                              date('r', strtotime($categories->fields['categories_date'])),
                                                              $categories->fields['categories_description'],
                                                              $categories->fields['categories_image'],
                                                              false,
                                                              (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                                              );
                                          if(!isset($_GET['limit']) || (int)$_GET['limit'] >1) {
                                            zen_rss_category_tree($current_category_id, $cPath, isset($_GET['limit']) ? ((int)$_GET['limit']-1) : 32767);
                                          }
                                        }
                                      } else {
                                        zen_rss_category_tree(0, '', isset($_GET['limit']) ? (int)$_GET['limit'] : 32767);
                                      }
                                    }
                                    break;
                              
                                  case "specials_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_SPECIALS;
                                  case "specials":
                                  $sale_categories = $db->Execute("SELECT sale_categories_all FROM " . TABLE_SALEMAKER_SALES . " WHERE sale_status = 1");
                                  
                                  
                                  if ($sale_categories->RecordCount() > 0){
                                  $sale_categories_all = '';
                                  while(!$sale_categories->EOF) {
                                        $sale_categories_all .= substr($sale_categories->fields['sale_categories_all'], 0, -1); 
                                        $sale_categories->MoveNext();
                                  }
                                  $sale_categories_all = substr($sale_categories_all, 1); 
                              
                                     $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, p.master_categories_id, m.manufacturers_name, r.reviews_rating
                                                               FROM " . TABLE_PRODUCTS . " p
                                                                 LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                                 LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                 LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                 LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                               WHERE p.products_status = 1
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                 AND (s.status = 1 OR (p.master_categories_id IN ($sale_categories_all))) " . $limit;
                              
                              } else {
                                
                                     $specials_product_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price, p.products_tax_class_id, s.specials_new_products_price as price, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                               FROM " . TABLE_PRODUCTS . " p
                                                                 LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                                 LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                 LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                 LEFT JOIN " . TABLE_SPECIALS . " s ON (p.products_id = s.products_id)
                                                               WHERE p.products_status = 1
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                 AND s.status = 1  " . $limit;
                              }
                                    zen_rss_products($specials_product_query, $random);
                                    break;
                              
                                  case "featured_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_FEATURED_PRODUCTS;
                                  case "featured":
                                    $featured_products_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                                FROM " . TABLE_PRODUCTS . " p
                                                                  LEFT JOIN " . TABLE_FEATURED . " f on p.products_id = f.products_id
                                                                  LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id
                                                                  LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                                  LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                                WHERE p.products_status = 1
                                                                 AND f.status = '1'
                                                                 AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                                ORDER BY pd.products_name DESC" . $limit;
                                    zen_rss_products($featured_products_query, $random);
                                    break;
                              
                                  case "best_sellers_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_DISPLAY_BESTSELLERS;
                                  case "best_sellers":
                                    $where_cat = $from_cat = "";
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                        $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                        $where_cat = " AND p.products_id = p2c.products_id
                                                       AND c.categories_id = " . (int)$current_category_id . "
                                                       AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = " AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $best_sellers_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_ordered, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                           FROM " . TABLE_PRODUCTS . " p
                                                             LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                             LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                             LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                           " . $from_cat . "
                                                           WHERE p.products_status = 1
                                                             AND p.products_ordered > 0
                                                             AND pd.language_id = " . (int)$_SESSION['languages_id'] . $where_cat ."
                                                           ORDER BY p.products_ordered DESC, pd.products_name" . $limit;
                                    zen_rss_products($best_sellers_query, $random);
                                    break;
                              
                                  case "upcoming_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_DISPLAY_UPCOMING_PRODUCTS;
                                  case "upcoming":
                                    $where_cat = $from_cat = "";
                                    $display_limit = zen_get_upcoming_date_range();
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                        $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                        $where_cat = "AND p.products_id = p2c.products_id
                                                      AND c.categories_id = " . (int)$current_category_id . "
                                                      AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $expected_query = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.products_date_available as date_expected, p.products_price_sorter as price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                       FROM " . TABLE_PRODUCTS . " p
                                                         LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id)
                                                         LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                         LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                       " . $from_cat . "
                                                       WHERE to_days(products_date_available) >= to_days(now())
                                                         AND p.products_status = 1
                                                         AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       " . $where_cat . "
                                                       " . $display_limit . "
                                                       ORDER BY " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . $limit;
                                    zen_rss_products($expected_query, $random);
                                    break;
                              
                                  case "new_products_random":
                                    $random = true;
                                    $rss->rssFeedCacheSet(false);
                                    $limit = " LIMIT " . MAX_RANDOM_SELECT_NEW;
                                  case "new_products":
                                    $disp_order_default = PRODUCT_NEW_LIST_SORT_DEFAULT;
                                    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
                                    $where_days = zen_get_new_date_range();
                              
                                  case "products":
                                  default:
                                    $where_cat = $from_cat = "";
                                    if (isset($current_category_id) && ($current_category_id > 0)) {
                                      if (RSS_PRODUCTS_CATEGORIES == 'all') {
                                      $from_cat = ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c ";
                                      $where_cat = "AND p.products_id = p2c.products_id
                                                    AND c.categories_id = " . (int)$current_category_id . "
                                                    AND p2c.categories_id = " . (int)$current_category_id . " ";
                                      } else {
                                        $where_cat = "AND p.master_categories_id = " . (int)$current_category_id . " ";
                                      }
                                    }
                                    $where_prod = '';
                                    if(isset($_GET['products_id'])) {
                                      $where_prod = " AND p.products_id=" . (int)$_GET['products_id'];
                                      $limit = " LIMIT 1";
                                    } else if(isset($_GET['products_model'])) {
                                      $where_prod = " AND p.products_model=" . zen_db_input(zen_db_prepare_input($_GET['products_model']));
                                    }
                                    if(!isset($order_by)) $order_by = " ORDER BY p.products_last_modified DESC, p.products_sort_order";
                                    if(!isset($where_days)) $where_days = '';
                                    $sql_products = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                                                     FROM " . TABLE_PRODUCTS . " p
                                                       LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (p.products_id = pd.products_id)
                                                       LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)
                                                       LEFT JOIN " . TABLE_REVIEWS . " r ON (p.products_id = r.products_id)
                                                       " . $from_cat . "
                                                     WHERE pd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       AND p.products_status = 1
                                                       " . $where_cat . "
                                                       " . $where_days . "
                                                       " . $where_prod . "
                                                       " . $order_by . "
                                                       " . $limit;
                                    zen_rss_products($sql_products, $random);
                                    break;
                                }
                              
                              }
                              
                                function zen_rss_products($sql_products, $random){
                                  global $db, $currencies, $rss, $additionalURL;
                              
                                  $imageSize = (isset($_GET['imgsize']) ? $_GET['imgsize'] : RSS_DEFAULT_IMAGE_SIZE);
                              
                              
                                    if ($random) {
                                    $products = zen_random_select($sql_products);
                                  } else {
                                    $products = $db->Execute($sql_products);
                                  }
                                  $cashTaxRate = array();
                                  while(!$products->EOF) {
                                    $info_page = zen_get_info_page($products->fields['products_id']);
                                    $xtags = array();
                              
                                    $link = zen_href_link($info_page, 'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false);
                              
                                    $products_description = $products->fields['products_description'];
                                    if (RSS_PRODUCTS_DESCRIPTION_IMAGE == 'true' && zen_not_null($products->fields['products_image'])) {
                                      $image_url = zen_image(DIR_WS_IMAGES . $products->fields['products_image'], $products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="float: left; margin: 0px 8px 8px 0px;"');
                                      $image_url = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, $image_url);
                                      $image_link = '<a href="' . $link . '">' . $image_url . '</a>';
                                      if(RSS_STRIP_TAGS == 'true') {
                                        $products_description = '<![CDATA[' . $image_link . ']]>' . $products_description;
                                      } else {
                                        $products_description = $image_link . $products_description;
                                      }
                                    }
                              
                                    if (RSS_PRODUCTS_DESCRIPTION_BUYNOW == 'true') {
                              
                                      $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                                      $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = str_replace(' >', '>', $buynow_button);
                              
                                      $buynow_link = '<br /><br />' . '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false) . '" target="_blank">' . $buynow_button . '</a>' . "\n";
                                      if(RSS_STRIP_TAGS == 'true') {
                                        $products_description .= "\n" . '<![CDATA[' . $buynow_link . ']]>';
                                      } else {
                                        $products_description .= "\n" . $buynow_link;
                                      }
                                    }
                              
                                    if (RSS_BUYNOW_LINK == 'true') {
                              
                                      $buynow_button = str_replace('<img src="', '<img src="' . HTTP_SERVER . DIR_WS_CATALOG, zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT));
                                      $buynow_button = preg_replace('@onmouseover="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = preg_replace('@onmouseout="[^"]*"@i', '', $buynow_button);
                                      $buynow_button = str_replace(' >', '>', $buynow_button);
                              
                                      $buynow_link = zen_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products->fields['products_id'] . '&action=buy_now' . $additionalURL, 'SSL', false);
                                      $xtags['zencart:buynow_link'] = $buynow_link;
                                      $xtags['zencart:buynow_button'] = $buynow_button;
                                    }
                              
                              
                              date_default_timezone_set('Europe/Vienna');
                                    $rss->rss_feed_item($products->fields['products_name'],
                                                        $link,
                                                        array('url' => $link, 'PermaLink' => true),
                                                        date('r', strtotime($products->fields['products_date_added'])),
                                                        $products_description,
                                                        $rss->_clear_url($products->fields['products_image']),
                                                        zen_href_link(FILENAME_PRODUCT_REVIEWS,'products_id=' . $products->fields['products_id'] . $additionalURL, 'NONSSL', false),
                                                        (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR),
                                                        false,
                                                        false,
                                                        $xtags
                                                        );
                                    if ($random)
                                      break;
                                    $products->MoveNext();
                                  }
                                }
                              
                                function zen_rss_category_tree($id_parent=0, $str_cPath='', $limit = 32767){
                                  global $db, $rss, $additionalURL;
                                  if($limit < 0) return;
                                  $categories = $db->Execute("SELECT c.categories_id, c.parent_id, GREATEST(c.date_added, IFNULL(c.last_modified, 0)) AS categories_date, c.categories_image, cd.categories_name, cd.categories_description
                                                     FROM " . TABLE_CATEGORIES . " c
                                                       LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id
                                                     WHERE c.parent_id = " . (int)$id_parent . "
                                                       AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
                                                       AND c.categories_status = 1
                                                     ORDER BY c.sort_order, cd.categories_name",
                                                     '', false, 150);
                                  if ($categories->RecordCount() == 0)
                                    return;
                                  while(!$categories->EOF && $limit>0) {
                                    $new_str_cPath = (zen_not_null($str_cPath) ? $str_cPath . '_' . $categories->fields['categories_id'] : $categories->fields['categories_id']);
                                    $products_in_category = zen_count_products_in_category($categories->fields['categories_id']);
                                    if ((CATEGORIES_COUNT_ZERO == '1' && $products_in_category == 0) or $products_in_category >= 1) {
                                      $limit--;
                                      $link = zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_str_cPath . $additionalURL, 'NONSSL', false);
                                      $rss->rss_feed_item($categories->fields['categories_name'],
                                                          $link,
                                                          array('url' => $link, 'PermaLink' => true),
                                                          date('r', strtotime($categories->fields['categories_date'])),
                                                          $categories->fields['categories_description'],
                                                          $categories->fields['categories_image'],
                                                          false,
                                                          (RSS_AUTHOR == ''? STORE_OWNER_EMAIL_ADDRESS . " <" . STORE_OWNER . ">" : RSS_AUTHOR)
                                                          );
                                    }
                                    if (zen_has_category_subcategories($categories->fields['categories_id'])) {
                                      zen_rss_category_tree($categories->fields['categories_id'], $new_str_cPath, $limit);
                                    }
                                    $categories->MoveNext();
                                  }
                                }
                              // EOF
                              Vieleicht hilft das den ein oder anderen mal weiter der auch so ein Problem hat.

                              Grüße

                              Guido

                              Kommentar

                              Info zu diesem Forenarchiv:
                              Mit Release von 1.5.7 wurde die deutsche Zen Cart Version auf eine reine DIY-Lösung umgestellt.
                              Für einen Support via Forum stehen keine personellen und zeitlichen Ressourcen mehr zur Verfügung.
                              Dieses Supportforum bleibt im Nur-Lesen-Modus als Wissensarchiv noch online verfügbar.
                              PM Funktionalität, Registrierung und Posten neuer Beiträge sind deaktiviert.
                              Zugriff auf Anhänge in den Postings ist auch ohne Registrierung/Einloggen möglich.
                              FAQ und Downloadbereich des Forums wurden in die neue umfangreiche Knowledgebase auf der zen-cart-pro.at Website übernommen.

                              Das Development der deutschen Zen Cart Version geht wie bisher auf Github weiter.
                              Wir werden auch weiterhin neue Versionen bereitstellen und die Onlinedokumentation/Knowledgebase aktualisieren.
                              Fehler in der Software können auf Github als Issues gemeldet werden.
                              Follow us
                              aktuelle version
                              Zen Cart 1.5.7g deutsch
                              vom 12.12.2023
                              [Download]
                              Lädt...
                              X