Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    114
    Plugin Contributions
    0

    Default RSS feed of Reviews

    I looked for this , but couldnt find it anyway.. so will try posting a new thread for the first time.

    Would like to find or make a module that creates an RSS feed out of reviews.
    Any suggestions?

    Thank you

  2. #2
    Join Date
    May 2007
    Posts
    114
    Plugin Contributions
    0

    Default Re: RSS feed of Reviews

    Quote Originally Posted by greenhat View Post
    I looked for this , but couldnt find it anyway.. so will try posting a new thread for the first time.

    Would like to find or make a module that creates an RSS feed out of reviews.
    Any suggestions?

    Thank you

    Finally figured this out. Figured, i'd share the knowledge. In case anyone is interested, here's how I resolved this. It could be used to create an RSS feed out of any data in Zen Cart DB.

    The file that needs to be modified is:
    /includes/modules/pages/rss_feed/header_php.php

    Need to create a new case statement here : switch($_GET["feed"]) {

    you can see what other case statements look like and just substitute for your own SQL. For example, i needed an RSS feed for 6 random reviews from my website. Here's the case statement:

    case "reviews_random":
    $random = true;
    $limit = " LIMIT 6";

    $random_review_select = "SELECT r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name, rd.reviews_text, r.customers_name, r.date_added
    from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, "
    . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_status = '1'
    and p.products_id = r.products_id
    and r.reviews_id = rd.reviews_id
    and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
    " and r.status = 1 ORDER BY RAND() " . $limit;


    $reviews = $db->Execute($random_review_select);

    while (!$reviews->EOF) {
    $xtags = array();
    $xtags['image'] = $reviews->fields['products_image'];
    $xtags['rating'] = $reviews->fields['reviews_rating'];
    $link = zen_href_link(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $reviews->fields['products_id'] . $laguage_url, 'NONSSL', false);
    $rss->rss_feed_item($reviews->fields['products_name'],
    $link,
    array('url' => $link, 'PermaLink' => true),
    $reviews->fields['date_added'],
    $reviews->fields['reviews_text'],
    $reviews->fields['products_image'],
    false,
    $reviews->fields['customers_name'],
    false,
    false,
    $xtags
    );
    $reviews->MoveNext();
    }

    break;

    ---------------

    once you implement a new case statement, you can access the results via this link:

    /index.php?main_page=rss_feed&feed=reviews_random

    where feed={name of the case statement}


    hope this helps if anyone needs anything like this.

  3. #3
    Join Date
    Sep 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: RSS feed of Reviews

    I know this post is almost three years old, but thank you!!

 

 

Similar Threads

  1. v150 Rss Feed
    By stitchnkitty in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 5 Sep 2014, 02:05 PM
  2. RSS feed
    By rajoo.sharma in forum General Questions
    Replies: 5
    Last Post: 10 Sep 2010, 03:17 PM
  3. rss feed from store reviews?
    By Adultmattters in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 31 Aug 2010, 03:24 AM
  4. rss feed external link in the feed?
    By Kitty in forum General Questions
    Replies: 11
    Last Post: 26 Jan 2008, 09:48 PM
  5. Rss Feed
    By Checooper in forum General Questions
    Replies: 1
    Last Post: 16 Apr 2007, 08:33 PM

Posting Permissions

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