예제 #1
0
 /**
  * Function to display
  * recent ,feature ,category, popular,
  * random, user and search pages
  *
  * @parem   $type
  * @parem   $arguments
  */
 function video_more_pages($type, $arguments)
 {
     $TypeOFvideos = $CountOFVideos = $typename = $type_name = $morePage = $dataLimit = $div = $pagenum = '';
     /** Check homeVideo function is exists */
     if (!function_exists('homeVideo')) {
         if ($type == 'search' || $type == 'categories' || $type == '') {
             /** Get details for serach and videomore page */
             $this->getSearchCategoryVideos($type);
         } else {
             /** Get details for other more pages */
             $moreResult = $this->getTypeOfVideos($type, $arguments);
         }
         if (!empty($moreResult) && isset($moreResult)) {
             $TypeOFvideos = $moreResult[0];
             $CountOFVideos = $moreResult[1];
             $typename = $moreResult[2];
             $type_name = $moreResult[3];
             $morePage = $moreResult[4];
             $dataLimit = $moreResult[5];
         }
         if (isset($arguments['cols'])) {
             $colF = $arguments['cols'];
         } else {
             $colF = $this->_colF;
         }
         $div = '<div class="video_wrapper" id="' . $type_name . '_video"> <style type="text/css"> .video-block {  margin-left:' . $this->_settingsData->gutterspace . 'px !important; } </style>';
         /** Call function to display more video page title */
         $div .= $this->morePageTitle($type_name, $typename);
         if (!empty($TypeOFvideos)) {
             $userId = get_current_user_id();
             $watchLaterVideoIds = getWatchLaterVideoIds($userId, $this->watchDetailsTable);
             $pagenum = absint($this->_pagenum) ? absint($this->_pagenum) : 1;
             $videolist = 0;
             foreach ($TypeOFvideos as $video) {
                 $vidF[$videolist] = $video->vid;
                 $nameF[$videolist] = $video->name;
                 $hitcount[$videolist] = $video->hitcount;
                 $ratecount[$videolist] = $video->ratecount;
                 $rate[$videolist] = $video->rate;
                 $duration[$videolist] = $video->duration;
                 $file_type = $video->file_type;
                 $guid[$videolist] = get_video_permalink($video->slug);
                 $imageFea[$videolist] = getImagesValue($video->image, $file_type, $video->amazon_buckets, '');
                 if (!empty($this->_playid)) {
                     $fetched[$videolist] = $video->playlist_name;
                     $fetched_pslug[$videolist] = $video->playlist_slugname;
                     $playlist_id[$videolist] = absint($this->_playid);
                 } else {
                     $getPlaylist = $this->_wpdb->get_row('SELECT playlist_id FROM ' . $this->_wpdb->prefix . 'hdflvvideoshare_med2play WHERE media_id="' . intval($vidF[$videolist]) . '"');
                     if (isset($getPlaylist->playlist_id)) {
                         $playlist_id[$videolist] = $getPlaylist->playlist_id;
                         $fetPlay[$videolist] = playlistDetails($playlist_id[$videolist]);
                         $fetched[$videolist] = $fetPlay[$videolist]->playlist_name;
                         $fetched_pslug[$videolist] = $fetPlay[$videolist]->playlist_slugname;
                     }
                 }
                 $videolist++;
             }
             $div .= '<div> <ul class="video-block-container">';
             /** Display thumbnails starts */
             for ($videolist = 0; $videolist < count($TypeOFvideos); $videolist++) {
                 $videoId = $TypeOFvideos[$videolist]->vid;
                 $playlistImg = APPTHA_VGALLERY_BASEURL . 'images/playlist.png';
                 if (in_array($videoId, $watchLaterVideoIds)) {
                     $watchLaterImg = APPTHA_VGALLERY_BASEURL . 'images/accepted.png';
                     $watchLaterTitle = 'Added to Watch Later';
                     $clickEvent = '';
                 } else {
                     $watchLaterImg = APPTHA_VGALLERY_BASEURL . 'images/watchlater2.png';
                     $watchLaterTitle = 'Add to Watch Later';
                     $clickEvent = 'onclick="watchLater(' . $videoId . ',this)"';
                 }
                 if ($videolist % $colF == 0 && $videolist != 0) {
                     $div .= '</ul><div class="clear"></div><ul class="video-block-container">';
                 }
                 /** Display thumb and duration */
                 $div .= '<li class="video-block"> <div  class="video-thumbimg"><a href="' . $guid[$videolist] . '" title="' . $nameF[$videolist] . '"><img src="' . $imageFea[$videolist] . '" alt="' . $nameF[$videolist] . '" class="imgHome" title="' . $nameF[$videolist] . '" /></a>';
                 if (!empty($duration[$videolist]) && $duration[$videolist] != '0:00') {
                     $div .= '<span class="video_duration">' . $duration[$videolist] . '</span>';
                 }
                 $div .= '<span class="watchlaterIcon" ' . $clickEvent . ' ><img class="watchlaterImg" style="width:24px !important;height:24px !important;" src="' . $watchLaterImg . '" title="' . $watchLaterTitle . '"></span>
               	<span class="playlistIcon" data-vid = ' . $videoId . '><img class="playlistIconImg" style="width:24px !important;height:24px !important;" src="' . $playlistImg . '" title="Add to playlist"></span>';
                 /** Display duration ends and video title starts */
                 $div .= '</div> <div class="vid_info"><a href="' . $guid[$videolist] . '" title="' . $nameF[$videolist] . '" class="videoHname"><span>' . limitTitle($nameF[$videolist]) . '</span></a>';
                 /** Display playlist name starts here */
                 if (!empty($fetched[$videolist]) && $this->_settingsData->categorydisplay == 1) {
                     $playlist_url = get_playlist_permalink($this->_mPageid, $playlist_id[$videolist], $fetched_pslug[$videolist]);
                     $div .= '<a  class="playlistName"   href="' . $playlist_url . '"><span>' . $fetched[$videolist] . '</span></a>';
                 }
                 /** Rating starts here */
                 if ($this->_settingsData->ratingscontrol == 1) {
                     $div .= getRatingValue($rate[$videolist], $ratecount[$videolist], '');
                 }
                 /** Views starts here */
                 if ($this->_settingsData->view_visible == 1) {
                     $div .= displayViews($hitcount[$videolist]);
                 }
                 $div .= '</div></li>';
                 /** Foreah ends */
             }
             $div .= '</ul> </div> <div class="clear"></div>';
         } else {
             if ($type != 'search' && $type != 'categories' && $type != '') {
                 if ($typename == 'Category') {
                     /** Display no videos link for category page */
                     $div .= __('No', APPTHA_VGALLERY) . '&nbsp;' . __('Videos', APPTHA_VGALLERY) . '&nbsp;' . __('Under&nbsp;this&nbsp;Category', APPTHA_VGALLERY);
                 } else {
                     /** Display no videos link for other more pages */
                     $div .= __('No', APPTHA_VGALLERY) . '&nbsp;' . $typename . '&nbsp;' . __('Videos', APPTHA_VGALLERY);
                 }
             }
         }
         $div .= '</div>';
         /** Pagination starts
          * Call helper function to get pagination values for more pages */
         if ($dataLimit != 0) {
             $div .= paginateLinks($CountOFVideos, $dataLimit, $pagenum, '', '');
         }
         return $div;
     }
 }
