Changeset 2543 for trunk/include/functions_notification.inc.php
- Timestamp:
- Sep 17, 2008, 3:48:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_notification.inc.php
r2335 r2543 36 36 * @return string sql where 37 37 */ 38 function get_std_sql_where_restrict_filter($prefix_condition, $ force_one_condition = false)38 function get_std_sql_where_restrict_filter($prefix_condition, $img_field='ic.image_id', $force_one_condition = false) 39 39 { 40 40 return get_sql_condition_FandF … … 44 44 'forbidden_categories' => 'ic.category_id', 45 45 'visible_categories' => 'ic.category_id', 46 'visible_images' => 'ic.image_id'46 'visible_images' => $img_field 47 47 ), 48 48 $prefix_condition, … … 90 90 WHERE date_available > \''.$start.'\' 91 91 AND date_available <= \''.$end.'\' 92 '.get_std_sql_where_restrict_filter('AND' ).'92 '.get_std_sql_where_restrict_filter('AND', 'id').' 93 93 ;'; 94 94 break; … … 98 98 WHERE date_available > \''.$start.'\' 99 99 AND date_available <= \''.$end.'\' 100 '.get_std_sql_where_restrict_filter('AND' ).'100 '.get_std_sql_where_restrict_filter('AND', 'id').' 101 101 ;'; 102 102 break; … … 435 435 global $conf, $user; 436 436 437 $where_sql = get_std_sql_where_restrict_filter('WHERE', true);437 $where_sql = get_std_sql_where_restrict_filter('WHERE', 'i.id', true); 438 438 439 439 $query = ' … … 441 441 COUNT(DISTINCT id) nb_elements, 442 442 COUNT(DISTINCT category_id) nb_cats 443 FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id443 FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id 444 444 '.$where_sql.' 445 445 GROUP BY date_available … … 460 460 $query = ' 461 461 SELECT DISTINCT id, path, name, tn_ext, file 462 FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id462 FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id 463 463 '.$where_sql.' 464 464 AND date_available="'.$dates[$i]['date_available'].'"
Note: See TracChangeset
for help on using the changeset viewer.