Example #1
0
}
//Section to upload preview imaage for video
if (isset($_POST['TB_previewimage_single']) && !empty($_POST['TB_previewimage_single']) && is_array($_FILES['preview_image'])) {
    if (trim($_FILES['preview_image']['error'][0]) == 4) {
        CvgCore::show_video_error(__('No preview images uploaded'));
    } else {
        CvgCore::upload_preview();
    }
    CvgCore::xml_playlist($_GET['gid']);
}
//Section to scan videos from folder and add to gallery
if (isset($_POST['scanVideos'])) {
    if (empty($_POST['galleryId'])) {
        CvgCore::show_video_error(__('No Gallery selected'));
    } else {
        CvgCore::scan_upload_videos($_POST['galleryId']);
    }
    CvgCore::xml_playlist($_GET['gid']);
}
$gid = $_GET['gid'];
//Section if no gallery is selected.
if (!isset($gid)) {
    ?>
	<div class="wrap">
		<div class="icon32" id="icon-video"><br></div>
		<h2>Gallery Details</h2>
		<div class="clear"></div>
		<div class="versions">
	    	<p>
				Choose your gallery at <a class="button rbutton" href="<?php 
    echo admin_url('admin.php?page=cvg-gallery-manage');
Example #2
0
 /**
  * videoShowGallery() - return a gallery  
  * 
  * @param int $galleryID
  * @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 videoShowGallery($galleryID, $slide_show = false, $limit = 0, $place_holder = "main")
 {
     $galleryID = (int) $galleryID;
     CvgCore::scan_upload_videos($galleryID, false);
     $limit_by = $limit > 0 ? $limit : 0;
     // get gallery values
     $videolist = videoDB::get_gallery($galleryID, false, 'sortorder', 'ASC', $limit_by);
     $outer = '';
     $options = get_option('cvg_settings');
     if (isset($options['cvg_random_video']) && $options['cvg_random_video'] == 1) {
         shuffle($videolist);
     }
     if (!$videolist) {
         return __('[Gallery not found]');
     }
     if (is_array($videolist)) {
         $outer .= '<div class="video-gallery-thumbnail-box-outer" id="video-' . $galleryID . '">';
         $outer .= CvgCore::videoCreateGallery($videolist, $galleryID, $slide_show, $place_holder);
         $outer .= '</div>';
     }
     return $outer;
 }