condition('name', 'prev_next%%', 'LIKE') ->execute(); } /** * Implents hook_enable(). */ function prev_next_enable() { $max_nid = db_query('SELECT MAX(nid) FROM {node}')->fetchField(); 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))); } } /** * Implements hook_schema(). */ function prev_next_schema() { $schema['prev_next_node'] = array( 'description' => 'Prev/Next node', 'fields' => array( 'prev_nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'next_nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'changed' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), ), 'primary key' => array('nid'), 'indexes' => array( 'prev_nid' => array('prev_nid'), 'next_nid' => array('next_nid'), ), ); return $schema; }