예제 #2
0
esc_attr_e('Unpublish', APPTHA_VGALLERY);
?>
</option> 
                  <option value="videofeatured"><?php 
esc_attr_e('Add to  Feature', APPTHA_VGALLERY);
?>
</option> 
                  <option value="videounfeatured"><?php 
esc_attr_e('Remove from Featured', APPTHA_VGALLERY);
?>
</option> 
              </select> 
              <input type="submit" name="videoapply" class="button-secondary action" value="<?php 
esc_attr_e('Apply', APPTHA_VGALLERY);
?>
"> 
          </div>
<?php 
/**
 * Display footer multi option ends
 * Footer pagination drop down for all videos page
 */
echo paginateLinks($total, $limit, $pagenum, 'admin', $arr_params);
?>
      </div>
    </form>
<?php 
/** Display videos page ends */
?>
</div>
예제 #3
0
?>
             </table>
                   
             <div style="clear: both;"></div>
             <!-- Footer filter options Starts -->
             <div class="alignleft actions  <?php 
echo VIDEOGALLERY_USER_PLAYLIST;
?>
" style="margin-top:10px;">
                 <?php 
/** Call function to display filter option in bottom   */
?>
             </div>
       <?php 
/** Footer pagination drop down  */
echo paginateLinks($total, $playlistLimit, $playlistPagenum, 'admin', '');
/** Footer filter options Ends */
?>
          </form> 
          <?php 
/** Playlist grid form Ends */
?>
        </div> 
    </div>
    <?php 
/**  Playlist add/ grid section Starts */
?>
 
</div>
<?php 
/** Playlist admin page Ends */
예제 #4
0
                <?php 
/** Footer heading Ends */
?>
             </table>
                   
             <div style="clear: both;"></div>
             <!-- Footer filter options Starts -->
             <div class="alignleft actions" style="margin-top:10px;">
                 <?php 
