You are here

function signature_forum_nodeapi in Signatures for Forums 6

Same name and namespace in other branches
  1. 5.2 signature_forum.module \signature_forum_nodeapi()
  2. 5 signature_forum.module \signature_forum_nodeapi()

Implementation of hook_nodeapi().

File

./signature_forum.module, line 452
Tweaks signatures in ways inspired by other traditional forum software:

Code

function signature_forum_nodeapi(&$node, $op, $teaser, $page) {
  if (!$teaser && $op == 'view') {
    $settings = variable_get('signature_forum_settings', signature_forum_defaults());
    if ($settings['signature_forum_auto_insert']) {
      $node->content['body']['#value'] .= signature_forum_get_signature($node);
    }
  }
  elseif ($op == 'insert' || $op == 'update') {
    $delta = $node->nid;
    $status = $node->signature_forum;
    signature_forum_save_comment_status($delta, 'node', $status);
  }
}