Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

about reviews


PassionSeed

Recommended Posts

I have two questions about the reviews pages. On the product_reviews_write.php page, I've included a character limiter to limit the amount of characters a customer can enter. This works well, but when you view the reviews.php page, the amount of text displayed is limited. Here's the code:

 

<?php echo 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>'; ?>

 

How do you break this up to ensure that all of the text contained in the $reviews['reviews_text'] field is displayed on the reviews.php page?

 

I looked in the functions/general.php file to understand the tep_break_string function. That didn't help me at all. It confused me more.

 

 

My second question comes from the same code above. The stars image is followed by [# of 5 Stars!]. How do I remove the brackets and display this piece of data somewhere else or not at all? I really don't care for the brackets and want to drop this piece of data to a new line.

 

Please help! I've spent several hours trying to figure this out. Now my brain is sizzling, on it's way to being fried!

Link to comment
Share on other sites

:thumbsup: I figured out my second question. Can assist with the first question?

 

I have two questions about the reviews pages.  On the product_reviews_write.php page, I've included a character limiter to limit the amount of characters a customer can enter. This works well, but when you view the reviews.php page, the amount of text displayed is limited. Here's the code:

 

<?php echo 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>'; ?>

 

How do you break this up to ensure that all of the text contained in the $reviews['reviews_text'] field is displayed on the reviews.php page?

 

I looked in the functions/general.php file to understand the tep_break_string function.  That didn't help me at all.  It confused me more.

My second question comes from the same code above.  The stars image is followed by [# of 5 Stars!].  How do I remove the brackets and display this piece of data somewhere else or not at all?  I really don't care for the brackets and want to drop this piece of data to a new line.

 

Please help!  I've spent several hours trying to figure this out. Now my brain is sizzling, on it's way to being fried!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...