/**
  * Function to render gallery.
  * 
  * @param $matches - input arguments.
  * @return player code.
  * @author Praveen Rajan
  */
 function CVGVideo_Gallery($matches)
 {
     global $post, $wpdb;
     $output = '';
     $thumbexists = false;
     $setathumb = false;
     preg_match_all('/([\\.\\w]*)=(.*?) /i', $matches[1], $attributes);
     $arguments = array();
     $arguments = CoolVideoGallery::splitargs($matches[1]);
     $gallery_id = $arguments['galleryId'];
     if (isset($arguments['limit'])) {
         $limit = $arguments['limit'];
     } else {
         $limit = 0;
     }
     if (isset($arguments['mode'])) {
         $mode = $arguments['mode'];
         if ($mode == __('playlist')) {
             $this->CVG_render_playlist($gallery_id);
             return;
         }
         if ($mode == __('slideshow')) {
             $slide = true;
         } elseif ($mode == __('showcase')) {
             $slide = false;
         }
     } else {
         $slide = false;
     }
     $output = CvgCore::videoShowGallery($gallery_id, $slide, $limit);
     return $output;
 }
Example #2
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('') : $instance['title'], $instance, $this->id_base);
        if (!($number = (int) $instance['number'])) {
            $number = 5;
        } else {
            if ($number < 1) {
                $number = 1;
            }
        }
        $cvg_core = new CvgCore();
        $out = $cvg_core->videoShowGallery($instance['galleryid'], true, $number, "sidebar");
        if (!empty($out)) {
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<div class="cvg_slideshow widget">
			<?php 
            echo $out;
            ?>
		</div>
		<?php 
            echo $after_widget;
        }
    }