Thread: Foxed by DOB

Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2010
    Location
    East Anglia
    Posts
    52
    Plugin Contributions
    0

    Default Foxed by DOB

    I'm building a store with the latest version of zen-cart. I've just moved it from my local machine to a web server. I built a new database, zipped up my zen-cart installation and re-installed it. In the process I've lost the passwords for my test users.

    I tried to log them in again but every time I do I get the message "'Is your birth date correct? Our system requires the date in this format: DD/MM/YYYY (eg 21/05/1970)')"

    I've spent half an afternoon poring through the fora, the FAQ's and my code. I can find nothing I've done wrong. Anyone help me, please?

    Cheers,

    Dave

  2. #2
    Join Date
    Jul 2009
    Location
    Prague, Czech Republic
    Posts
    530
    Plugin Contributions
    0

    Default Re: Foxed by DOB

    Ah, I read something about this just today on here.

    In one of the admin files, both 'date files' have to match, ie there's two files, one also has an extra line. Sorry, can't remember which file or in which thread he wrote it, but I'd say within the last 6 hours - so try here looking for dates http://www.zen-cart.com/forum/search.php?do=getdaily

  3. #3
    Join Date
    Jul 2009
    Location
    Prague, Czech Republic
    Posts
    530
    Plugin Contributions
    0

    Default Re: Foxed by DOB


  4. #4
    Join Date
    Feb 2010
    Location
    East Anglia
    Posts
    52
    Plugin Contributions
    0

    Default Re: Foxed by DOB

    Thanks for that - but I've been through both files with a fine tooth comb. They match, and they match what everyone else says they should be for UK dates.

    But I still get the wretched error message!!

    It's driving me bonkers!

    Cheers,

    Dave
    www.fernslist.com

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Foxed by DOB

    Dave...

    includes/languages/YOUR_TEMPLATE/english.php

    Date setting must be:

    PHP Code:
    // look in your $PATH_LOCALE/locale directory for available locales..
    // on RedHat try 'en_US'
    // on FreeBSD try 'en_US.ISO_8859-1'
    // on Windows try 'en', or 'English'
    @setlocale(LC_TIME'en_UK.ISO_8859-1');
    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');

    ////
    // Return date in raw format
    // $date should be in format dd/mm/yyyy
    // raw date is in format YYYYMMDD, or DDMMYYYY
      
    if (!function_exists('zen_date_raw')) {
    function 
    zen_date_raw($date$reverse false) {
    if (
    $reverse) {
              return 
    substr($date02) . substr($date32) . substr($date64);
    } else {
      return 
    substr($date64) . substr($date32) . substr($date02);
          }
        }
      } 
    ----------------------------------------------------------------------------

    And in admin/includes/languages/english.php

    PHP Code:
    // look in your $PATH_LOCALE/locale directory for available locales..
    // on RedHat6.0 I used 'en_US'
    // on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
    // this may not work under win32 environments..
    @setlocale(LC_TIME'en_UK.ISO_8859-1');
    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('PHP_DATE_TIME_FORMAT''d/m/Y H:i:s'); // this is used for date()
    define('DATE_TIME_FORMAT'DATE_FORMAT_SHORT ' %H:%M:%S');
    define('DATE_FORMAT_SPIFFYCAL''dd/MM/yyyy');  //Use only 'dd', 'MM' and 'yyyy' here in any order

    ////
    // Return date in raw format
    // $date should be in format dd/mm/yyyy
    // raw date is in format YYYYMMDD, or DDMMYYYY
    function zen_date_raw($date$reverse false) {
    if (
    $reverse) {
      return 
    substr($date02) . substr($date32) . substr($date64);
    } else {
      return 
    substr($date64) . substr($date32) . substr($date02);
      } 
    You need to match up these settings EXACTLY, particularly the lines:

    PHP Code:
      return substr($date02) . substr($date32) . substr($date64);
    } else {
      return 
    substr($date64) . substr($date32) . substr($date02); 
    Either carefully make the edits manually, or just clip what you see above and overwrite the relevant section.
    20 years a Zencart User

  6. #6
    Join Date
    Feb 2010
    Location
    East Anglia
    Posts
    52
    Plugin Contributions
    0

    Default Re: Foxed by DOB

    GOT IT!

    Going through the files again compared to yours I finally realised that, in the admin/includes/languages/english.php I had:

    “setlocale” not “@setlocale”.

    Many thanks for your help.

    Cheers,

    Dave
    www.Fernslist.com

  7. #7
    Join Date
    May 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Foxed by DOB

    I have tried this and I can't get it to work, I removed it from both files, however, what file do I need to edit to remove it from the sign up page?

  8. #8
    Join Date
    May 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Foxed by DOB

    the admin panel....DOH!

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Foxed by DOB

    Quote Originally Posted by customgiftsshoppe View Post
    I have tried this and I can't get it to work, I removed it from both files, however, what file do I need to edit to remove it from the sign up page?


    This is a FUNDAMENTAL bit of ESSENTIAL CODE..., specifying the date formats for the ENTIRE SITE! You should not be hacking at the core code unless you know what you are doing.
    20 years a Zencart User

 

 

Similar Threads

  1. DOB Validation
    By eddy_r3 in forum General Questions
    Replies: 9
    Last Post: 11 May 2012, 12:50 PM
  2. DOB required
    By niccol in forum General Questions
    Replies: 4
    Last Post: 12 Apr 2011, 08:36 AM
  3. change dob
    By homebrewkits in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 2 Mar 2011, 11:38 AM
  4. DOB In Boxes
    By stevanicus in forum Basic Configuration
    Replies: 0
    Last Post: 22 Nov 2010, 01:26 AM
  5. Deleting DOB
    By SpeedBird3654 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Oct 2008, 09:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR