Closed (fixed)
Project:
Nodequeue
Version:
5.x-2.0-rc
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2007 at 03:19 UTC
Updated:
24 Oct 2007 at 23:11 UTC
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
Comment #1
merlinofchaos commentedThat function is a bit iffy; it tests qid, but a node could be in multiple subqueues of a queue.
Comment #2
merlinofchaos commentedI committed a version of this which works with subqueues.
Comment #3
(not verified) commented