You are here

function _prev_next_modify_pointing_nodes in Previous/Next API 7

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

Update other nodes pointing to a particular node

2 calls to _prev_next_modify_pointing_nodes()
_prev_next_modify in ./prev_next.module
Update the prev_next records.
_prev_next_remove in ./prev_next.module
Delete from the prev_next records.

File

./prev_next.module, line 514

Code

function _prev_next_modify_pointing_nodes($nid) {

  // First for previous
  $prev = db_query("SELECT nid FROM {prev_next_node} WHERE prev_nid = :prev_nid", array(
    ':prev_nid' => $nid,
  ))
    ->fetchField();
  if ($prev) {
    _prev_next_add($prev);
  }

  // Then for next
  $next = db_query("SELECT nid FROM {prev_next_node} WHERE next_nid = :next_nid", array(
    ':next_nid' => $nid,
  ))
    ->fetchField();
  if ($next) {
    _prev_next_add($next);
  }
}