You are here

function prev_next_nid_prev in Previous/Next API 7.2

Same name and namespace in other branches
  1. 6 prev_next.module \prev_next_nid_prev()
  2. 7 prev_next.module \prev_next_nid_prev()

Module function to get the previous node id of the current node.

Parameters

string $nid: The current node id.

Return value

string

1 call to prev_next_nid_prev()
prev_next_nid in ./prev_next.module
Callable API function to get the next/prev nid of a given nid

File

./prev_next.module, line 420
The previous next module indexes the previous and next nodes based upon user-selectable criteria and stores this index in the database for faster retrieval later.

Code

function prev_next_nid_prev($nid) {
  return db_query("SELECT prev_nid\n                   FROM {prev_next_node}\n                   WHERE nid = :nid", array(
    ':nid' => $nid,
  ))
    ->fetchField();
}