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

jenlampton’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Issue summary: View changes

This 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.