/**
         * Function to render video player.
         * 
         * @param $matches - input arguments.
         * @return player code.
         * @author Praveen Rajan
         */
        function CVGVideo_Render($matches)
        {
            global $post, $wpdb;
            $output = '';
            $thumbexists = false;
            $setathumb = false;
            preg_match_all('/([\\.\\w]*)=(.*?) /i', $matches[1], $attributes);
            $arguments = array();
            $arguments = CoolVideoGallery::splitargs($matches[1]);
            $video_details = videoDB::find_video($arguments['videoId']);
            if (!is_array($video_details)) {
                return __('[Video not found]');
            }
            $video = array();
            $video['filename'] = site_url() . '/' . $video_details[0]->path . '/' . $video_details[0]->filename;
            $video['thumb_filename'] = $video_details[0]->path . '/thumbs/' . $video_details[0]->thumb_filename;
            $video['title'] = $video_details[0]->description;
            $video['name'] = $video_details[0]->name;
            if (!array_key_exists('filename', $video)) {
                return '<div style="background-color:#f99; padding:10px;">Error: Required parameter "filename" is missing!</div>';
                exit;
            }
            if (file_exists($video['thumb_filename'])) {
                $thumbexists = true;
            } else {
                $thumbexists = false;
            }
            $options_player = get_option('cvg_player_settings');
            $options = get_option('cvg_settings');
            $thumb_width = $options['cvg_preview_width'];
            $thumb_height = $options['cvg_preview_height'];
            $cv_zc = $options['cvg_zc'];
            $thumb_quality = $options['cvg_preview_quality'];
            if (isset($arguments['width'])) {
                $player_width = $arguments['width'];
            } else {
                $player_width = $options_player['cvgplayer_width'];
            }
            if (isset($arguments['height'])) {
                $player_height = $arguments['height'];
            } else {
                $player_height = $options_player['cvgplayer_height'];
            }
            if (!file_exists(ABSPATH . '/' . $video['thumb_filename'])) {
                $video['thumb_filename'] = WP_CONTENT_URL . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/images/default_video.png';
            } else {
                $video['thumb_filename'] = site_url() . '/' . $video['thumb_filename'];
            }
            if (isset($arguments['mode'])) {
                $video_preview = $video_details[0]->path . '/thumbs/thumbs_' . $video_details[0]->alttext . '_preview.png';
                if (!file_exists(ABSPATH . '/' . $video_preview)) {
                    $video_preview = WP_CONTENT_URL . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/images/default_video.png';
                } else {
                    $video_preview = site_url() . '/' . $video_preview;
                }
                if ($options_player['cvgplayer_autoplay'] == 1) {
                    $autoplay = "true";
                } else {
                    $autoplay = "false";
                }
                if ($options_player['cvgplayer_fullscreen'] == 1) {
                    $full_screen = "true";
                } else {
                    $full_screen = "false";
                }
                if ($options_player['cvgplayer_mute'] == 1) {
                    $mute = "true";
                } else {
                    $mute = "false";
                }
                ?>
	
				<script type='text/javascript' src='<?php 
                echo $this->plugin_url;
                ?>
cvg-player/swfobject.js'></script>
				<div>
				<?php 
                $video_display = '<div id="mediaplayer_vid_' . $arguments['videoId'] . '"><object width="' . $options_player['cvgplayer_width'] . '" height="' . $options_player['cvgplayer_height'] . '" style="" id="playerID_Video' . $arguments['videoId'] . '" data="' . $this->plugin_url . 'cvg-player/player.swf" type="application/x-shockwave-flash">';
                $video_display .= '<param value="' . $full_screen . '" name="allowfullscreen">';
                $video_display .= '<param value="transparent" name="wmode">';
                $video_display .= '<param value="file=' . $video['filename'] . '&amp;image=' . $video_preview . '&amp;height=' . $options_player['cvgplayer_height'] . '&amp;width=' . $options_player['cvgplayer_width'] . '&amp;autostart=' . $autoplay . '&amp;controlbar=' . $options_player['cvgplayer_controlbar'] . '&amp;backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x557722&amp;skin=' . $this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf' . '&amp;volume=' . $options_player['cvgplayer_volume'] . '&amp;mute=' . $mute . '&amp;stretching=' . $options_player['cvgplayer_stretching'] . '" name="flashvars">';
                $video_display .= '<embed width="' . $options_player['cvgplayer_width'] . '" height="' . $options_player['cvgplayer_height'] . '" flashvars="file=' . $video['filename'] . '&amp;image=' . $video_preview . '&amp;skin=' . $this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf&amp;volume=' . $options_player['cvgplayer_volume'] . '&amp;mute=' . $mute . '&amp;controlbar=' . $options_player['cvgplayer_controlbar'] . '&amp;stretching=' . $options_player['cvgplayer_stretching'] . '" lightcolor="0x557722" frontcolor="0xCCCCCC" backcolor="0x000000" wmode="transparent" autostart="' . $autoplay . '" allowscriptaccess="always" allowfullscreen="' . $full_screen . '" quality="high" name="playerID_Video' . $arguments['videoId'] . '" id="playerID_Video' . $arguments['videoId'] . '" style="" src="' . $this->plugin_url . 'cvg-player/player.swf" type="application/x-shockwave-flash">';
                $video_display .= '</object></div>';
                echo $video_display;
                ?>
				<div style="float:left;width:<?php 
                echo $options_player['cvgplayer_width'];
                ?>
px;height:auto;margin-bottom:20px;" >
					<div style="float:left;">
						<input type="image" src="<?php 
                echo $this->plugin_url;
                ?>
images/video-button-embed.png" onclick="generate_embed('<?php 
                echo $arguments['videoId'];
                ?>
');"/>
					</div>
					<div id="embed_content_<?php 
                echo $arguments['videoId'];
                ?>
" style="float:left;display:none;padding-left:5px;padding-top: 3px;width: 85%;">
						<textarea id="embed_text_<?php 
                echo $arguments['videoId'];
                ?>
" style="border:medium none;width:<?php 
                echo $options_player['cvgplayer_width'] - 85;
                ?>
px;"></textarea>
					</div>
				</div>
				</div>
				<br clear="all" />
				<?php 
                return;
            }
            $output .= '<a href="' . $video['filename'] . '" title="' . $video['title'] . '"  rel="shadowbox[' . $video['name'] . '];height=' . $player_height . ';width=' . $player_width . '">';
            $output .= '<img src="' . $video['thumb_filename'] . '" style="width:' . $thumb_width . 'px;height:' . $thumb_height . 'px;" ';
            $output .= 'alt="' . htmlspecialchars('Click to Watch Video') . '"/></a>';
            return $output;
        }
示例#2
0
										</th>
										
										<th scope="row" style="width:3%;">
											<span><?php 
                echo $pid;
                ?>
</span>
											<input type="hidden" name="pid[]" value="<?php 
                echo $pid;
                ?>
" />
										</th>
										
										<td style="width:10%;">
											<?php 
                echo CoolVideoGallery::CVGVideo_Parse('[cvg-video videoId=' . $pid . ' /]');
                ?>
										</td>
										<td style="width:20%;">
											<strong>
												
												<?php 
                echo $video->filename;
                ?>
											</strong>
											<br /><?php 
                echo $date;
                ?>
											<br />
											<?php 
                if ($video_meta_data != '') {
<?php

/**
 * Section to uninstall plugin
 * @author Praveen Rajan
 */
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
    die('You are not allowed to call this page directly.');
}
$title = __('CVG Uninstall');
CvgCore::upgrade_plugin();
if (isset($_POST['uninstallplugin'])) {
    // wp_nonce_field('cvg_plugin_uninstall_nonce','cvg_plugin_uninstall_nonce_csrf');
    if (check_admin_referer('cvg_plugin_uninstall_nonce', 'cvg_plugin_uninstall_nonce_csrf')) {
        CoolVideoGallery::cvg_uninstall();
        require_once ABSPATH . 'wp-admin/includes/plugin.php';
        deactivate_plugins(dirname(dirname(__FILE__)) . '/cool-video-gallery.php');
        ?>
			<script type="text/javascript">
				location.href= "<?php 
        echo admin_url('plugins.php');
        ?>
";</script>
			<?php 
    }
}
?>
<style type="text/css">
	#dashboard-widgets a {
		text-decoration: none;
	}
