Changeset 497
- Timestamp:
- Aug 27, 2004, 1:00:28 AM (20 years ago)
- Location:
- trunk/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_calendar.inc.php
r480 r497 34 34 // years of image availability 35 35 $query = ' 36 SELECT YEAR( date_available) AS year, COUNT(id) AS count36 SELECT YEAR('.$conf['calendar_datefield'].') AS year, COUNT(id) AS count 37 37 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 38 38 '.$page['where'].' … … 85 85 // the number of picture for this month : $calendar_months 86 86 $query = ' 87 SELECT DISTINCT(MONTH(date_available)) AS month, COUNT(id) AS count 88 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 89 '.$page['where'].' 90 AND id = image_id 91 AND YEAR(date_available) = '.$page['calendar_year'].' 92 GROUP BY MONTH(date_available) 87 SELECT DISTINCT(MONTH('.$conf['calendar_datefield'].')) AS month 88 , COUNT(id) AS count 89 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 90 '.$page['where'].' 91 AND id = image_id 92 AND YEAR('.$conf['calendar_datefield'].') = '.$page['calendar_year'].' 93 GROUP BY MONTH('.$conf['calendar_datefield'].') 93 94 ;'; 94 95 $result = mysql_query($query); … … 156 157 // the number of picture for this day : $calendar_days 157 158 $query = ' 158 SELECT DISTINCT( date_available) AS day, COUNT(id) AS count159 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 160 '.$page['where'].' 161 AND id = image_id 162 AND YEAR( date_available) = '.$page['calendar_year'].'163 AND MONTH( date_available) = '.$page['calendar_month'].'159 SELECT DISTINCT('.$conf['calendar_datefield'].') AS day, COUNT(id) AS count 160 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 161 '.$page['where'].' 162 AND id = image_id 163 AND YEAR('.$conf['calendar_datefield'].') = '.$page['calendar_year'].' 164 AND MONTH('.$conf['calendar_datefield'].') = '.$page['calendar_month'].' 164 165 GROUP BY day 165 166 ;'; … … 184 185 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 185 186 '.$page['where'].' 186 AND date_available= \''.$page['calendar_date'].'\'187 AND '.$conf['calendar_datefield'].' = \''.$page['calendar_date'].'\' 187 188 AND id = image_id 188 189 GROUP BY category_id … … 219 220 { 220 221 $query = ' 221 SELECT file,tn_ext, date_available,storage_category_id222 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 223 '.$page['where'].' 224 AND YEAR( date_available) = '.$calendar_year.'222 SELECT file,tn_ext,'.$conf['calendar_datefield'].',storage_category_id 223 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 224 '.$page['where'].' 225 AND YEAR('.$conf['calendar_datefield'].') = '.$calendar_year.' 225 226 AND id = image_id 226 227 ORDER BY RAND() … … 277 278 { 278 279 $query = ' 279 SELECT file,tn_ext, date_available,storage_category_id280 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 281 '.$page['where'].' 282 AND YEAR( date_available) = '.$page['calendar_year'].'283 AND MONTH( date_available) = '.$calendar_month.'280 SELECT file,tn_ext,'.$conf['calendar_datefield'].',storage_category_id 281 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 282 '.$page['where'].' 283 AND YEAR('.$conf['calendar_datefield'].') = '.$page['calendar_year'].' 284 AND MONTH('.$conf['calendar_datefield'].') = '.$calendar_month.' 284 285 AND id = image_id 285 286 ORDER BY RAND() … … 344 345 { 345 346 $query = ' 346 SELECT file,tn_ext, date_available,storage_category_id347 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 348 '.$page['where'].' 349 AND date_available= \''.$calendar_day.'\'347 SELECT file,tn_ext,'.$conf['calendar_datefield'].',storage_category_id 348 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 349 '.$page['where'].' 350 AND '.$conf['calendar_datefield'].' = \''.$calendar_day.'\' 350 351 AND id = image_id 351 352 ORDER BY RAND() … … 418 419 419 420 $query = ' 420 SELECT file,tn_ext, date_available,storage_category_id421 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 422 '.$page['where'].' 423 AND date_available= \''.$page['calendar_date'].'\'';421 SELECT file,tn_ext,'.$conf['calendar_datefield'].',storage_category_id 422 FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.' 423 '.$page['where'].' 424 AND '.$conf['calendar_datefield'].' = \''.$page['calendar_date'].'\''; 424 425 if ($calendar_category != 0) 425 426 { … … 452 453 453 454 $url_link = PHPWG_ROOT_PATH.'category.php?cat=search'; 454 $url_link.= '&search= date_available:'.$_GET['day'];455 $url_link.= '&search='.$conf['calendar_datefield'].':'.$_GET['day']; 455 456 if ($calendar_category != 0) 456 457 { -
trunk/include/config.inc.php
r493 r497 89 89 // for PHP version newer than 4.1.2 : 90 90 // $conf['show_exif_fields'] = array('CameraMake','CameraModel','DateTime'); 91 92 $conf['calendar_datefield'] = 'date_creation'; 91 93 ?> -
trunk/include/functions_category.inc.php
r496 r497 687 687 $page['title'] .= ')'; 688 688 } 689 690 $page['where'] = 'WHERE '.$conf['calendar_datefield'].' IS NOT NULL'; 689 691 if (isset($forbidden)) 690 692 { 691 $page['where'] = 'WHERE '.$forbidden; 692 } 693 else 694 { 695 $page['where'] = 'WHERE 1=1'; 693 $page['where'].= ' AND '.$forbidden; 696 694 } 697 695 }
Note: See TracChangeset
for help on using the changeset viewer.