You are here

function nodequeue_nids_visible in Nodequeue 5.2

Same name and namespace in other branches
  1. 6.2 nodequeue.module \nodequeue_nids_visible()
  2. 7.3 nodequeue.module \nodequeue_nids_visible()
2 calls to nodequeue_nids_visible()
nodequeue_arrange_subqueue in ./nodequeue.module
View the contents of a subqueue, with links to re-order the queue.
_nodequeue_ajax_add in ./nodequeue.module

File

./nodequeue.module, line 1347

Code

function nodequeue_nids_visible($sqid = -1, $account = NULL) {
  if (!$account) {
    global $user;
    $account = $user;
  }
  $nids_visible = array();
  if (!user_access('administer nodes', $account)) {
    $node_status_sql = ' AND n.status = 1';
  }
  $query_restricted = db_query(db_rewrite_sql("SELECT DISTINCT(n.nid) FROM {node} n LEFT JOIN {nodequeue_nodes} nq ON nq.nid = n.nid WHERE nq.sqid = %d {$node_status_sql} ORDER BY nq.position {$order}"), $sqid);
  while ($result_restricted = db_fetch_object($query_restricted)) {
    $nids_visible[$result_restricted->nid] = $result_restricted->nid;
  }
  return $nids_visible;
}