I wnat to rotate a nodequeue.That is to bring the front element to the back of the queue. How can thias be done.
For earlier version 4.x.x I had done it with the following code.
function nodequeue_rotate($qid)
{ // customisation
//rotating a queue, by placing the last element in the first
$qid = intval($qid);
$queue = _nodequeue_load($qid);
$pos=1 ;
nodequeue_queue_back($queue, $pos);
}
This was used to rotate the content(based on a generated random number) so that when there are a large nuber of items in a queue,The viewers have a feeling of changed content,by displaying selected items from the queue in a block.
Comments
Comment #1
moshe weitzman commentedI think a random function makes sense as part of nodequeue module itself
Comment #2
merlinofchaos commentedWell, this isn't exactly a random.
You can still use nodequeue_queue_back, but you must use a $sqid instead of a $qid.
Use nodequeue_load_subqueues_by_queue() to get the subqueues; if you're not using a smartqueue, it will only ever return one. You can then send that to nodequeue_queue_back.
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.