You are here

function _answers_notify_nodeapi in Answers 6.2

Same name and namespace in other branches
  1. 6 includes/answers.notify.inc \_answers_notify_nodeapi()

Pseudo implementation of hook_nodeapi().

See also

answers_nodeapi()

1 call to _answers_notify_nodeapi()
answers_nodeapi in ./answers.module
Implements hook_nodeapi().

File

includes/answers.notify.inc, line 72
Notification functionality for 'Answers' to inform users of answers.

Code

function _answers_notify_nodeapi(&$node, $op, $teaser) {
  switch ($op) {
    case 'insert':

      // When a new answer is posted, notify the question author if appropriate.
      if ($node->type == 'answer' && variable_get('answers_new_answer_notice_allow_p', TRUE)) {
        $question_id = $node->field_answer_question[0]['nid'];

        // extract the nid of the question
        if ($question_id) {
          answers_notify_new_answer($question_id);
        }
      }
      break;
  }
}