Exemplo n.º 1
0
    $end_page = $start_page + $per_page;
    $total_num_pages = count(videoDB::get_gallery($gid));
    $total_value = ceil($total_num_pages / $per_page);
    $defaults = array('base' => add_query_arg('paged', '%#%'), 'format' => '?paged=%#%', 'total' => $total_value, 'current' => $pagenum, 'show_all' => false, 'prev_next' => true, 'prev_text' => __('«'), 'next_text' => __('»'), 'end_size' => 1, 'mid_size' => 2, 'type' => 'plain', 'add_fragment' => '');
    $page_links = paginate_links($defaults);
    $gallery = videoDB::find_gallery($gid);
    $title = __('Gallery: ' . $gallery->name);
    if (!$gallery) {
        CvgCore::show_video_error(__('Gallery not found.', 'nggallery'));
    }
    if ($gallery) {
        // look for pagination
        if (!isset($_GET['paged']) || $_GET['paged'] < 1) {
            $_GET['paged'] = 1;
        }
        $videolist = videoDB::get_gallery($gid, 'sortorder', 'asc', $per_page, $start_page);
        $act_author_user = get_userdata((int) $gallery->author);
        ?>
			<script type="text/javascript"> 

				jQuery(document).ready(function(){
					jQuery('#gallerydiv').addClass('closed');
					jQuery('#gallery_open').click(function(){
						if(jQuery('#gallerydiv').attr('class') == 'postbox closed') 
							jQuery('#gallerydiv').removeClass('closed');
						else	
							jQuery('#gallerydiv').addClass('closed');
					} );
				});	
	
				// Function is to check all
Exemplo n.º 2
0
		</div> 
		<?php 
    CvgCore::show_video_error(__('Please select a gallery to sort videos'));
    ?>
	</div> 
<?php 
} else {
    $options = get_option('cvg_settings');
    $gallery = videoDB::find_gallery($gid);
    $title = __('Gallery to sort: ' . $gallery->name);
    if (!$gallery) {
        CvgCore::show_video_error(__('Gallery not found.', 'nggallery'));
    }
    if ($gallery) {
        // look for pagination
        $videolist = videoDB::get_gallery($gid, $orderBy, 'asc', $per_page, $start_page);
        $act_author_user = get_userdata((int) $gallery->author);
        $base_url = admin_url('admin.php?page=cvg-gallery-sort&gid=' . $_GET['gid'] . '&order=');
        ?>
						
			<div class="wrap">
				<div class="icon32" id="icon-video"><br></div>
				<h2><?php 
        echo esc_html($title);
        ?>
</h2>
				<div class="clear" style="min-height:10px;"></div>
				
				<form id="updatevideos" method="POST" action="<?php 
        echo admin_url('admin.php?page=cvg-gallery-sort&gid=' . $_GET['gid']);
        ?>
Exemplo n.º 3
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;
 }
Exemplo n.º 4
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)
 {
     $galleryID = (int) $galleryID;
     $limit_by = $limit > 0 ? $limit : 0;
     // get gallery values
     $videolist = videoDB::get_gallery($galleryID, 'sortorder', 'ASC', $limit_by);
     $outer = '';
     if (!$videolist) {
         return __('[Gallery not found]');
     }
     // get all picture with this galleryid
     if (is_array($videolist)) {
         $outer .= '<div class="video-gallery-thumbnail-box-outer" id="video-' . $galleryID . '">';
         $outer .= CvgCore::videoCreateGallery($videolist, $galleryID, $slide_show);
         $outer .= '</div>';
     }
     return $outer;
 }
Exemplo n.º 5
0
			<br class="clear" />
		</div> 
		<?php 
    CvgCore::show_video_error(__('Please select a gallery to sort videos'));
    ?>
	</div> 
<?php 
} else {
    $options = get_option('cvg_settings');
    $gallery = videoDB::find_gallery($gid);
    $title = __('Gallery to sort: ' . $gallery->name);
    if (!$gallery) {
        CvgCore::show_video_error(__('Gallery not found.', 'nggallery'));
    }
    if ($gallery) {
        $videolist = videoDB::get_gallery($gid, true, $orderBy, 'asc');
        $act_author_user = get_userdata((int) $gallery->author);
        $base_url = admin_url('admin.php?page=cvg-gallery-manage&gid=' . $_GET['gid'] . '&order=');
        ?>
						
			<div class="wrap">
				<div class="icon32" id="icon-video"><br></div>
				<h2><?php 
        echo esc_html($title);
        ?>
</h2>
				<div class="clear" style="min-height:10px;"></div>
				
				<form id="updatevideos" method="POST" action="<?php 
        echo $base_url;
        ?>