kristal Posted May 19, 2010 Posted May 19, 2010 How do I edit the required format for the DOB entry in the admin area? I have a wholesale website and I've been using the add-ons where you must be logged in to view prices, and the restricted_website so that new customers need an authorization word to create an account. (This one here: http://addons.oscommerce.com/info/4399) It's been working great, except one thing... if I want to edit an account in my admin area, it won't let me. When I try to edit an account, it is saying there is an error because the DOB entry must be in the form xx/xx/xxx. The restricted website add-on is using the DOB entry to collect the authorization word, but the format didn't get changed in the admin side. Although, I thought I had made all the same changes in the admin as I did in the front end. Any help?? I know this is an easy fix, but I'm not proficient in php, and I'm not too familiar with all of the different pages in oscommerce.. Quote
diy Posted May 19, 2010 Posted May 19, 2010 (edited) Didint get what you are actually asking , If you want to change D/M/Y to M/D/Y go to catalog/includes/languages/emglish.php catalog/admin/includes/languages/emglish.php define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', 'd/m/Y'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); Edited May 19, 2010 by diy Quote
kristal Posted May 20, 2010 Author Posted May 20, 2010 Sorry to be confusing; but that's not exactly what I need to do. The contrib I installed is using the dob field and changed it so the customers need to put in a preset word (authorization word) in that field. So, it is not in any date format; its a word. It works fine on the customer end when they use it to create an account, then when I view their account, the field is blank, and its asking for a date when I try to edit anything else on the account. I either need to make that field non-mandatory in the back end (while leaving it mandatory on the front end), OR change the admin so that the dob field can be filled in with my authorization word instead of a date. Here is PART of the changes I did on the front end to make it work (I posted a link to the contrib above): In create_account.php, find around line 81: if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); DELETE IT ---------------- FIND: if (ACCOUNT_DOB == 'true') { if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) { $error = true; --------------- REPLACE WITH (insert your own authorization word): if (ACCOUNT_DOB == 'true') { if (isset($HTTP_POST_VARS ['dob'])){ $dob = tep_db_prepare_input ($HTTP_POST_VARS['dob']); } else { $dob = false; } } if (ACCOUNT_DOB == 'true') { if ( ($dob != 'PutYourAuthorizationWordHere') ) { $error = true; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.