示例#4
0
        /**
         * Function to render video player.
         * 
         * @param $matches - input arguments.
         * @return player code.
         * @author Praveen Rajan
         */
        function CVGVideo_Render($matches)
        {
            global $post, $wpdb;
            $output = '';
            preg_match_all('/([\\.\\w]*)=(.*?) /i', $matches[1], $attributes);
            $arguments = array();
            $arguments = CoolVideoGallery::splitargs($matches[1]);
            $video_details = videoDB::find_video($arguments['videoId']);
            if (!is_array($video_details)) {
                return __('[Video not found]');
            }
            $options = get_option('cvg_settings');
            $video = array();
            if ($video_details[0]->video_type == $this->video_type_upload) {
                // Upload file type
                $video['filename'] = site_url() . '/' . $video_details[0]->path . '/' . $video_details[0]->filename;
                $video['thumb_filename'] = $video_details[0]->path . '/thumbs/' . $video_details[0]->thumb_filename;
                if (!file_exists(ABSPATH . '/' . $video['thumb_filename'])) {
                    $video['thumb_filename'] = WP_CONTENT_URL . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/images/default_video.png';
                } else {
                    $video['thumb_filename'] = site_url() . '/' . $video['thumb_filename'];
                }
            } else {
                if ($video_details[0]->video_type == $this->video_type_youtube) {
                    // Youtube file type
                    $video['filename'] = $video_details[0]->filename;
                    $video['thumb_filename'] = $video_details[0]->thumb_filename;
                } else {
                    if ($video_details[0]->video_type == $this->video_type_media) {
                        // Media file type
                        $video['filename'] = $video_details[0]->filename;
                        $video['thumb_filename'] = $video_details[0]->path . '/thumbs/' . $video_details[0]->thumb_filename;
                        if (!file_exists(ABSPATH . '/' . $video['thumb_filename'])) {
                            $video['thumb_filename'] = WP_CONTENT_URL . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/images/default_video.png';
                        } else {
                            $video['thumb_filename'] = site_url() . '/' . $video['thumb_filename'];
                        }
                    } else {
                        // Upload file type
                        $video['filename'] = site_url() . '/' . $video_details[0]->path . '/' . $video_details[0]->filename;
                        $video['thumb_filename'] = $video_details[0]->path . '/thumbs/' . $video_details[0]->thumb_filename;
                        if (!file_exists(ABSPATH . '/' . $video['thumb_filename'])) {
                            $video['thumb_filename'] = WP_CONTENT_URL . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/images/default_video.png';
                        } else {
                            $video['thumb_filename'] = site_url() . '/' . $video['thumb_filename'];
                        }
                    }
                }
            }
            if ($options['cvg_description'] == 1) {
                $video['title'] = $video_details[0]->description;
            } else {
                $video['title'] = '';
            }
            $video['name'] = $video_details[0]->name;
            if (!array_key_exists('filename', $video)) {
                return '<div style="background-color:#f99; padding:10px;">Error: Required parameter "filename" is missing!</div>';
                exit;
            }
            $options_player = get_option('cvg_player_settings');
            $thumb_width = $options['cvg_preview_width'];
            $thumb_height = $options['cvg_preview_height'];
            if (isset($arguments['width'])) {
                $player_width = $arguments['width'];
            } else {
                $player_width = $options_player['cvgplayer_width'];
            }
            if (isset($arguments['height'])) {
                $player_height = $arguments['height'];
            } else {
                $player_height = $options_player['cvgplayer_height'];
            }
            if ($options_player['cvgplayer_autoplay'] == 1) {
                $autoplay = "true";
            } else {
                $autoplay = "false";
            }
            if ($options_player['cvgplayer_mute'] == 1) {
                $mute = "true";
            } else {
                $mute = "false";
            }
            if ($options_player['cvgplayer_share_option'] == 1) {
                $player_swf = "player-share.swf";
            } else {
                $player_swf = "player.swf";
            }
            //Embed section for a video
            if (isset($arguments['mode']) && $arguments['mode'] == "playlist") {
                $video_display = '<div id="mediaplayer_vid_' . $arguments['videoId'] . '">';
                $video_display .= '</div>';
                ?>
					<script type="text/javascript">
					jQuery(document).ready(function(){
						
						jwplayer("<?php 
                echo "mediaplayer_vid_" . $arguments['videoId'];
                ?>
").setup({
							"autostart" : "<?php 
                echo $autoplay;
                ?>
",
							"controlbar" : "<?php 
                echo $options_player['cvgplayer_controlbar'];
                ?>
",
							"file" : "<?php 
                echo $video['filename'];
                ?>
",
							"flashplayer" : "<?php 
                echo $this->plugin_url . "cvg-player/" . $player_swf;
                ?>
",
							"volume" : "<?php 
                echo $options_player['cvgplayer_volume'];
                ?>
",
							"width" : "<?php 
                echo $options_player['cvgplayer_width'];
                ?>
",
							"height" : "<?php 
                echo $options_player['cvgplayer_height'];
                ?>
",
							"image" : "<?php 
                echo $video['thumb_filename'];
                ?>
",
							"mute" : "<?php 
                echo $mute;
                ?>
",
							"stretching" : "<?php 
                echo $options_player['cvgplayer_stretching'];
                ?>
",
							"skin" : "<?php 
                echo $this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '-skin/' . $options_player['cvgplayer_skin'] . '.xml';
                ?>
"
						});
					});
					</script>
				<?php 
                $video_display .= '<div><br clear="all" /> </div>';
                return $video_display;
            } else {
                if (isset($arguments['mode']) && $arguments['mode'] == "list_items") {
                    //List of videos section for a gallery
                    $videoDetails = videoDB::find_video($arguments["videoId"]);
                    $gallery_id = $videoDetails[0]->galleryid;
                    $output .= '<a href="' . $video['filename'] . '" title="' . stripslashes($video['title']) . '"  rel="fancy_cvg_gallery_' . $gallery_id . '_' . $arguments['placeholder'] . '" style="float:left;height:' . $thumb_height . 'px !important;">';
                    $output .= '<img src="' . $video['thumb_filename'] . '" style="width:' . $thumb_width . 'px;height:' . $thumb_height . 'px;max-width:100% !important;" ';
                    $output .= 'alt="' . htmlspecialchars('Click to Watch Video') . '" /><div style="width:' . $thumb_width . 'px;"></div></a>';
                } else {
                    if (isset($arguments['mode']) && $arguments['mode'] == "slide_show") {
                        //List of videos section for a gallery
                        $videoDetails = videoDB::find_video($arguments["videoId"]);
                        $gallery_id = $videoDetails[0]->galleryid;
                        $output .= '<a href="' . $video['filename'] . '" title="' . stripslashes($video['title']) . '"  rel="fancy_cvg_gallery_slide_' . $gallery_id . '_' . $arguments['placeholder'] . '">';
                        $output .= '<img  src="' . $video['thumb_filename'] . '" style="width:' . $thumb_width . 'px;height:' . $thumb_height . 'px;max-width:100% !important;" ';
                        $output .= 'alt="' . htmlspecialchars('Click to Watch Video') . '" /></a>';
                    } else {
                        //Single video display
                        $output .= '<a href="' . $video['filename'] . '" title="' . stripslashes($video['title']) . '"  rel="fancy_cvg_video_' . $arguments['videoId'] . '">';
                        $output .= '<img src="' . $video['thumb_filename'] . '" style="width:' . $thumb_width . 'px;height:' . $thumb_height . 'px;" ';
                        $output .= 'alt="' . htmlspecialchars('Click to Watch Video') . '" id="fancy_cvg_video_preview_' . $arguments["videoId"] . '"  /><div style="width:' . $thumb_width . 'px;"></div></a>';
                        ?>
				
				<script type="text/javascript">
					jQuery(document).ready(function() {
		
						jQuery("a[rel=fancy_cvg_video_<?php 
                        echo $arguments['videoId'];
                        ?>
]").fancybox({
							'titlePosition' : 'outside',
							'transitionIn' : 'none',
							'transitionOut' : 'none',
							'autoScale' : true,
							'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
								
								if(title.length != 0)
									return '<span id="fancybox-title-over">' + (title.length ?  title : '') + '</span>';
								else
									return '';
							},
							'content' : '<div id="video_fancy_cvg_video_<?php 
                        echo $arguments['videoId'];
                        ?>
" style="overflow:hidden;"></div>',
	
							'autoDimensions' : false,
							'width' : parseInt("<?php 
                        echo $options_player['cvgplayer_width'];
                        ?>
"),
							'height' : parseInt("<?php 
                        echo $options_player['cvgplayer_height'];
                        ?>
") + 6,
							'onComplete' : function() {
								
								jwplayer('video_fancy_cvg_video_<?php 
                        echo $arguments['videoId'];
                        ?>
').setup({
									'file' : this.href,
									"autostart" : "<?php 
                        echo $autoplay;
                        ?>
",
									"controlbar" : "<?php 
                        echo $options_player['cvgplayer_controlbar'];
                        ?>
",
									"flashplayer" : "<?php 
                        echo $this->plugin_url . "cvg-player/" . $player_swf;
                        ?>
",
									"volume" : "<?php 
                        echo $options_player['cvgplayer_volume'];
                        ?>
",
									"width" : "<?php 
                        echo $options_player['cvgplayer_width'];
                        ?>
",
									"height" : "<?php 
                        echo $options_player['cvgplayer_height'];
                        ?>
",
									"image" :  jQuery('#fancy_cvg_video_preview_<?php 
                        echo $arguments["videoId"];
                        ?>
').attr('src') ,
									"mute" : "<?php 
                        echo $mute;
                        ?>
",
									"stretching" : "<?php 
                        echo $options_player['cvgplayer_stretching'];
                        ?>
",
									"skin" : "<?php 
                        echo $this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '-skin/' . $options_player['cvgplayer_skin'] . '.xml';
                        ?>
"
									
								});
								
								jwplayer('video_fancy_cvg_video_<?php 
                        echo $arguments['videoId'];
                        ?>
').onComplete(function() {
									
									<?php 
                        $options_player = get_option('cvg_player_settings');
                        if ($options_player['cvgplayer_auto_close_single']) {
                            ?>
											jQuery.fancybox.close();
										<?php 
                        }
                        ?>
								});
							}
		
						});
					});

				</script>
				<?php 
                    }
                }
            }
            return $output;
        }
