You are here

function _photos_order_value in Album Photos 6.2

Same name and namespace in other branches
  1. 7.3 photos.module \_photos_order_value()
6 calls to _photos_order_value()
photos_album_page in inc/photos.album.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
_photos_edit_page_album in inc/photos.edit.inc

... See full list

File

./photos.module, line 1465

Code

function _photos_order_value($field, $sort, $limit, $default = 0) {
  if (!$field && !$sort) {
    $t['order'] = !$default ? ' ORDER BY f.fid DESC' : $default;
  }
  else {
    if (!($t['order'] = _photos_order_value_change($field, $sort))) {
      $t['order'] = !$default ? ' ORDER BY f.fid DESC' : $default;
    }
  }
  if ($limit) {
    if (!($show = intval($_GET['limit']))) {
      if ($_GET['destination']) {
        $str = urldecode($_GET['destination']);
        if (preg_match('/.*limit=(\\d*).*/i', $str, $mat)) {
          $show = intval($mat[1]);
        }
      }
    }
    $t['limit'] = $show ? $show : $limit;
  }
  return $t;
}