You are here

function shurly_set_link_active in ShURLy 7

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

Activate or deactivate a link

2 calls to shurly_set_link_active()
shurly_confirm_delete_form_submit in ./shurly.module
Submit handler for above form
shurly_disable_url in ./shurly.module

File

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

Code

function shurly_set_link_active($rid, $active) {
  $record = db_query('SELECT * FROM {shurly} WHERE rid = :rid', array(
    'rid' => $rid,
  ))
    ->fetchObject();
  if ($record) {
    $record->rid = $rid;
    $record->active = $active ? 1 : 0;
    return drupal_write_record('shurly', $record, 'rid');
  }
  else {
    return FALSE;
  }
}