Active
Project:
Nodequeue
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2012 at 14:33 UTC
Updated:
24 Nov 2019 at 22:12 UTC
Jump to comment: Most recent
Hi,
I wrote a small module to allow for previous / next links using a nodequeue as the list. I added the following functions, which I think would be helpful in further development of Nodequeue in general.
/* Get the nid based off position */
function nodequeue_position_nid($sqid, $position) {
return db_query("SELECT nid FROM {nodequeue_nodes} WHERE sqid = :sqid AND position = :position", array(':sqid' => $sqid, ':position' => $position))->fetchField();
}
/* Return the number of elements in the nodequeue. */
function nodequeue_count_elements($sqid) {
return db_query("SELECT MAX(position) FROM {nodequeue_nodes} WHERE sqid = :sqid", array(':sqid' => $sqid))->fetchField();
}
Christina
Comments
Comment #1
jenlamptonThis is a nice feature @cbrasfield, thank you! I think we might want to add a checkbox for each queue asking if it should show the next/previous links, and if so render these on the node. I'd gladly welcome a patch for this.
Changing the version to 2.x since the 3.x branch is no longer supported.