public function print_event_thumbnail($post_id, $item_size) { global $counter; //Get Post Meta Options $img_html = ''; $event_thumbnail = ''; $video_url_type = ''; $select_slider_type = ''; $event_detail_xml = get_post_meta($post_id, 'event_detail_xml', true); if ($event_detail_xml != '') { $cp_event_xml = new DOMDocument(); $cp_event_xml->loadXML($event_detail_xml); $event_thumbnail = find_xml_value($cp_event_xml->documentElement, 'event_thumbnail'); $video_url_type = find_xml_value($cp_event_xml->documentElement, 'video_url_type'); $select_slider_type = find_xml_value($cp_event_xml->documentElement, 'select_slider_type'); //Print Image if ($event_thumbnail == "Image" || empty($event_thumbnail)) { if (get_the_post_thumbnail($post_id, $item_size) != '') { $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . get_the_post_thumbnail($post_id, $item_size); $img_html = $img_html . '</div>'; } //echo '<div class="mask"><a href="'.get_permalink().'"#comments" class="anchor"><span> </span> <i class="fa fa-comment"></i></a><a href="'. get_permalink().'" class="anchor"> <i class="fa fa-link"></i></a></div>'; } else { if ($event_thumbnail == "Video") { //Print Video if ($video_url_type != '') { $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . '<div class="blog-thumbnail-video">'; //echo cp_get_width($item_size); if (cp_get_width($item_size) == '175') { $img_html = $img_html . get_video($video_url_type, cp_get_width($item_size), cp_get_height($item_size)); } else { $img_html = $img_html . get_video($video_url_type, '100%', cp_get_height($item_size)); } $img_html = $img_html . '</div></div>'; } } else { if ($event_thumbnail == "Slider") { //Print Slider $slider_xml = get_post_meta(intval($select_slider_type), 'cp-slider-xml', true); if ($slider_xml != '') { $slider_xml_dom = new DOMDocument(); $slider_xml_dom->loadXML($slider_xml); $slider_name = 'bxslider' . $counter . $post_id; //Included Anything Slider Script/Style wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true); wp_enqueue_script('cp-bx-slider'); wp_enqueue_style('cp-bx-slider', CP_PATH_URL . '/frontend/css/bxslider.css'); if (cp_get_width($item_size) == '175') { $img_html = "<style>#'" . $slider_name . "'{width:'" . cp_get_width($item_size) . "'px;height:'" . cp_get_height($item_size) . "'px;float:left;}</style>"; } else { $img_html = "<style>#'" . $slider_name . "'{width:100%;height:350px;float:left;}</style>"; } $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . print_bx_slider($slider_xml_dom->documentElement, $item_size, $slider_name); $img_html = $img_html . '</div>'; } } } } } return $img_html; }
function print_blog_thumbnail($post_id, $item_size) { global $counter; //Get Post Meta Options $img_html = ''; $thumbnail_types = ''; $video_url_type = ''; $select_slider_type = ''; $post_detail_xml = get_post_meta($post_id, 'post_detail_xml', true); if ($post_detail_xml != '') { $cp_post_xml = new DOMDocument(); $cp_post_xml->loadXML($post_detail_xml); $thumbnail_types = find_xml_value($cp_post_xml->documentElement, 'post_thumbnail'); $audio_url_type = find_xml_value($cp_post_xml->documentElement, 'audio_url_type'); $video_url_type = find_xml_value($cp_post_xml->documentElement, 'video_url_type'); $select_slider_type = find_xml_value($cp_post_xml->documentElement, 'select_slider_type'); //Print Image if ($thumbnail_types == "Image" || empty($thumbnail_types)) { if (get_the_post_thumbnail($post_id, $item_size) != '') { $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . get_the_post_thumbnail($post_id, $item_size); $img_html = $img_html . '</div>'; } //echo '<div class="mask"><a href="'.get_permalink().'"#comments" class="anchor"><span> </span> <i class="fa fa-comment"></i></a><a href="'. get_permalink().'" class="anchor"> <i class="fa fa-link"></i></a></div>'; } else { if ($thumbnail_types == "Video") { //Print Video if ($video_url_type != '') { $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . '<div class="blog-thumbnail-video">'; //echo cp_get_width($item_size); if (cp_get_width($item_size) == '175') { $img_html = $img_html . get_video($video_url_type, cp_get_width($item_size), cp_get_height($item_size)); } else { $img_html = $img_html . get_video($video_url_type, '100%', cp_get_height($item_size)); } $img_html = $img_html . '</div></div>'; } } else { if ($thumbnail_types == "Slider") { //Print Slider $slider_xml = get_post_meta(intval($select_slider_type), 'cp-slider-xml', true); if ($slider_xml != '') { $slider_xml_dom = new DOMDocument(); $slider_xml_dom->loadXML($slider_xml); $slider_name = 'bxslider' . $counter . $post_id; //Included Anything Slider Script/Style wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true); wp_enqueue_script('cp-bx-slider'); wp_enqueue_style('cp-bx-slider', CP_PATH_URL . '/frontend/css/bxslider.css'); //Inline Style for Slider Width if (cp_get_width($item_size) == '175') { $img_html = "<style>#'" . $slider_name . "'{width:'" . cp_get_width($item_size) . "'px;height:'" . cp_get_height($item_size) . "'px;float:left;}</style>"; } else { $img_html = "<style>#'" . $slider_name . "'{width:100%;height:350px;float:left;}</style>"; } $img_html = '<div class="post_featured_image thumbnail_image">'; $img_html = $img_html . print_bx_slider($slider_xml_dom->documentElement, $item_size, $slider_name); $img_html = $img_html . '</div>'; } } else { if ($thumbnail_types == "Audio") { $counter_track = $counter . $post_id; if ($audio_url_type != '') { //Jplayer Scripts Classing After the Function Call wp_register_script('cp-jplayer', CP_PATH_URL . '/frontend/js/jquery.jplayer.min.js', false, '1.0', true); wp_enqueue_script('cp-jplayer'); //Jplayer Music Started $img_html .= '<div class="audio_player song-list"> <figure class="main-gallery-slider default-player-style"> <div id="jp_container_' . $counter_track . '" class="jp-video jp-video-270p"> <div class="jp-type-playlist"> <div id="jquery_jplayer_' . $counter_track . '" class="jp-jplayer"></div> <div class="jp-gui"> <div class="jp-video-play"> <a href="javascript:;" class="jp-video-play-icon" tabindex="1"><?php __("play","crunchpress");?></a> </div> <div class="jp-interface"> <div class="jp-controls-holder"> <ul class="jp-controls"> <li><a href="javascript:;" class="jp-previous" tabindex="1"></a></li> <li><a href="javascript:;" class="jp-play" tabindex="1"></a></li> <li><a href="javascript:;" class="jp-pause" tabindex="1"></a></li> <li><a href="javascript:;" class="jp-next" tabindex="1"></a></li> </ul> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div> </div> </div> <ul class="volume-control"> <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute"></a></li> <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute"></a></li> <li class="jp-volume-bar"><div class="jp-volume-bar-value"></div></li> <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume"></a></li> </ul> <ul class="jp-toggles"> <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat"></a></li> <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off"></a></li> </ul> </div> <div class="jp-title"> <ul> <li></li> </ul> </div> </div> </div> <div class="jp-playlist"> <ul> <!-- The method Playlist.displayPlaylist() uses this unordered list --> <li></li> </ul> </div> <div class="jp-no-solution"> <span><?php __("Update Required","crunchpress");?></span> ' . __("To play the media you will need to either update your browser to a recent version or update your", "crunchpress") . ' ' . __("Flash plugin", "crunchpress") . '. </div> </div> </div> </figure> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function($){ var stream = { title:"' . get_the_title() . '", mp3:"' . $audio_url_type . '", poster:"http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png", }, ready = false; $("#jquery_jplayer_' . $counter_track . '").jPlayer({ ready: function (event) { ready = true; $(this).jPlayer("setMedia", stream); }, pause: function() { $(this).jPlayer("clearMedia"); }, error: function(event) { if(ready && event.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET) { // Setup the media stream again and play it. $(this).jPlayer("setMedia", stream).jPlayer("play"); } }, cssSelectorAncestor: "#jp_container_' . $counter_track . '", swfPath: "' . CP_PATH_URL . '/frontend/js/Jplayer.swf", supplied: "mp3", preload: "none", wmode: "window", keyEnabled: true }); }); //]]> </script> </div> '; } // No MP3 Song } } } } } return $img_html; }