You are here:  » Review Question


Review Question

Submitted by getgood on Sun, 2006-05-07 10:55 in

Hi Dave,

Thanks for the help with the html tags...just changing this question as i've figured out how to use html tags in the review now..

Just wanted to know if someone is to put in a review...lets say

I like this product and would recommend it.

What i like about it most is...

Is something making the form eliminate the new line?

It appears like this at the minute

I like this product and would recommend it. What i like about it most is...

Can it be set to realise a new line like above or should I make it clear to people writing reviews that they would need to use the p tag?

Thanks

Adam

Submitted by support on Sun, 2006-05-07 11:49

Hi Adam,

HTML is entity encoded for comment display (as opposed to stripped for product descriptions). This is done html/ratings.php in the following line:

<?php
 
print htmlentities($review["comments"],ENT_QUOTES,$config_charset); 
?>

If you wish to allow HTML, simply change this to:

<?php
 
print $review["comments"]; 
?>

If you just leave it like this of course you will need to look out for any unwanted HTML (or even code or javascript tags) inserted by users leaving reviews when moderating reviews.

One option that sounds like it might work in your situation would be to permit HTML for the first review only, and leave the entity encoding in place for all subsequent reviews. Something like this should work (replacing the line above):

<?php
  
if ($not_first)
  {
    print 
htmlentities($review["comments"],ENT_QUOTES,$config_charset);
  }
  else
  {
    print 
$review["comments"];
    
$not_first true;
  }
?>