Add Customer Location and Date/Time Stamp to Customer Reviews
eg.
Author: Joe Bloggs Location: London Posted: 17-03-2008 23:28:56 Message: Blah blah blah 1) Apply this SQL patch... Code:
ALTER TABLE `xcart_product_reviews` ADD `location` TEXT NOT NULL ; Replace... Code:
db_query ("INSERT INTO $sql_tbl[product_reviews] (remote_ip, email, message, productid) VALUES ('$REMOTE_ADDR', '$review_author', '$review_message', '$productid')"); Code:
db_query ("INSERT INTO $sql_tbl[product_reviews] (remote_ip, email, message, productid, location, add_date) VALUES ('$REMOTE_ADDR', '$review_author', '$review_message', '$productid', '$review_location', '".time()."')"); Replace... Code:
<td colspan="2"><br /><b>{$lng.lbl_author}: {$r.email|default:$lng.lbl_unknown}</b><br />{$r.message|replace:"\n":"<br />"}<br /><br /></td> Code:
<td colspan="2"><br /><b>{$lng.lbl_author}:</b> {$r.email|default:$lng.lbl_unknown}<br /> Before... Code:
<tr> Code:
<tr> Removal of this code is recommended, as it auto-populates the customer email address into the name field (if customer is logged in). Code:
({$customer_info.email|escape}) |
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
Is there a way to make sure a customer is logged in to leave a review.
|
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
Yes, go to General Settings ╩ Customer reviews options
|
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
What about just adding the date and time? How can this be done?
|
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
Sorry to bump an old thread, but I thought I should bring up a slight vulnerability in your code. The Location Field is not being escaped for html input, which could lead to all sorts of havoc if your reviews are not moderated.
To fix this, Search for Code:
$review_message = htmlspecialchars(trim($review_message)); Code:
$review_message = htmlspecialchars(trim($review_message)); Thanks for sharing your code, and I hope my modification can save some people from a potential headache. The internet can be a dangerous place. |
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
Good catch, thanks dziner :)
|
Re: Add Customer Location and Date/Time Stamp to Customer Reviews
Has anyone adapted this code to work with 4.4x? My attempts have all failed. :\
|
All times are GMT -8. The time now is 11:56 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.