You are here:  » Does the script automatically remove html tags?


Does the script automatically remove html tags?

Submitted by getgood on Sat, 2006-05-06 23:22 in

Hi Dave,

I just wanted to know if there's a way of keeping html tags in the product description?

I've got some products with really long descriptions and it appears as a large paragraph which is hard to read...The html tags like etc...seem to be removed...is there any way around this?

Example product description:
Callaway Big Bertha Titanium 454 The Longest Driver Ever As used by David Mobley to win the World Long Drive Championship with an explosive 377 yard drive. The big 454cc size means more hallmark Big Bertha performance, and more opportunity for distance, forgiveness and fun. The extra large club head provides more stability mdashthanks to a higher Moment of Inertia created by maximizing perimeter weightingmdashfor more accuracy off the tee . Plus, an ultra thin, formed face creates a huge sweet spot that delivers increased ball speed .

How I would like it:
Callaway Big Bertha Titanium 454 The Longest Driver Ever As used by David Mobley to win the World Long Drive Championship with an explosive 377 yard drive.

The big 454cc size means more hallmark Big Bertha performance, and more opportunity for distance, forgiveness and fun.

The extra large club head provides more stability mdashthanks to a higher Moment of Inertia created by maximizing perimeter weightingmdashfor more accuracy off the tee . Plus, an ultra thin, formed face creates a huge sweet spot that delivers increased ball speed .

Is this possible to do?

Also...how would I go about adding more fields into the review part of the script...like name other products used, etc...would this be as simple as creating another table in msql and calling it into the form on ratings.php?

Thanks
Adam

Submitted by support on Sun, 2006-05-07 06:04

Hi Adam,

You can preserve the HTML in product description fields if you wish. In the file includes/admin.php, search for the call to the strip_tags() function (line 161 in the distribution) and remove that line. That will stop the HTML being removed during the import process.

To add extra fields to the reviews, rather than add another table I would just extend the existing "reviews" table; and just copy everything that is done in the code to handle the verification and storing of the "comments" field. This basically amounts to code in html/ratings.php to i) display the new field as part of the existing reviews (line ~15) and ii) create the form field for the new field (line ~50), together with the corresponding code in reviews.php to load the new field into the database (lines 10 - 12).

Hope this helps!
David.