示例#5
0
 /**
  * Build a gallery output
  * 
  * @param array $videolist
  * @param bool $galleryID - gallery ID
  * @param string $template (optional) name for a template file
  * @param int $videos (optional) number of videos per page
  * @return the content
  * @author Praveen Rajan
  */
 function videoCreateGallery($videolist, $galleryID = false, $slide_show = false)
 {
     if (!is_array($videolist)) {
         $videolist = array($videolist);
     }
     $video_gallery = videoDB::find_gallery($galleryID);
     $video_gallery_name = $video_gallery->name;
     $index = 0;
     $out = '';
     $options = get_option('cvg_settings');
     if ($slide_show) {
         $out .= ' <div class="video-gallery-thumbnail-box slide"><ul class="slideContent" id="slide_' . $galleryID . '">';
     } else {
         if (!empty($video_gallery->galdesc)) {
             if ($options['cvg_description'] == 1) {
                 $out .= '<div class="clear"></div><div style="font-weight:bold;font-size:12px;">Description: ' . $video_gallery->galdesc . '</div>';
             }
         }
     }
     foreach ($videolist as $video) {
         $video_filename = $video->rel_path . $video_gallery_name . '/' . $video->filename;
         $new_target_filename = $video->alttext . '.png';
         $new_target_file = $video->rel_path . $video_gallery_name . '/thumbs/thumbs_' . $new_target_filename;
         $cool_video_gallery = new CoolVideoGallery();
         if ($slide_show) {
             $out .= '<li class="slideImage">';
             $out .= $cool_video_gallery->CVGVideo_Parse('[cvg-video videoId=' . $video->pid . ' /]');
             $out .= '<span class="bottom">Click to Play</span></li>';
         } else {
             $out .= '<div style="float:left;margin-right:10px;"><div class="video-gallery-thumbnail-box" style="padding:0px;" id="vide-file-' . $index . '">';
             $out .= '<div class="video-gallery-thumbnail">';
             $out .= $cool_video_gallery->CVGVideo_Parse('[cvg-video videoId=' . $video->pid . ' /]');
             $out .= '</div></div><div class="clear"></div>';
             if ($options['cvg_description'] == 1) {
                 $out .= '<div style="text-align:center;">' . $video->description . '</div>';
             }
             $out .= '</div>';
         }
         $index++;
     }
     if ($slide_show) {
         $out .= '<div class="clear slideImage"></div></ul></div><div class="clear"></div>';
         if ($options['cvg_description'] == 1) {
             $out .= '<div>Description: ' . $video_gallery->galdesc . '</div>';
         }
         $out .= '<div class="clear" style="min-height:10px;"></div>';
     } else {
         $out .= '<div class="clear"></div>';
     }
     return $out;
 }
