You are here

function _answers_notify_nodeapi in Answers 6

Same name and namespace in other branches
  1. 6.2 includes/answers.notify.inc \_answers_notify_nodeapi()
1 call to _answers_notify_nodeapi()
answers_nodeapi in ./answers.module

File

includes/answers.notify.inc, line 76
Notification functions for the 'Answers' module

Code

function _answers_notify_nodeapi(&$node, $op, $teaser) {
  switch ($op) {
    case 'insert':
      if ($node->type == 'answer') {
        $question_id = $node->field_answer_question[0]['nid'];

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