Changeset 7504


Ignore:
Timestamp:
10/30/10 22:03:05 (8 years ago)
Author:
plg
Message:

bug 1906 fixed: during batch management, for a given category, use the category
defined sort order for photos, not the generic order_by.

Location:
branches/2.1/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/admin/element_set_global.php

    r6364 r7504  
    450450  $query = ' 
    451451SELECT id,path,tn_ext,file,filesize,level 
    452   FROM '.IMAGES_TABLE.' 
     452  FROM '.IMAGES_TABLE; 
     453 
     454  if (is_numeric($_GET['cat'])) 
     455  { 
     456    $category_info = get_cat_info($_GET['cat']); 
     457     
     458    $conf['order_by'] = $conf['order_by_inside_category']; 
     459    if (!empty($category_info['image_order'])) 
     460    { 
     461      $conf['order_by'] = ' ORDER BY '.$category_info['image_order']; 
     462    } 
     463 
     464    $query.= ' 
     465    JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; 
     466  } 
     467 
     468  $query.= ' 
    453469  WHERE id IN ('.implode(',', $page['cat_elements_id']).') 
    454470  '.$conf['order_by'].' 
  • branches/2.1/admin/element_set_unit.php

    r6713 r7504  
    195195  $query = ' 
    196196SELECT id,path,tn_ext,name,date_creation,comment,author,level,file 
    197   FROM '.IMAGES_TABLE.' 
     197  FROM '.IMAGES_TABLE; 
     198 
     199  if (is_numeric($_GET['cat'])) 
     200  { 
     201    $category_info = get_cat_info($_GET['cat']); 
     202     
     203    $conf['order_by'] = $conf['order_by_inside_category']; 
     204    if (!empty($category_info['image_order'])) 
     205    { 
     206      $conf['order_by'] = ' ORDER BY '.$category_info['image_order']; 
     207    } 
     208 
     209    $query.= ' 
     210    JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; 
     211  } 
     212 
     213  $query.= ' 
    198214  WHERE id IN ('.implode(',', $page['cat_elements_id']).') 
    199215  '.$conf['order_by'].' 
Note: See TracChangeset for help on using the changeset viewer.