function prev_next_reindex in Previous/Next API 7
Same name and namespace in other branches
- 6 prev_next.module \prev_next_reindex()
- 7.2 prev_next.module \prev_next_reindex()
@todo Please document this function.
See also
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 - @todo Please document this function.
File
- ./
prev_next.module, line 214
Code
function prev_next_reindex() {
// Wipe the table clean
db_query('TRUNCATE {prev_next_node}');
// Get the highest nid
$max_nid = db_query('SELECT MAX(nid) FROM {node}')
->fetchField();
// 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,
)));
}
}