I would like to use the old 'Customer Review Image' contribution together with this Reviews in Product Display 2.3 contribution. I've got the Reviews in Product Display 2.3 work perfect together with the Review Approval and Allow Guest Reviews contribution. Could somebody please help me how to ad the following lines to the lines used for the Reviews in Product Display 2.3 contribution?
Below the code that normally has to come in catalog/product_reviews.php
// BOF Review Images
$reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, ri.reviews_image from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd left join " . TABLE_REVIEWS_IMAGES . " ri on r.reviews_id = ri.reviews_id and ri.reviews_status = '1' where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.approved = '1' order by r.reviews_id desc";
// EOF Review Images
<?php
// BOF Review Images
?>
<td valign="top" class="main"><?php echo (tep_not_null($reviews['reviews_image']) ? tep_image(DIR_WS_REVIEWS . $reviews['reviews_image'], $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" align="left"') : '') . tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?></td>
<?php
// EOF Review Images
?>
I gues I have to combine the above code with the code below(?) from product_info.php but have no idea how :huh: ..
<?php
// BEGIN PopTheTop Product Info Reviews
?>
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
$reviews_query_average = tep_db_query("select (avg(reviews_rating)) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and approved = 1");
$reviews_average = tep_db_fetch_array($reviews_query_average);
$reveiws_stars = $reviews_average['average_rating'];
$reveiws_rating = number_format($reveiws_stars,0);
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '45'); ?></td>
</tr>
<?php
if (MAX_REVIEWS_IN_PRODUCT_INFO > 0) {
$reviews_query = tep_db_query("select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and rd.reviews_id = r.reviews_id and rd.languages_id = '" . $languages_id . "' and r.approved = '1' order by r.reviews_id DESC");
$num_rows = tep_db_num_rows($reviews_query);
?>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageReviewHeading" valign="top"><?php echo BOX_HEADING_REVIEWS; ?></td>
</tr>
</table>
</td>
</tr>
<?php
if ($num_rows > 0) {
$row = 0;
while (($reviews_values = tep_db_fetch_array($reviews_query)) && ($row < MAX_REVIEWS_IN_PRODUCT_INFO)) {
$row++;
$date_added = tep_date_short($reviews_values['date_added']);
// Write product reviews
?>
<?php
// END PopTheTop Product Info Reviews
?>
I really hope someone could help me out with this one!!