function nodequeue_queue_position in Nodequeue 7.2
Same name and namespace in other branches
- 5.2 nodequeue.module \nodequeue_queue_position()
- 5 nodequeue.module \nodequeue_queue_position()
- 6.2 nodequeue.module \nodequeue_queue_position()
- 7.3 nodequeue.module \nodequeue_queue_position()
Get the position of a node in a queue; this queue MUST have only one subqueue or the results of this function will be unpredictable.
Parameters
$qid: Queue ID for the queue with the node in it.
$nid: Node ID for the node you are seeking.
return int Position of the node in the quue.
1 call to nodequeue_queue_position()
File
- ./
nodequeue.module, line 2085 - Maintains queues of nodes in arbitrary order.
Code
function nodequeue_queue_position($qid, $nid) {
$sqid = db_select('nodequeue_subqueue', 'ns')
->fields('ns', array(
'sqid',
))
->condition('qid', $qid)
->range(0, 1)
->execute()
->fetchField();
return nodequeue_get_subqueue_position($sqid, $nid);
}