You are here

function nodequeue_get_subqueue_position in Nodequeue 5.2

Same name and namespace in other branches
  1. 6.2 nodequeue.module \nodequeue_get_subqueue_position()
  2. 7.3 nodequeue.module \nodequeue_get_subqueue_position()
  3. 7.2 nodequeue.module \nodequeue_get_subqueue_position()

Get the position of a node in a subqueue, or 0 if not found.

1 call to nodequeue_get_subqueue_position()
nodequeue_subqueue_remove_node in ./nodequeue.module
Remove a node from the queue. If a node is in the queue more than once, only the first (closest to 0 position, or the front of the queue) will be removed.

File

./nodequeue.module, line 2052

Code

function nodequeue_get_subqueue_position($sqid, $nid) {

  // We use MIN to make sure we always get the closes to the front of the
  // queue in case the queue has nodes in it multiple times.
  $pos = db_result(db_query("SELECT MIN(position) FROM {nodequeue_nodes} WHERE sqid = %d AND nid = %d", $sqid, $nid));
  return $pos;
}