/** Call function to display filter option in bottom   */
echo adminFilterDisplay('playlist', 'down');
?>
             </div>
       <?php 
/** Footer pagination drop down  */
echo paginateLinks($total, $limit, $pagenum, 'admin', '');
/** Footer filter options Ends */
?>
          </form> 
          <?php 
/** Playlist grid form Ends */
?>
        </div> 
    </div>
    <?php 
/**  Playlist add/ grid section Starts */
?>
 
</div>
<?php 
/** Playlist admin page Ends */
예제 #5
0
 /**
  * Function for get the video from category based.
  *
  * @global type $wpdb
  * @param type $CountOFVideos
  * @param type $TypeOFvideos
  * @param type $pagenum
  * @param type $dataLimit
  * @param type $category_page
  * @return $category_videos
  */
 function categorylist($CountOFVideos, $TypeOFvideos, $pagenum, $dataLimit, $category_page, $thumImageorder)
 {
     global $wpdb;
     $userId = get_current_user_id();
     $watchLaterVideoIds = getWatchLaterVideoIds($userId, $this->watchDetailsTable);
     $div = '';
     /** Calculating page number for home page category videos */
     $pagenum = isset($pagenum) ? absint($pagenum) : 1;
     $div .= '<style scoped> .video-block { margin-left:' . $this->_settingsData->gutterspace . 'px !important;float:left;} </style>';
     foreach ($TypeOFvideos as $catList) {
         /** Get video details for particular playlist */
         $playLists = getCatVideos($catList->pid, $dataLimit, $thumImageorder);
         /** Get count of home page category videos */
         $playlistCount = count($playLists);
         /** Get count of video assigned in this category. */
         $category_video = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'hdflvvideoshare_med2play as m LEFT JOIN ' . $wpdb->prefix . 'hdflvvideoshare_playlist as p on m.playlist_id = p.pid
                                               WHERE m.playlist_id=' . intval($catList->pid) . ' AND p.is_publish=1');
         /** Get count of videos for category */
         $video_count = count($category_video);
         /** Display home page category title */
         $div .= '<div class="titleouter"> <h4 class="more_title">' . $catList->playlist_name . '</h4></div>';
         if (!empty($playlistCount)) {
             $inc = 1;
             /** Video container starts */
             $div .= '<ul class="video-block-container">';
             /** Dsplay videos for category */
             foreach ($playLists as $playList) {
                 $this->watchLaterHelper($playList, $watchLaterVideoIds);
                 /** Display home cat thumb image */
                 $div .= '<li class="video-block"><div class="video-thumbimg"><a href="' . $this->guid . '"><img src="' . $this->imageFea . '" alt="" class="imgHome" title=""></a>';
                 /** Display video duration */
                 if ($this->duration) {
                     $div .= '<span class="video_duration">' . $this->duration . '</span>';
                 }
                 $div .= '<span class="watchlaterIcon" ' . $this->clickEvent . ' ><img class="watchlaterImg" style="width:24px !important;height:24px !important;" src="' . $this->watchLaterImg . '" title="' . $this->watchLaterTitle . '"></span>
     		<span class="playlistIcon" data-vid = ' . $this->videoId . '><img class="playlistIconImg" style="width:24px !important;height:24px !important;" src="' . $this->playlistImg . '" title="Add to playlist"></span>';
                 /** Display home cat video name */
                 $div .= '</div><div class="vid_info"><a href="' . $this->guid . '" title="' . $playList->name . '" class="videoHname"><span>' . limitTitle($playList->name) . '</span></a>';
                 /** Rating for home category video */
                 if ($this->_settingsData->ratingscontrol == 1) {
                     $div .= getRatingValue($playList->rate, $playList->ratecount, '');
                 }
                 /** Show views count for home page category videos */
                 if ($this->_settingsData->view_visible == 1) {
                     $div .= displayViews($playList->hitcount);
                 }
                 $div .= '</div></li>';
                 if ($inc % $this->_colCat == 0 && $inc != 0) {
                     /** Column count */
                     $div .= '</ul><div class="clear"></div><ul class="video-block-container">';
                 }
                 $inc++;
             }
             $div .= '</ul>';
             /** Video category thumb based on gallery setting rows, cols */
             $colF = $this->_settingsData->colCat;
             $rowF = $this->_settingsData->rowCat;
             $CatLimit = $colF * $rowF;
             if ($video_count > $CatLimit) {
                 /** Get more videos permalink for home cat videos */
                 $more_playlist_link = get_playlist_permalink($this->_mPageid, $catList->pid, $catList->playlist_slugname);
                 /** Display more videos link for home categories */
                 $div .= '<a class="video-more" href="' . $more_playlist_link . '">' . __('More&nbsp;Videos', APPTHA_VGALLERY) . '</a>';
             } else {
                 $div .= '<div align="clear"> </div>';
             }
         } else {
             /** If there is no video for category */
             $div .= '<div class="titleouter">' . __('No Videos for this Category', APPTHA_VGALLERY) . '</div>';
         }
     }
     $div .= '<div class="clear"></div>';
     /** Check tha page is category page */
     if ($category_page != 0) {
         /** Pagination starts
          * Call helper function to get pagination values for category videos */
         $div .= paginateLinks($CountOFVideos, $category_page, $pagenum, '', '');
     }
     return $div;
 }
