function _photos_order_value_change in Album Photos 6.2        
                          
                  
                        Same name and namespace in other branches
- 7.3 photos.module \_photos_order_value_change()
 
 
7 calls to _photos_order_value_change()
  - photos_album_page in inc/photos.album.inc
 
  
  - photos_data_album in inc/photos.data.inc
 
  
  - photos_page_image in inc/photos.page.inc
 
  
  - photos_share in inc/photos.page.inc
 
  
  - photos_sub_album_page in inc/photos.album.inc
 
  
... See full list
 
File
 
   - ./photos.module, line 1485
 
  
Code
function _photos_order_value_change($field, $sort) {
  $array = array(
    'weight' => 'p.wid',
    'timestamp' => 'f.fid',
    'comments' => 'p.comcount',
    'visits' => 'p.count',
    'filesize' => 'f.filesize',
  );
  $array1 = array(
    'desc' => 'desc',
    'asc' => 'asc',
  );
  if ($array[$field] && $array1[$sort]) {
    return " ORDER BY {$array[$field]} {$array1[$sort]}" . ($array[$field] != 'f.fid' ? ', f.fid DESC' : NULL);
  }
}