Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatic Review Approval?


mgump

Recommended Posts

you have this in your products_reviews_write.php, near the top of the file

 

tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");

 

 

add this to the list of columns: reviews_status

add this parameter for its value: '1'

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Do I add reviews_status to the PHP file alone or do I create a column for it in the SQL database?

 

And does the parameter of 1 go into the PHP file or into any column that I need to create in SQL?

Link to comment
Share on other sites

you should really take a look at your tables ... you'd see that the status of the reviews is already an existing column in the database. where else would you mark a review (currently) as approved, when doing it via the admin?

 

you will add the value in the php, and the php adds it to the database ... the VALUE, not a new column.

 

you could, of course, also just go into the database via phpmyadmin and change the default parameter for the status column to 1. your choice ...

as in most coding issue cases, there are several ways of doing it.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Even with the existing ability to approve a review via the admin, for some reason I didn't think the value would be the same one. Great reminder with the default parameter tip as well. Thank you for all the help and tips!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...