예제 #6
0
 /**
  * Function to display search results
  *
  * @param unknown $video_search
  * @param unknown $CountOfSearchVideos
  * @param unknown $TypeOfSearchvideos
  * @param unknown $pagenum
  * @param unknown $dataLimit
  * @return string
  */
 function searchlist($video_search, $CountOfSearchVideos, $TypeOfSearchvideos, $pagenum, $dataLimit)
 {
     $div = '';
     $userId = get_current_user_id();
     $watchLaterVideoIds = getWatchLaterVideoIds($userId, $this->watchDetailsTable);
     /**
      * Calculating page number
      * for search videos
      */
     $pagenum = isset($pagenum) ? absint($pagenum) : 1;
     $div .= '<div class="video_wrapper" id="video_search_result"><h3 class="entry-title">' . __('Search Results', APPTHA_VGALLERY) . ' - ' . $video_search . '</h3>';
     $div .= '<style> .video-block { margin-left:' . $this->_settingsData->gutterspace . 'px !important; } </style>';
     /** Fetch videos based on search  */
     if (!empty($TypeOfSearchvideos)) {
         $inc = 0;
         $div .= '<ul class="video-block-container">';
         foreach ($TypeOfSearchvideos as $playList) {
             $this->watchLaterHelper($playList, $watchLaterVideoIds);
             if ($inc % $this->_colF == 0 && $inc != 0) {
                 /** Column count for search page */
                 $div .= '</ul><div class="clear"></div><ul class="video-block-container">';
             }
             /** Display search videos
              * thumb and duration */
             $div .= '<li class="video-block"><div class="video-thumbimg"><a href="' . $this->guid . '" title="' . $playList->name . '"><img src="' . $this->imageFea . '" alt="" class="imgHome" title="" /></a>';
             if (!empty($this->duration) && $this->duration != '0:00') {
                 $div .= '<span class="video_duration">' . $this->duration . '</span>';
             }
             $div .= '<span class="watchlaterIcon" ' . $this->clickEvent . ' ><img class="watchlaterImg" style="width:24px !important;height:24px !important;" src="' . $this->watchLaterImg . '" title="' . $this->watchLaterTitle . '"></span>
     		   <span class="playlistIcon" data-vid = ' . $this->videoId . '><img class="playlistIconImg" style="width:24px !important;height:24px !important;" src="' . $this->playlistImg . '" title="Add to playlist"></span>';
             /** Display video title, playlist name and link  */
             $div .= '</div><div class="vid_info"><a href="' . $this->guid . '" class="videoHname" title="' . $playList->name . '" >' . limitTitle($playList->name) . '</a>';
             if (!empty($playList->playlist_name)) {
                 $playlist_url = get_playlist_permalink($this->_mPageid, $playList->pid, $playList->playlist_slugname);
                 $div .= '<a class="playlistName" href="' . $playlist_url . '">' . $playList->playlist_name . '</a>';
             }
             /** Rating starts here
              * for search videos */
             if ($this->_settingsData->ratingscontrol == 1) {
                 $div .= getRatingValue($playList->rate, $playList->ratecount, '');
             }
             if ($this->_settingsData->view_visible == 1) {
                 /** Views starts here
                  * for search videos */
                 $div .= displayViews($playList->hitcount);
             }
             $div .= '</div></li>';
             $inc++;
         }
         $div .= '</ul>';
     } else {
         /** If there is no video
          * for search result */
         $div .= '<div>' . __('No&nbsp;Videos&nbsp;Found', APPTHA_VGALLERY) . '</div>';
     }
     $div .= '</div> <div class="clear"></div>';
     /** Pagination starts
      * Call helper function
      * to get pagination values */
     if ($dataLimit != 0) {
         $div .= paginateLinks($CountOfSearchVideos, $dataLimit, $pagenum, '', '');
     }
     echo $div;
     /** Search result function ends  */
 }