You are here

function subscriptions_blogs_form_submit in Subscriptions 5

save blog subscription preferences

File

./subscriptions.module, line 1165

Code

function subscriptions_blogs_form_submit($form_id, $form_values) {
  foreach ($form_values as $n => $v) {
    if (substr($n, 0, 4) == 'subs' && $v == 0) {

      // if value != 1, delete associated subscription row
      db_query('DELETE FROM {subscriptions} WHERE sid = %d AND uid = %d AND stype = \'%s\'', substr($n, 4), $form_values['user'], 'blog');
      $deactivated = TRUE;
    }
  }
  $deactivated ? drupal_set_message(t('Your subscription was deactivated.')) : '';
}