mrserv0n Posted March 19, 2008 Posted March 19, 2008 I get constant complaints that when a customer posts a review it shows there last name! I cannot figure out how to change this.. I don't mind if it says there for name or ideally Ex : Nick from Texas or just Nick instead of Nick Jones. where can I change this?
arietis Posted March 19, 2008 Posted March 19, 2008 I get constant complaints that when a customer posts a review it shows there last name! I cannot figure out how to change this.. I don't mind if it says there for name or ideally Ex : Nick from Texas or just Nick instead of Nick Jones. where can I change this? in product_reviews_write.php on or about line 48: look for the line that starts with tep_db_query("insert into " on that line, modify the code: tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) to something like tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input(substr($customer['customers_lastname'],1,1) . '.') this should change it to "Nick J." instead of "Nick Jones". the customer's state is stored in a different table, so getting that information would be just a little bit more involved. let me know if you really want that and i can figure that out for you
mrserv0n Posted March 19, 2008 Author Posted March 19, 2008 in product_reviews_write.php on or about line 48:look for the line that starts with tep_db_query("insert into " on that line, modify the code: tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) to something like tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input(substr($customer['customers_lastname'],1,1) . '.') this should change it to "Nick J." instead of "Nick Jones". the customer's state is stored in a different table, so getting that information would be just a little bit more involved. let me know if you really want that and i can figure that out for you This will do just fine Dave! Thanks for taking the time!
mrserv0n Posted March 19, 2008 Author Posted March 19, 2008 This will do just fine Dave! Thanks for taking the time! When I add your 1,1 code I get this error upon writing the review Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /home/content/m/r/s/mrserv0n18/html/includes/functions/database.php on line 132 Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/r/s/mrserv0n18/html/includes/functions/database.php:132) in /home/content/m/r/s/mrserv0n18/html/includes/functions/general.php on line 33 My line 132 is return mysql_real_escape_string($string, $$link); And my line 33 is header('Location: ' . $url); The review then does Show up and works, it just says the first name though, which is ok, but is there a way to get rid of this error up submission of the review even though it still goes through?
arietis Posted March 19, 2008 Posted March 19, 2008 When I add your 1,1 code I get this error upon writing the review Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /home/content/m/r/s/mrserv0n18/html/includes/functions/database.php on line 132 sorry for the fat fingers, that should have been: tep_db_input(substr($customer['customers_lastname'],0,1) see if that helps.
fjr04 Posted April 10, 2008 Posted April 10, 2008 I was just having this same problem. The easiest way for me to make the change was to just change line 29 in the same file from: $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); to: $customer_query = tep_db_query("select customers_firstname," . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
AngelLoving Posted November 26, 2008 Posted November 26, 2008 Just for anyones future reference. I was trying to do this myself and came up with an easier way. There are 2 lots of similar code that look like: tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) in product_reviews_write.php. First is around line 48, other is a bit futher down. Just edit the code by adding // before 'lastname' e.g tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_//lastname']) Do this for both the 2 bits of coding in this page, and then when you write a new review from then on, only the first name will be shown. Hope this helps.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.