You are here

function shurly_set_link_active in ShURLy 6

Same name and namespace in other branches
  1. 8 shurly.module \shurly_set_link_active()
  2. 7 shurly.module \shurly_set_link_active()

Activate or deactivate a link @arg $rid (int) the redirect id @arg $active (boolean) TRUE to make redirect active, FALSE to make it inactive

1 call to shurly_set_link_active()
shurly_confirm_delete_form_submit in ./shurly.module
Submit handler for above form

File

./shurly.module, line 550
description http://www.youtube.com/watch?v=Qo7qoonzTCE

Code

function shurly_set_link_active($rid, $active) {
  $record = db_fetch_array(db_query('SELECT * FROM {shurly} WHERE rid = %d', $rid));
  if ($record) {
    $record['rid'] = $rid;
    $record['active'] = $active ? 1 : 0;
    return drupal_write_record('shurly', $record, 'rid');
  }
  else {
    return FALSE;
  }
}