Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Review Approval System


spankone

Recommended Posts

So I download and install the Review Approval System and it seems to go well. The admin side works perfectly, but the catalog side still shows all reviews regardless of wether or not they are approved. I am guessing it is an issue with the database call. I think the call is just pulling everything rather than dropping items with the approved column in the table set to 0.

 

If someone with more experience can look at this, that would be great. This seems like a very valuble contribution, but I can't figure it out.

 

I am pretty new to php, mysql, and osCommerce. So far I am very impressed.

 

 

Thanks

:ph34r:

 

Here is Link to contribution:

http://www.oscommerce.com/community/contributions,76

Link to comment
Share on other sites

  • 3 weeks later...

Dave,

 

What does your table structure for this look like?

Mine appears as...

 

reviews:

 

reviews.gif

 

reviews_description:

 

reviews_desc.gif

 

You also might want to double-check your reviews query in reviews.php, which should look like:

 

<?php
/* <Mav was here!> */
 $reviews_query_raw = "select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and rd.languages_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and r.approved=1 order by r.reviews_id DESC";
/* </Mav was here!> */
 $reviews_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_REVIEWS, $reviews_query_raw, $reviews_numrows);
 $reviews_query = tep_db_query($reviews_query_raw);
 while ($reviews = tep_db_fetch_array($reviews_query)) {
   $reviews_array[] = array('id' => $reviews['reviews_id'],
                            'products_id' => $reviews['products_id'],
                            'reviews_id' => $reviews['reviews_id'],
                            'products_name' => $reviews['products_name'],
                            'products_image' => $reviews['products_image'],
                            'authors_name' => $reviews['customers_name'],
                            'review' => htmlspecialchars(substr($reviews['reviews_text'], 0, 250)) . '..',
                            'rating' => $reviews['reviews_rating'],
                            'word_count' => tep_word_count($reviews['reviews_text'], ' '),
                            'date_added' => tep_date_long($reviews['date_added']));
 }

 require(DIR_WS_MODULES  . 'reviews.php');
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...