function render()
 {
     global $current_theme_path;
     if ($this->contentcollection_type == '1') {
         // if contentcolectin is group
         $data = $this->media_data;
     } else {
         $data = $this->media_data;
         if ($data->type == IMAGE) {
             $this->media_type = 'Image';
             if (strstr($data->image_file, "http://")) {
                 $this->image_path = $data->image_file;
                 $this->image_show = getimagehtml($this->image_path, 300, 250, "", $this->image_path);
             } else {
                 $this->image_path = "files/" . $data->image_file;
             }
             if ($this->contentcollection_type == 2) {
                 $image_albums = Album::load_all($this->uid, IMAGE_ALBUM);
                 $this->links = $image_albums;
             }
         } else {
             if ($data->type == AUDIO) {
                 $this->media_type = 'Audio';
                 $this->image_path = "{$current_theme_path}/images/audio_img.jpg";
                 if ($this->contentcollection_type == 2) {
                     $audio_albums = Album::load_all($this->uid, AUDIO_ALBUM);
                     $this->links = $audio_albums;
                 }
             } else {
                 if ($data->type == VIDEO) {
                     $this->media_type = 'Video';
                     $this->image_path = "{$current_theme_path}/images/video_img.jpg";
                     if ($this->contentcollection_type == 2) {
                         $video_albums = Album::load_all($this->uid, VIDEO_ALBUM);
                         $this->links = $video_albums;
                     }
                 }
             }
         }
     }
     if ($this->contentcollection_type == '1') {
         $this->inner_HTML = $this->generate_group_inner_html();
     } else {
         $this->inner_HTML = $this->generate_inner_html();
     }
     $content = parent::render();
     return $content;
 }
      } else {
        $file = $show_media->file_name;
        $src = Storage::getURL($file);
      }
      $media_value = $show_media->file_name;
      $default_icon = uihelper_resize_mk_img(null, 86, 92, 'images/default_audio.png', "", RESIZE_CROP);
    break;
    case 'TekVideo':
      $image_show = '<script src="'.PA::$tekmedia_site_url.'/Integration/remotePlayer.php?video_id='.$show_media->video_id.'&preroll=true"></script>';
      $default_icon = uihelper_resize_mk_img(null, 86, 92, 'images/default_video.png', "", RESIZE_CROP);
      $media_value = $show_media->video_id;
    break;
    case 'Image':
      if (strstr($show_media->image_file, "http://")) {
        $tt = $show_media->image_file;
          $image_show = getimagehtml($tt, 86, 92, "", $tt);
          $media_value = $show_media->file_name;
      } else {
          $image_show = uihelper_resize_mk_img($show_media->image_file, 86, 92, 'images/default_image.png', "", RESIZE_CROP);
          $default_icon = $image_show;
          $media_value = $show_media->file_name;
      }
    break;
    default:
        die("Content ID $cid is non-media (not image, audio, or video)");
    break;
  }
  $content_url = PA::$url . "/" . FILE_MEDIA_FULL_VIEW . "?cid=$show_media->content_id";
  $content_link = "<a href=\"$content_url\" alt=\"$show_media->title\">$default_icon</a>";
?>
  <input type="hidden" name="media[cid]" id="media_cid" value="<?=$show_media->content_id?>" />
  	case 'Audio':
      if (strstr($show_media->file_name, "http://")) {
        $src = $show_media->file_name;
        $file = $show_media->file_name;
      } else {
        $file = $show_media->file_name;
        $src = Storage::getURL($file);
      }
    break;
    case 'TekVideo':
      $image_show = '<script src="'.PA::$tekmedia_site_url.'/Integration/remotePlayer.php?video_id='.$show_media->video_id.'&preroll=true"></script>';
    break;
    case 'Image':
      if (strstr($show_media->image_file, "http://")) {
        $tt = $show_media->image_file;
	      $image_show = getimagehtml($tt, 500, 400, "", $tt);
      } else {
	      $image_show = uihelper_resize_mk_img($show_media->image_file, 500, 400, NULL, "", RESIZE_FIT_NO_EXPAND);
      }
    break;
    default:
	    die("Content ID $cid is non-media (not image, audio, or video)");
    break;
  }

   if (isset($image_show))  {
	   ?>
	   <a href="<?=@$gallery_link?>#" target="_blank"><?=$image_show?></a><br />
	   <textarea name="attach_media_html" id="attach_media_html"><?=$image_show?></textarea>
	   <?
   }