Changeset 1054 for branches


Ignore:
Timestamp:
Feb 23, 2006, 10:38:00 PM (18 years ago)
Author:
plg
Message:

bug 278 fixed: calendar on date_available could not work because
date_available has a datetime MySQL column format while date_creation has a
date MySQL column format. We use DATE_FORMAT MySQL function to resolv this
issue.

Location:
branches/branch-1_5/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_5/include/category_calendar.inc.php

    r1005 r1054  
    188188  FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
    189189  '.$page['where'].'
    190     AND '.$conf['calendar_datefield'].' = \''.$page['calendar_date'].'\'
     190    AND DATE_FORMAT('.$conf['calendar_datefield'].', \'%Y-%c-%e\')'
     191    .' = \''.$page['calendar_date'].'\'
    191192  GROUP BY category_id
    192193;';
     
    338339  FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
    339340  '.$page['where'].'
    340     AND '.$conf['calendar_datefield'].' = \''.$calendar_day.'\'
     341    AND DATE_FORMAT('.$conf['calendar_datefield'].', \'%Y-%m-%d\')'
     342      .' = \''.$calendar_day.'\'
    341343  ORDER BY RAND()
    342344  LIMIT 0,1
     
    406408  FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.'
    407409  '.$page['where'].'
    408     AND '.$conf['calendar_datefield'].' = \''.$page['calendar_date'].'\'';
     410    AND DATE_FORMAT('.$conf['calendar_datefield'].', \'%Y-%c-%e\')'
     411      .' = \''.$page['calendar_date'].'\'';
    409412    if ($calendar_category != 0)
    410413    {
  • branches/branch-1_5/include/functions_category.inc.php

    r1005 r1054  
    488488          if (isset($search['fields'][$key]))
    489489          {
    490             $local_clause = $datefield." = '";
     490            $local_clause = 'DATE_FORMAT('.$datefield.", '%Y-%m-%d') = '";
    491491            $local_clause.= str_replace('.', '-',
    492492                                        $search['fields'][$key]['words'][0]);
Note: See TracChangeset for help on using the changeset viewer.