You are here

function anonymous_publishing_update_7003 in Anonymous Publishing 7

Add field 'ip' to {anonymous_publishing}.

File

./anonymous_publishing.install, line 408
Install and uninstall hooks.

Code

function anonymous_publishing_update_7003() {
  $ip = array(
    'description' => 'IP-address used to post contents.',
    'type' => 'varchar',
    'length' => 16,
    'not null' => TRUE,
    'default' => '',
  );
  db_add_field('anonymous_publishing', 'ip', $ip);
  $options = variable_get('anonymous_publishing_options', array(
    'sactivate' => 'sactivate',
    'sactstick' => 'sactstick',
    'modmail' => 0,
    'blockip' => 0,
    'aregist' => 0,
  ));
  $types = variable_get('anonymous_publishing_types', array());
  $period = variable_get('anonymous_publishing_period', -1);
  variable_set('anonymous_publishing_cl_options', $options);
  variable_set('anonymous_publishing_cl_types', $types);
  variable_set('anonymous_publishing_cl_period', $period);
  variable_del('anonymous_publishing_options');
  variable_del('anonymous_publishing_types');
  variable_del('anonymous_publishing_period');
}