Thank you Cindy, that stopped the error log :)
Can you Please have a peak at the final code changes below and if you can give them your thumbs up
before I add them to my live site? Thanking you in advance!
1) includes/templates/MYTEMPLATE/sideboxes/tpl_reviews_random_scrolling.php:
Code:
$content = '<div id="scrolling_review" class="sideBoxContent centeredContent">';
$count = 1;
while (!$scrolling_review->EOF) {
$rs_pid = $scrolling_review->fields['products_id'];
$rs_pname = $scrolling_review->fields['products_name'];
$content .= PHP_EOL . ' <div class="sideBoxContentItem hiddenField reviewsScroller">';
$content .= "$rs_pname<br /><br /></a>";
$content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $scrolling_review->fields['products_id'] . '&reviews_id=' . $scrolling_review->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $rs_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.png' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
$content .= '</div>';
$count++;
$scrolling_review->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.reviewsScroller").cycle(5000);</script>' . "\n";
2) includes/modules/sideboxes/reviews_scrolling.php:
Code:
$review_status = " and r.status = 1 ";
$scrolling_review_sql = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name,
substring(reviews_text, 1, 70) as reviews_text
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'] . "'" .
$review_status;
if (isset($_GET['products_id'])) {
$scrolling_review_sql .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
}
$scrolling_review = $db->ExecuteRandomMulti($scrolling_review_sql, (int)MAX_RANDOM_SELECT_REVIEWS);
if (!$scrolling_review->EOF) {
require($template->get_template_dir('tpl_reviews_random_scrolling.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_random_scrolling.php');
} elseif (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
// display 'write a review' box
require($template->get_template_dir('tpl_reviews_write.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_write.php');
} else {
// display 'no reviews' box
require($template->get_template_dir('tpl_reviews_none.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_none.php');
}
$title = BOX_HEADING_REVIEWS_SCROLLING;
$title_link = FILENAME_REVIEWS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>
3) includes/languages/english/extra_definitions/scrolling_sideboxes.php:
Code:
define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
Bookmarks