You are here

function _photos_edit_page_album in Album Photos 6.2

Same name and namespace in other branches
  1. 7.3 inc/photos.edit.inc \_photos_edit_page_album()
1 call to _photos_edit_page_album()
photos_edit_page in inc/photos.edit.inc

File

inc/photos.edit.inc, line 175

Code

function _photos_edit_page_album($node) {
  if ($node->album['count']) {
    $term = _photos_order_value($_GET['field'], $_GET['sort'], 10);
    $result = pager_query('SELECT f.filepath, f.filemime, f.timestamp, f.filename, f.filesize, u.uid, u.name, p.* FROM {files} f INNER JOIN {x_image} p ON f.fid = p.fid INNER JOIN {users} u ON f.uid = u.uid WHERE p.pid = %d' . $term['order'], $term['limit'], 0, NULL, $node->nid);
    $output .= _photos_order_link("node/{$node->nid}/photos", $node->album['count'], l(t('Album view'), "photos/album/{$node->nid}"), 1);
  }
  else {
    return;
  }
  while ($data = db_fetch_array($result)) {
    $images[] = photos_get_info(0, $data);
  }
  if ($images[0]['fid']) {
    $images[0]['info'] = array(
      'cover' => $node->album['cover'],
      'pid' => $node->nid,
      'title' => $node->title,
      'uid' => $node->uid,
    );
    $output .= theme('pager', NULL, $term['limit']);
    $output .= drupal_get_form('photos_editlist', $images);
    $output .= theme('pager', NULL, $term['limit']);
  }
  return $output;
}