You are here

function prev_next_reindex in Previous/Next API 6

Same name and namespace in other branches
  1. 7.2 prev_next.module \prev_next_reindex()
  2. 7 prev_next.module \prev_next_reindex()
2 calls to prev_next_reindex()
prev_next_admin_submit in ./prev_next.module
Submit callback.
prev_next_reindex_confirm_submit in ./prev_next.module

File

./prev_next.module, line 205

Code

function prev_next_reindex() {

  // Wipe the table clean
  db_query('TRUNCATE {prev_next_node}');

  // Get the highest nid
  $max_nid = db_result(db_query('SELECT MAX(nid) FROM {node}'));

  // Set the variable to that
  variable_set('prev_next_index_nid', $max_nid);
  if ($max_nid) {
    drupal_set_message(t('Prev/Next will index from node %nid downward.', array(
      '%nid' => $max_nid,
    )));
  }
}