Please include the following function in your release:

/**
* Get the position of a node in a queue, or 0 if not found.
*/
function nodequeue_queue_position($qid, $nid) {
return db_result(db_query("SELECT position FROM {nodequeue_nodes} WHERE qid = %d AND nid = %d", $qid, $nid));
}

This function is very useful in theming to make decisions about whether a particular node is in a designated queue or not, and taking action accordingly. It also can be used to test when something is at the head (or close to the head) of a queue.

Thanks!

Comments

merlinofchaos’s picture

That function is a bit iffy; it tests qid, but a node could be in multiple subqueues of a queue.

merlinofchaos’s picture

Status: Active » Fixed

I committed a version of this which works with subqueues.

Anonymous’s picture

Status: Fixed » Closed (fixed)