Re: reviews sidebox!? main page problem
Try using this as the:
/includes/templates/your_template_dir/sideboxes/tpl_reviews_random.php
Code:
<?php
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2009 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_reviews_random.php 14007 2009-07-30 14:35:22Z ajeh $
*/
$content = "";
$review_box_counter = 0;
while (!$random_review_sidebox_product->EOF) {
$review_box_counter++;
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_review_sidebox_product->fields['products_id'] . '&reviews_id=' . $random_review_sidebox_product->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_review_sidebox_product->fields['products_image'], $random_review_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . zen_break_string(nl2br(zen_output_string_protected(stripslashes($random_review_sidebox_product->fields['reviews_text']))), 60, '-<br />') . ' ..</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));
$content .= '</div>';
$random_review_sidebox_product->MoveNextRandom();
}
?>
Re: reviews sidebox!? main page problem
that's kinda cool that code adds the reviewers content text in the side box, which is nicer then then just having the product name but can you cut down the content to 30 characters, as it looks like it displays the whole review in the sidebox
again thanks again linda
Re: reviews sidebox!? main page problem
Change the 60 to what you want ...
If you need the name in there, you could add it between the image and the description by referencing it like it is on the alt tag of the image:
$random_review_sidebox_product->fields['products_name']
Re: reviews sidebox!? main page problem
yeah i was hoping that was it but nothing happens until i get it don to about 8 then then it start screwing around with the width of the content in the side box but the full review is still displayed just over more rows
right now i changed the 60 to a 10 with no real change
Re: reviews sidebox!? main page problem
Put the 60 back and add a substr around the text ... for example:
Code:
substr($random_review_sidebox_product->fields['reviews_text'], 0, 20)
Re: reviews sidebox!? main page problem
worked perfectly thank you again
Re: reviews sidebox!? main page problem
You are most welcome ... thanks for the update! :smile:
Re: reviews sidebox!? main page problem
ohh if you want feedback i tried to adjust how much text could be displayed in the side box with this part of the code but it didn't really work but no worries i am a happy camper now
Re: reviews sidebox!? main page problem
I used:
Code:
$content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_review_sidebox_product->fields['products_id'] . '&reviews_id=' . $random_review_sidebox_product->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_review_sidebox_product->fields['products_image'], $random_review_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . zen_break_string(nl2br(zen_output_string_protected(stripslashes(substr($random_review_sidebox_product->fields['reviews_text'], 0, 20)))), 60, '-<br />') . ' ..</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));
Meanwhile, glad you have it working now ... :smile:
Re: reviews sidebox!? main page problem
Quote:
Originally Posted by
Ajeh
You are most welcome ... thanks for the update! :smile:
Great mod it worked for me too. However having made the mod I now have two strange problems and I am not sure if it is related to the mod.
my site is www.fastbikegear.co.nz and I am using the ZJ black template.
The first problem is that my manufacturer's info side box now has the same contents as my new products info side box?
The second problem is that the order that my side boxes appears in does not match that set in my Layout Box Controller?
Is anyone able to shed any light on what I have done wrong and what I need to do to fix this?
Many thanks in advance