示例#6
0
    /**
     * Build a gallery output
     * 
     * @param array $videolist
     * @param bool $galleryID - gallery ID
     * @param string $template (optional) name for a template file
     * @param int $videos (optional) number of videos per page
     * @return the content
     * @author Praveen Rajan
     */
    function videoCreateGallery($videolist, $galleryID = false, $slide_show = false, $place_holder = "main")
    {
        if (!is_array($videolist)) {
            $videolist = array($videolist);
        }
        $video_gallery = videoDB::find_gallery($galleryID);
        $video_gallery_name = $video_gallery->name;
        $index = 0;
        $out = '';
        $options = get_option('cvg_settings');
        $options_player = get_option('cvg_player_settings');
        if ($options_player['cvgplayer_autoplay'] == 1) {
            $autoplay = "true";
        } else {
            $autoplay = "false";
        }
        if ($options_player['cvgplayer_mute'] == 1) {
            $mute = "true";
        } else {
            $mute = "false";
        }
        if ($options_player['cvgplayer_share_option'] == 1) {
            $player_swf = "player-share.swf";
        } else {
            $player_swf = "player.swf";
        }
        $cool_video_gallery = new CoolVideoGallery();
        if ($slide_show) {
            $out .= ' <div class="video-gallery-thumbnail-box slide"><ul class="slideContent" id="slide_' . $galleryID . '_' . $place_holder . '">';
        } else {
            if (!empty($video_gallery->galdesc)) {
                if ($options['cvg_description'] == 1) {
                    $out .= '<div class="clear"></div><div><b>Description:</b> ' . $video_gallery->galdesc . '</div><br clear="all"/>';
                }
            }
        }
        foreach ($videolist as $video) {
            if ($slide_show) {
                $out .= '<li class="slideImage">';
                $out .= $cool_video_gallery->CVGVideo_Parse('[cvg-video videoId=' . $video->pid . ' mode="slide_show" placeholder="' . $place_holder . '" /]');
                $out .= '<span class="bottom">Click to Play</span></li>';
            } else {
                $out .= '<div style="float:left;margin-right:10px;"><div class="video-gallery-thumbnail-box" style="padding:0px;" id="vide-file-' . $index . '">';
                $out .= '<div class="video-gallery-thumbnail">';
                $out .= $cool_video_gallery->CVGVideo_Parse('[cvg-video videoId=' . $video->pid . ' mode="list_items" placeholder="' . $place_holder . '"/]');
                $out .= '</div></div>';
                $options = get_option('cvg_settings');
                $thumb_width = $options['cvg_preview_width'];
                $thumb_height = $options['cvg_preview_height'];
                $current_video_title = isset($video->video_title) ? $video->video_title : "";
                if ($options['cvg_description'] == 1) {
                    $out .= '<br clear="all"/><div style="text-align:center;width:' . $thumb_width . 'px;">' . stripcslashes($current_video_title) . '</div><div class="clear"></div></div>';
                } else {
                    $out .= '<div class="clear"></div></div>';
                }
            }
            $index++;
        }
        if ($slide_show) {
            $out .= '<div class="clear slideImage"></div></ul></div><div class="clear"></div>';
            if ($options['cvg_description'] == 1) {
                $out .= '<div>Description: ' . $video_gallery->galdesc . '</div>';
            }
            $out .= '<div class="clear" style="min-height:10px;"></div>';
            ?>
		 		<script type="text/javascript">
					jQuery(document).ready(function() {
		
						
						jQuery("a[rel=fancy_cvg_gallery_slide_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
]").fancybox({
							'titlePosition' : 'outside',
							'transitionIn' : 'none',
							'transitionOut' : 'none',
							'autoScale' : true,
							'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
								return '<span id="fancybox-title-over">Video ' + (currentIndex + 1) + ' / ' + currentArray.length + '</span><span class="fancybox-title-top">' + (title.length ?  jQuery.stripslashes(title) : '') + '</span>';
							},
							'content' : '<div id="video_fancy_cvg_slide_gallery_<?php 
            echo $galleryID . "_" . $place_holder;
            ?>
" style="overflow:hidden;"></div>',
	
							'autoDimensions' : false,
							'width' : parseInt("<?php 
            echo $options_player['cvgplayer_width'];
            ?>
"),
							'height' :  parseInt("<?php 
            echo $options_player['cvgplayer_height'];
            ?>
") + 6,
							'padding' : 10,
							'onComplete' : function() {
								
								
								jwplayer('video_fancy_cvg_slide_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
').setup({
									'file' : this.href,
									"autostart" : "<?php 
            echo $autoplay;
            ?>
",
									"controlbar" : "<?php 
            echo $options_player['cvgplayer_controlbar'];
            ?>
",
									"flashplayer" : "<?php 
            echo $cool_video_gallery->plugin_url . "cvg-player/" . $player_swf;
            ?>
",
									"volume" : "<?php 
            echo $options_player['cvgplayer_volume'];
            ?>
",
									"width" : "<?php 
            echo $options_player['cvgplayer_width'];
            ?>
",
									"height" : "<?php 
            echo $options_player['cvgplayer_height'];
            ?>
",
									"mute" : "<?php 
            echo $mute;
            ?>
",
									"stretching" : "<?php 
            echo $options_player['cvgplayer_stretching'];
            ?>
",
									"skin" : "<?php 
            echo $cool_video_gallery->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '-skin/' . $options_player['cvgplayer_skin'] . '.xml';
            ?>
"
																		
								});
								
								jwplayer('video_fancy_cvg_slide_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
').onComplete(function() {
									
									<?php 
            if ($options_player['cvgplayer_autoplay']) {
                ?>
											jQuery.fancybox.next();
										<?php 
            }
            ?>
								});
							}
						});
						
					});
	
				</script>
		 
		 <?php 
        } else {
            $out .= '<div class="clear"></div>';
            ?>
		 	<script type="text/javascript">
				jQuery(document).ready(function() {
						jQuery("a[rel=fancy_cvg_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
]").fancybox({
							'titlePosition' : 'outside',
							'transitionIn' : 'none',
							'transitionOut' : 'none',
							'autoDimensions' : false,
	
							'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
								return '<span id="fancybox-title-over">Video ' + (currentIndex + 1) + ' / ' + currentArray.length + '</span><span class="fancybox-title-top">' + (title.length ?  jQuery.stripslashes(title)  : '') + '</span>';
							},
							'content' : '<div id="video_fancy_cvg_items_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
" style="overflow:hidden;"></div>',
	
							'width' : parseInt("<?php 
            echo $options_player['cvgplayer_width'];
            ?>
") ,
							'height' :  parseInt("<?php 
            echo $options_player['cvgplayer_height'];
            ?>
") + 6 ,
							'padding' : 10,
							'onComplete' : function() {
								
								jwplayer('video_fancy_cvg_items_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
').setup({
									'file' : this.href,
									"autostart" : "<?php 
            echo $autoplay;
            ?>
",
									"controlbar" : "<?php 
            echo $options_player['cvgplayer_controlbar'];
            ?>
",
									"flashplayer" : "<?php 
            echo $cool_video_gallery->plugin_url . "cvg-player/" . $player_swf;
            ?>
",
									"volume" : "<?php 
            echo $options_player['cvgplayer_volume'];
            ?>
",
									"width" : "<?php 
            echo $options_player['cvgplayer_width'];
            ?>
",
									"height" : "<?php 
            echo $options_player['cvgplayer_height'];
            ?>
",
									"mute" : "<?php 
            echo $mute;
            ?>
",
									"stretching" : "<?php 
            echo $options_player['cvgplayer_stretching'];
            ?>
",
									
									"skin" : "<?php 
            echo $cool_video_gallery->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '-skin/' . $options_player['cvgplayer_skin'] . '.xml';
            ?>
"
								});
								
								jwplayer('video_fancy_cvg_items_gallery_<?php 
            echo $galleryID . '_' . $place_holder;
            ?>
').onComplete(function() {
									
									<?php 
            if ($options_player['cvgplayer_autoplay']) {
                ?>
											jQuery.fancybox.next();
										<?php 
            }
            ?>
									
								});
							}
						});
					});
	
				</script>
		 
		 <?php 
        }
        return $out;
    }