You are here

function video_customfields_nodeapi in Video 6

Same name and namespace in other branches
  1. 5 plugins/video_customfields/video_customfields.module \video_customfields_nodeapi()

Implementation of hook_nodeapi()

File

plugins/video_customfields/video_customfields.module, line 190
Enable addition of custom fileds on video nodes created by video module.

Code

function video_customfields_nodeapi(&$node, $op, $teaser) {
  if ($node->type == 'video') {
    switch ($op) {
      case 'view':

        //If the main node view is being displayed then add the extra video information.
        if ($teaser == FALSE) {
          if ($node->custom_field_1 . $node->custom_field_2 . $node->custom_field_3 . $node->custom_field_4 . $node->custom_field_5 . $node->custom_field_6 != '') {

            //Make sure there is data to display.

            //Add the HTML formatted output of the custom fields to the bottom.
            $node->body .= theme('video_customfields', $node);
          }
        }
        break;
    }
  }
}