/** * 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; }
</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 != '') {
/** * 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; }