You are here

function signature_forum_nodeapi in Signatures for Forums 5

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

Implementation of hook_nodeapi().

File

./signature_forum.module, line 255

Code

function signature_forum_nodeapi(&$node, $op, $teaser, $page) {
  $settings = variable_get('signature_forum_settings', signature_forum_defaults());
  if (!$teaser && $settings['signature_forum_show_for_' . $node->type]) {
    switch ($op) {
      case 'view':

        // Bug #190446 OG put $account->signature into comments (changing this just in case)
        $node->signature_forum = db_result(db_query('SELECT signature FROM {users_signature} WHERE uid = %d', $node->uid));
        signature_forum_logic($node->signature_forum, $node->uid, strlen(strip_tags($node->content['body']['#value'])));
        $node->content['body']['#value'] = $node->content['body']['#value'] . theme('signature_forum', $node->signature_forum);
        break;
    }
  }
}