Hello David,
Since a few months, there is a big debate in France about buying guides and other comparison price websites, most of them are suspected to manipulate users posts/comments (what a news !!)...So, whatever, consurmer's associations recently asked comparison price websites to store some data concerning comment posters : name (or pseudo), email, which both will be given by the user himself, but also comment's date and user's IP (which are hidden fields).
Could you please explain how to integrate this fields in the whole process (database, front end and moderation in admin back end) ?
Thank you very much for your help !
Bak
Hi David,
I answered by email to this, unfortunately the given code is not working for me...
Thanks
Bak
Hi David,
Still searching why it's working for you and not for me ;)
I have a question : reviews are integrated to my product page, and I used the trick in node 4839...
Should I update the new form handling code from reviews.php to products.php ?
Thanks !
Bak
Hello Bak,
Ah yes that would explain things! I did actually reply just a few minutes a go with some debug code but that's probably unnecessary now - if you're not sure how to copy the new handling code into products.php forward that file to me and I'll copy it across for you...
Cheers,
David.
--
PriceTapestry.com
Ok, now data are stored in the database, but they don't show up in review section (if I use the files you just sent).
With my version, data looks like this in the page :
"a:9:{s:2:\"ip\";s:13:\"88.163.21.181\";s:8:\"datetime\";s:19:\"2013-01-07 12:03:21\";s:8:\"comments\";s:6:\"vsdvdv\";s:3:\"nom\";s:5:\"dsvsd\";s:5:\"ville\";s:4:\"svds\";s:4:\"moto\";s:5:\"sdvsd\";s:4:\"pour\";s:5:\"sdvsd\";s:6:\"contre\";s:5:\"sdvsd\";s:10:\"conclusion\";s:6:\"vdsvsd\";}"
I'm a little confused, I just sent you the 3 files
Thanks David !
Hello Bak,
Sure - have a look at this post which describes how to add arbitrary additional fields to the reviews data which will give you the basics.
In addition to user entered fields you could capture the IP address and date/time by using the following alternative to the first replacement:
$comments = array();
$comments["comments_ip"] = $_SERVER["REMOTE_ADDR"];
$comments["comments_datetime"] = date("Y-m-d H:i:s");
foreach($_POST as $k => $v)
{
if (substr($k,0,9)=="comments_")
{
$k = substr($k,9);
$comments[$k] = stripslashes($v);
}
}
$_POST["comments"] = serialize($comments);
Of course you don't need to display the IP address (comments_ip) and date/time (comments_datetime), but they will be available in the database if required...
Cheers,
David.
--
PriceTapestry.com