You are here

function comment_notify_page in Comment Notify 5

Same name and namespace in other branches
  1. 5.2 comment_notify.module \comment_notify_page()
1 string reference to 'comment_notify_page'
comment_notify_menu in ./comment_notify.module
Implementation of hook_menu().

File

./comment_notify.module, line 155
This module provides comment follow-up e-mail notification for anonymous and registered users.

Code

function comment_notify_page() {
  global $user;
  $breadcrumb = NULL;
  $op = $_POST['op'];
  $edit = $_POST['edit'];
  $page_content = ' ';
  if (empty($op)) {
    $op = arg(1);
  }
  $arg = arg(2);
  switch ($op) {
    case 'disable':
      $key = $arg;
      db_query("UPDATE {comments} c, {users} u\n          SET c.notify = 0\n        WHERE u.uid = c.uid\n          AND md5(concat(c.mail, ifnull(u.mail, u.init), c.uid, c.name, c.nid)) = '%s'", $arg);
      drupal_set_message(t('Your comment follow-up notification for this post was disabled. Thanks.'));
      $title = t('Disabled comment follow-up notification feature for this post.');
      break;
    default:
      $title = t('Comment Notify');
      break;
  }
  drupal_set_title($title);
  drupal_set_breadcrumb($breadcrumb);
  print theme('page', $page_content);
}