Esempio n. 1
0
/**
 * Create content for a custom Meta Box
 *
 * @param array $meta_box Meta box input data
 */
function easmedia_create_meta_box($post, $meta_box)
{
    if (EMG_WP_VER == "l35") {
        $uploaderclass = 'thickbox button add_media';
        $emghref = "media-upload.php?type=image&TB_iframe=1";
        $isdatacnt = ' data-editor="content" ';
        $emgepver = EMG_WP_VER;
    } else {
        $uploaderclass = 'button';
        $emghref = "#";
        $isdatacnt = '';
        $emgepver = EMG_WP_VER;
    }
    if (!is_array($meta_box)) {
        return false;
    }
    if (isset($meta_box['description']) && $meta_box['description'] != '') {
        echo '<p>' . $meta_box['description'] . '</p>';
    }
    wp_nonce_field(basename(__FILE__), 'easmedia_meta_box_nonce');
    echo '<table class="form-table easmedia-metabox-table">';
    foreach ($meta_box['fields'] as $field) {
        // Get current post meta data
        $meta = get_post_meta($post->ID, $field['id'], true);
        echo '<tr class="' . $field['id'] . '"><th><label for="' . $field['id'] . '"><strong>' . $field['name'] . ' ' . ($field['defflimit'] == '1' ? '<br>(Default limit : ' . easy_get_option('easymedia_img_size_limit') . 'px)' : '') . '</strong>
			  <span>' . $field['desc'] . '</span></label></th>';
        switch ($field['type']) {
            case 'text':
                echo '<td><input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" /></td>';
                break;
            case 'video':
                echo '				<div id="videofrmt" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Sample video format</div>
				<div class="messivideo" data-yvid="https://www.youtube.com/embed/htxwZw_aPF0?rel=0" style="margin-bottom:8px;">Video Tutorial</div><td>				
				
				<input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" />
<div style="color:red; display:none;" id="emgvideopreview"></div>				
<div class="videobox" id="" style="display:none;">
<span class="roll" ></span>
<img id="videothumbnailprv" style="display:none;" src="http://placehold.it/300x190" height="190" width="300"/></div>
				</td>';
                break;
            case 'images':
                $dsplynone = 'display:none;';
                if (get_post_meta($post->ID, 'easmedia_metabox_img', true)) {
                    $attid = wp_get_attachment_image_src(emg_get_attachment_id_from_src(get_post_meta($post->ID, 'easmedia_metabox_img', true)), 'full');
                    $curimgpth = easymedia_imgresize($attid[0], '210', 'on', $attid[1], $attid[2]);
                    $curimgpth = explode(",", $curimgpth);
                    $curimgpth[0] > '10' ? $curimgpth[0] = $curimgpth[0] : ($curimgpth[0] = '');
                    $curimgpth[0] > '10' ? $dsplynone = '' : ($dsplynone = 'display:none;');
                } else {
                    $dsplynone = 'display:none;';
                    $curimgpth[0] = '';
                    $curimgpth[1] = '';
                    $curimgpth[2] = '';
                }
                echo '<div class="messivideo" data-yvid="https://www.youtube.com/embed/dXFBNY5t6E8?rel=0" style="margin-bottom:8px;">Video Tutorial</div><td id="imgupld"><input id="upload_image" type="text" name="easmedia_meta[' . $field['id'] . ']" value="' . ($meta ? $meta : $field['std']) . '" style="margin-bottom:5px;"/><div style="color:red;" id="notifynovalidimg"></div>
<div class="addmed"><a rel="image-' . $emgepver . '" class="' . $uploaderclass . '" title="Add Media" ' . $isdatacnt . ' href="' . $emghref . '"><span class="emg-media-buttons-icon"></span>Add Media</a>
<a onClick="return false;" style="' . $dsplynone . ';" class="deleteimage button" title="Delete Image" href="#"><span class="emg-media-buttons-icon-del"></span>Delete Image</a></div><div style="' . $dsplynone . ' width:' . $curimgpth[1] . 'px; height:' . $curimgpth[2] . 'px" id="imgpreviewbox" class="imgpreviewboxc">
<img id="imgthumbnailprv" src="' . $curimgpth[0] . '"/></div>
</td>';
                break;
            case 'audio':
                $adsplynone = 'display:none;';
                $curaudiopth = get_post_meta($post->ID, 'easmedia_metabox_media_audio', true);
                $curaudiopth != '' ? $adsplynone = '' : ($adsplynone = 'display:none;');
                if ($curaudiopth != '') {
                    echo '
<script type="text/javascript">
    jQuery(function () {
		var thisaudiourl = "' . $curaudiopth . '";
    IsValidAuUrl1(thisaudiourl);
    });
    </script>	
';
                }
                echo '<div class="messivideo" data-yvid="https://www.youtube.com/embed/Bsn-CB5Hpbw?rel=0" style="margin-bottom:8px;">Video Tutorial</div><td id="audioupld"><input id="upload_audio" type="text" name="easmedia_meta[' . $field['id'] . ']" value="' . ($meta ? $meta : $field['std']) . '" style="margin-bottom:5px;"/><div style="color:red;" id="notifynovalidaudio"></div><div class="addmed"><a rel="audio-' . $emgepver . '" class="' . $uploaderclass . '" title="Add Media" ' . $isdatacnt . ' href="' . $emghref . '"><span class="emg-media-buttons-icon"></span>Add Media</a>
<a onClick="return false;" style="' . $adsplynone . ';" class="deleteaudio button" title="Delete Audio" href="#"><span class="emg-media-buttons-icon-del"></span>Delete Audio</a></div>

<div style="' . $adsplynone . ';" id="audioprev" class="vidpreviewboxc">
	<div id="jquery_jplayer_1" class="jp-jplayer"></div>
		<div id="jp_container_1" class="jp-audio">
			<div class="jp-type-single">
				<div class="jp-gui jp-interface">
					<ul class="jp-controls">
						<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
						<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
						<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
						<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
						<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
						<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
					</ul>
					<div class="jp-progress">
						<div class="jp-seek-bar">
							<div class="jp-play-bar"></div>
						</div>
					</div>
					<div class="jp-volume-bar">
						<div class="jp-volume-bar-value"></div>
					</div>
					<div class="jp-current-time"></div>
					<div class="jp-duration"></div>
				</div>
				<div class="jp-no-solution">
					<span>Update Required</span>
					To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
				</div>
			</div>
		</div>

</div>
</td>';
                break;
            case 'select':
                echo '<div class="emginfobox"><span class="emg_blink">Upgrade to PRO</span> and you can select <a href="http://goo.gl/PLlJwS" target="_blank">Photo Albums</a>, <a href="http://goo.gl/bZ53YR" target="_blank">Grid Gallery</a>, <a href="http://goo.gl/JAvlsq" target="_blank">Filterable Media</a>, HTML5 Video/Audio, Google Maps/Street View, embed from Soundcloud or Reverbnation and also Link to specific URL. You can learn more and see version comparison <a href="edit.php?post_type=easymediagallery&page=comparison">here</a> or go to Pro Version DEMO <a href="http://goo.gl/qG29Me" target="_blank">here</a></div>';
                echo '<td><select style="width:200px;" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '">';
                foreach ($field['options'] as $key => $option) {
                    echo '<option value="' . $option . '"';
                    if ($meta) {
                        if ($meta == $option) {
                            echo ' selected="selected"';
                        }
                    }
                    echo '>' . $option . '</option>';
                }
                echo '</select></td>';
                break;
            case 'radio':
                echo '<td>';
                foreach ($field['options'] as $key => $option) {
                    echo '<label class="radio-label"><input type="radio" name="easmedia_meta[' . $field['id'] . ']" value="' . $key . '" class="radio"';
                    if ($meta) {
                        if ($meta == $key) {
                            echo ' checked="checked"';
                        }
                    } else {
                        if ($field['std'] == $key) {
                            echo ' checked="checked"';
                        }
                    }
                    echo ' /> ' . $option . '</label> ';
                }
                echo '</td>';
                break;
            case 'color':
                if (array_key_exists('val', $field)) {
                    $val = ' value="' . $field['val'] . '"';
                }
                if ($meta) {
                    $val = ' value="' . $meta . '"';
                }
                echo '<td>';
                echo '<div class="colorpicker-wrapper">';
                echo '<input type="text" id="' . $field['id'] . '_cp" name="easmedia_meta[' . $field['id'] . ']"' . $val . ' />';
                echo '<div id="' . $field['id'] . '" class="colorpicker"></div>';
                echo '</div>';
                echo '</td>';
                break;
            case 'checkbox':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                    }
                } else {
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                    }
                }
                echo '<input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on"' . $val . ' /> ';
                echo '</td>';
                break;
            case 'checkboxoptdef':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                    }
                } else {
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' /></div>
				';
                echo '</td>';
                break;
            case 'checkboxopt':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    }
                } else {
                    echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' /></div>
			<div id="vidcustomsize" style="border-top: 1px solid #ccc; padding-top: 10px;">
				 	Video custom size : <div style="margin-top:10px; margin-bottom:10px;"><strong>Width</strong> <input style="margin-right:5px !important; margin-left:3px; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['width'] . ']" id="' . $field['id'] . '[width]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_video_size_' . $field['width'] . '', true) . '" />  ' . $field['pixopr'] . '

<span style="border-right:solid 1px #CCC;margin-left:9px; margin-right:10px !important; "></span>

 	<strong>Height</strong> <input style="margin-left:3px; margin-right:5px !important; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['height'] . ']" id="' . $field['id'] . '[height]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_video_size_' . $field['height'] . '', true) . '" /> ' . $field['pixopr'] . ' </div></div>

				';
                echo '</td>';
                break;
            case 'gallery':
                echo '<td>
				<span class="emg_add_images">Add Images</span>
				<div id="emg_images_container">
				<ul class="images_list ui-sortable">';
                if (is_array($meta)) {
                    foreach ($meta as $img_id) {
                        $img_data = get_post($img_id);
                        $img_url = wp_get_attachment_thumb_url($img_id);
                        echo '
						<li class="emgthumbhandler" data-attachment_id="' . $img_id . '">
							<input type="hidden" name="easmedia_meta[easmedia_metabox_media_gallery][]" value="' . $img_id . '" />
							<img src="' . $img_url . '" />
							<span class="emg-del-images"></span>
							
						</li>';
                    }
                } else {
                    echo '<p class="noimgs">No images... </p>';
                }
                echo '</ul></div></td>';
                echo '<script type="text/javascript">
			jQuery(document).ready(function($) {
				jQuery(".images_list").sortable({
					opacity: 0.6,
					cursor: "move",
					placeholder: "emg-sortable-placeholder",
					revert: 300,
					update: function( event, ui ) {ui.item.effect( "highlight", {color:"#FC3"}, 700 );}
					});
				});
             </script> 
				';
                break;
        }
        echo '</tr>';
    }
    echo '</table>';
}
Esempio n. 2
0
/**
 * Create content for a custom Meta Box
 *
 * @param array $meta_box Meta box input data
 */
function easmedia_create_meta_box($post, $meta_box)
{
    if (!is_array($meta_box)) {
        return false;
    }
    if (isset($meta_box['description']) && $meta_box['description'] != '') {
        echo '<p>' . $meta_box['description'] . '</p>';
    }
    wp_nonce_field(basename(__FILE__), 'easmedia_meta_box_nonce');
    echo '<table class="form-table easmedia-metabox-table">';
    foreach ($meta_box['fields'] as $field) {
        // Get current post meta data
        $meta = get_post_meta($post->ID, $field['id'], true);
        echo '<tr class="' . $field['id'] . '"><th><label for="' . $field['id'] . '"><strong>' . $field['name'] . ' ' . ($field['defflimit'] == '1' ? '<br>(Default limit : ' . easy_get_option('easymedia_img_size_limit') . 'px)' : '') . '</strong>
			  <span>' . $field['desc'] . '</span></label></th>';
        switch ($field['type']) {
            case 'text':
                echo '<td><input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" /></td>';
                break;
            case 'video':
                echo '<td>
				<input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" />
<div style="color:red; display:none;" id="emgvideopreview"></div>				
<div class="videobox" id="" style="display:none;">
<span class="roll" ></span>
<img id="videothumbnailprv" style="display:none;" src="http://placehold.it/300x190" height="190" width="300"/></div>
				</td>';
                break;
            case 'gmap':
                echo '<div id="medgmaptut" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial</div><td>
				<p>You can learn more how to embed Google Maps through <a target="_blank" href="http://youtu.be/PEgfleRf6hg">this tutorials</a>.</p> 
				<input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" />
				</td>';
                break;
            case 'link':
                echo '<td>
				<input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" />
				</td>';
                break;
            case 'textarea':
                echo '<td><textarea name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" rows="10" cols="5">' . ($meta ? $meta : $field['std']) . '</textarea></td>';
                break;
            case 'gallery':
                $images = get_post_meta($post->ID, 'easmedia_metabox_media_gallery', true);
                echo '<td></tr>
            <div id="g-img-wrap">
			<div class="emgtooltip_description" style="display:none">You can drag-drop this image to re-order or click to edit image title, subtitle and description. Do not forget to switch ON <strong>Use information of each image</strong> option first.</div>			
            	<ul>';
                if (is_array($images)) {
                    foreach ($images as $img_id) {
                        $img_data = get_post($img_id);
                        $img_url = $img_data->guid;
                        $galleryurl = emg_thumb_src($img_url, '90', '90', '0', '0');
                        echo '
						<li class="gallitem" id="currentimg-' . $img_id . '">
							<input type="hidden" name="easmedia_meta[easmedia_metabox_media_gallery][]" value="' . $img_id . '" />
							<img src="' . $galleryurl . '" />
							<span id="currentspn-' . $img_id . '" title="remove image"></span>
						</li>';
                    }
                } else {
                    echo '<p>No images selected... </p>';
                }
                echo '</ul>	
            	<br class="metagal_clear">
            </div>
            <div style="clear: both; height: 20px; border-top: 1px solid #DDD; margin-top:5px;"></div>
			<div id="medgalltut" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial</div>
            <h4>Choose your current images bellow or you can <a href="#" class="easymedia_TBOX easy_upload"> upload another image.</a></h4> 
            <div id="g-img_list"></div><input type="hidden" name="easmedia_meta[' . $field['gallid'] . ']" value="gallery-' . $post->ID . '" />	
          </div></td>';
                break;
            case 'textareackeditor':
                if (is_super_admin()) {
                    echo '<td><textarea name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" rows="10" cols="5">' . ($meta ? $meta : $field['std']) . '</textarea>
				</td>';
                } else {
                    echo '<td><p>Sorry, you are not allowed to use this item.</p>
				</td>';
                }
                break;
            case 'file':
                echo '<td><input type="text" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '" value="' . ($meta ? $meta : $field['std']) . '" size="30" class="file" /> <input type="button" class="button" name="' . $field['id'] . '_button" id="' . $field['id'] . '_button" value="Browse" /></td>';
                break;
            case 'images':
                global $wp_version;
                if (version_compare($wp_version, "3.5", "<")) {
                    $uploaderclass = 'thickbox button add_media';
                } else {
                    $uploaderclass = 'button insert-media add_media';
                }
                $dsplynone = 'display:none;';
                if (get_post_meta($post->ID, 'easmedia_metabox_img', true)) {
                    $attid = wp_get_attachment_image_src(emg_get_attachment_id_from_src(get_post_meta($post->ID, 'easmedia_metabox_img', true)), 'full');
                    $curimgpth = easymedia_imgresize($attid[0], '210', 'on', $attid[1], $attid[2]);
                    $curimgpth = explode(",", $curimgpth);
                    $curimgpth[0] > '10' ? $curimgpth[0] = $curimgpth[0] : ($curimgpth[0] = '');
                    $curimgpth[0] > '10' ? $dsplynone = '' : ($dsplynone = 'display:none;');
                } else {
                    $dsplynone = 'display:none;';
                    $curimgpth[0] = '';
                    $curimgpth[1] = '';
                    $curimgpth[2] = '';
                }
                echo '<div id="medsingimgtut" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial</div><td id="imgupld"><input id="upload_image" type="text" name="easmedia_meta[' . $field['id'] . ']" value="' . ($meta ? $meta : $field['std']) . '" style="margin-bottom:5px;"/><div style="color:red;" id="notifynovalidimg"></div><div class="addmed"><a rel="image" class="' . $uploaderclass . '" title="Add Media" data-editor="content" href="media-upload.php?type=image&TB_iframe=1"><span class="emg-media-buttons-icon"></span>Add Media</a></div>
<a onClick="return false;" style="' . $dsplynone . ';" class="deleteimage button" title="Delete Image" href="#"><span class="emg-media-buttons-icon-del"></span>Delete Image</a>

<div style="' . $dsplynone . ' width:' . $curimgpth[1] . 'px; height:' . $curimgpth[2] . 'px" id="imgpreviewbox" class="imgpreviewboxc">
<img id="imgthumbnailprv" src="' . $curimgpth[0] . '"/></div>
</td>';
                break;
            case 'audio':
                global $wp_version;
                if (version_compare($wp_version, "3.5", "<")) {
                    $uploaderclass = 'thickbox button add_media';
                } else {
                    $uploaderclass = 'button insert-media add_media';
                }
                $adsplynone = 'display:none;';
                $curaudiopth = get_post_meta($post->ID, 'easmedia_metabox_media_audio', true);
                $curaudiosrc = get_post_meta($post->ID, 'easmedia_metabox_media_audio_source', true);
                $curaudiopth != '' && strlen($curaudiosrc) <= 3 ? $adsplynone = '' : ($adsplynone = 'display:none;');
                if ($curaudiopth != '' && strlen($curaudiosrc) <= 3) {
                    echo '
<script type="text/javascript">
    jQuery(function () {
		var thisaudiourl = "' . $curaudiopth . '";
    IsValidAuUrl1(thisaudiourl);
    });
    </script>	
';
                }
                echo '<div id="medaump3" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial (Embed mp3)</div>
<div id="medausndcld" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial (Embed Soundcloud)</div>
<div id="medaurevrb" style="text-decoration:underline;font-weight:bold;cursor:Pointer; color:#1A91F2 !important; margin-bottom:8px;">Video Tutorial (Embed Reverbnation)</div>
<td id="audioupld"><input id="upload_audio" type="text" name="easmedia_meta[' . $field['id'] . ']" value="' . ($meta ? $meta : $field['std']) . '" style="margin-bottom:5px;"/><div style="color:red;" id="notifynovalidaudio"></div><div class="addmed"><a rel="audio" class="' . $uploaderclass . '" title="Add Media" data-editor="content" href="media-upload.php?type=image&TB_iframe=1"><span class="emg-media-buttons-icon"></span>Add Media</a></div>
<a onClick="return false;" style="' . $adsplynone . ';" class="deleteaudio button" title="Delete Audio" href="#"><span class="emg-media-buttons-icon-del"></span>Delete Audio</a>

<div style="' . $adsplynone . ';" id="audioprev" class="vidpreviewboxc">
	<div id="jquery_jplayer_1" class="jp-jplayer"></div>
		<div id="jp_container_1" class="jp-audio">
			<div class="jp-type-single">
				<div class="jp-gui jp-interface">
					<ul class="jp-controls">
						<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
						<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
						<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
						<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
						<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
						<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
					</ul>
					<div class="jp-progress">
						<div class="jp-seek-bar">
							<div class="jp-play-bar"></div>
						</div>
					</div>
					<div class="jp-volume-bar">
						<div class="jp-volume-bar-value"></div>
					</div>
					<div class="jp-current-time"></div>
					<div class="jp-duration"></div>
				</div>
				<div class="jp-no-solution">
					<span>Update Required</span>
					To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
				</div>
			</div>
		</div>

</div>
</td>';
                break;
            case 'select':
                echo '<td><select style="width:200px;" name="easmedia_meta[' . $field['id'] . ']" id="' . $field['id'] . '">';
                foreach ($field['options'] as $key => $option) {
                    echo '<option value="' . $option . '"';
                    if ($meta) {
                        if ($meta == $option) {
                            echo ' selected="selected"';
                        }
                    }
                    echo '>' . $option . '</option>';
                }
                echo '</select></td>';
                break;
            case 'radio':
                echo '<td>';
                foreach ($field['options'] as $key => $option) {
                    echo '<label class="radio-label"><input type="radio" name="easmedia_meta[' . $field['id'] . ']" value="' . $key . '" class="radio"';
                    if ($meta) {
                        if ($meta == $key) {
                            echo ' checked="checked"';
                        }
                    } else {
                        if ($field['std'] == $key) {
                            echo ' checked="checked"';
                        }
                    }
                    echo ' /> ' . $option . '</label> ';
                }
                echo '</td>';
                break;
            case 'color':
                if (array_key_exists('val', $field)) {
                    $val = ' value="' . $field['val'] . '"';
                }
                if ($meta) {
                    $val = ' value="' . $meta . '"';
                }
                echo '<td>';
                echo '<div class="colorpicker-wrapper">';
                echo '<input type="text" id="' . $field['id'] . '_cp" name="easmedia_meta[' . $field['id'] . ']"' . $val . ' />';
                echo '<div id="' . $field['id'] . '" class="colorpicker"></div>';
                echo '</div>';
                echo '</td>';
                break;
            case 'checkboxoptdeffetch':
                if (get_post_meta($post->ID, 'easmedia_metabox_media_video_fetchurl', true)) {
                    $vimyuimg = get_post_meta($post->ID, 'easmedia_metabox_media_video_fetchurl', true);
                } else {
                    $vimyuimg = 'http://placehold.it/250x150';
                }
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
					jQuery(".easmedia_metabox_img").hide("slow");	
					jQuery("#imgpreviewboxvid").show("slow");	
					jQuery("#fetchthumb").show("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {	
					jQuery(".easmedia_metabox_img").show("slow");	
					jQuery("#imgpreviewboxvid").hide("slow");	
					jQuery("#fetchthumb").hide("slow");	
    });
    </script>';
                    }
                } else {
                    echo '<script type="text/javascript">
    jQuery(function () {
					jQuery(".easmedia_metabox_img").show("slow");	
					jQuery("#imgpreviewboxvid").hide("slow");	
					jQuery("#fetchthumb").hide("slow");	
    });
    </script>';
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
					jQuery(".easmedia_metabox_img").hide("slow");	
					jQuery("#imgpreviewboxvid").show("slow");	
					jQuery("#fetchthumb").show("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
					jQuery(".easmedia_metabox_img").show("slow");	
					jQuery("#imgpreviewboxvid").hide("slow");	
					jQuery("#fetchthumb").hide("slow");
    });
    </script>';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' />
				<a onClick="return false;" style="outline: medium none !important;" class="button" href="#" title="Generate Now" id="fetchthumb"><span class="emg-buttons-generate-loading" style="display:none;"></span>Generate Now</a><input type="hidden" name="easmedia_meta[' . $field['dvi'] . ']" id="customvimyutimgurl" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_video_fetchurl', true) . '" /></div>
				<div style="width:250px; height:150px" id="imgpreviewboxvid" class="imgpreviewboxc">
<img id="cusimgthumbnailprv" src="' . $vimyuimg . '"  height="150" width="250"/></div>
				';
                echo '</td>';
                break;
            case 'checkbox':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                    }
                } else {
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                    }
                }
                echo '<input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on"' . $val . ' /> ';
                echo '</td>';
                break;
            case 'checkboxoptdef':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                    }
                } else {
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' /></div>
				';
                echo '</td>';
                break;
            case 'checkboxopt':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    }
                } else {
                    echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#vidcustomsize").show("slow");
    });
    </script>';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' /></div>
			<div id="vidcustomsize" style="border-top: 1px solid #ccc; padding-top: 10px;">
				 	Video custom size : <div style="margin-top:10px; margin-bottom:10px;"><strong>Width</strong> <input style="margin-right:5px !important; margin-left:3px; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['width'] . ']" id="' . $field['id'] . '[width]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_video_size_' . $field['width'] . '', true) . '" />  ' . $field['pixopr'] . '

<span style="border-right:solid 1px #CCC;margin-left:9px; margin-right:10px !important; "></span>

 	<strong>Height</strong> <input style="margin-left:3px; margin-right:5px !important; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['height'] . ']" id="' . $field['id'] . '[height]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_video_size_' . $field['height'] . '', true) . '" /> ' . $field['pixopr'] . ' </div></div>

				';
                echo '</td>';
                break;
            case 'checkboxoptmap':
                echo '<td>';
                $val = '';
                if ($meta) {
                    if ($meta == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#gmapcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#gmapcustomsize").show("slow");
    });
    </script>';
                    }
                } else {
                    echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#gmapcustomsize").show("slow");
    });
    </script>';
                    if ($field['std'] == 'on') {
                        $val = ' checked="checked"';
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#gmapcustomsize").hide("slow");
    });
    </script>';
                    } else {
                        echo '<script type="text/javascript">
    jQuery(function () {
	jQuery("#gmapcustomsize").show("slow");
    });
    </script>';
                    }
                }
                echo '<div style="margin-bottom:15px !important;"><input type="hidden" name="easmedia_meta[' . $field['id'] . ']" value="off" />
                <input class="switch" type="checkbox" id="' . $field['id'] . '" name="easmedia_meta[' . $field['id'] . ']" value="on" ' . $val . ' /></div>
			<div id="gmapcustomsize" style="border-top: 1px solid #ccc; padding-top: 10px;">
				 	Maps custom size : <div style="margin-top:10px; margin-bottom:10px;"><strong>Width</strong> <input style="margin-right:5px !important; margin-left:3px; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['width'] . ']" id="' . $field['id'] . '[width]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_gmap_size_' . $field['width'] . '', true) . '" />  ' . $field['pixopr'] . '

<span style="border-right:solid 1px #CCC;margin-left:9px; margin-right:10px !important; "></span>

 	<strong>Height</strong> <input style="margin-left:3px; margin-right:5px !important; width:43px !important; float:none !important;" name="easmedia_meta[' . $field['id'] . '_' . $field['height'] . ']" id="' . $field['id'] . '[height]" type="text" value="' . get_post_meta($post->ID, 'easmedia_metabox_media_gmap_size_' . $field['height'] . '', true) . '" /> ' . $field['pixopr'] . ' </div></div>

				';
                echo '</td>';
                break;
        }
        echo '</tr>';
    }
    echo '</table>';
}
Esempio n. 3
0
function easy_media_gnl_shortcode($attsn)
{
    if (easy_get_option('easymedia_disen_plug') == '1') {
        extract(shortcode_atts(array('med' => -1, 'size' => ''), $attsn));
        ob_start();
        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
        // for pagination
        $deff_img_limit = easy_get_option('easymedia_img_size_limit');
        // get the default image size limit
        $theopt = easy_get_option('easymedia_frm_size');
        $imwidth = stripslashes($theopt['width']);
        $imheight = stripslashes($theopt['height']);
        if ($med > '0') {
            $finid = explode(",", $med);
            $medinarr = $finid;
            $emargs = emg_gallery_gen($finid, $paged);
        }
        $emg_query = new WP_Query($emargs);
        if ($emg_query->have_posts()) {
            $mediauniqueid = emgRandomString(6);
            //Random class for fitText
            echo '<div class="pagwrap"><div class="easycontainer emgclearfix">';
            echo '<div class="rig">';
            while ($emg_query->have_posts()) {
                $emg_query->the_post();
                $images = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery', true);
                $isresize = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery_opt1', true);
                if (is_array($images)) {
                    $ig = 0;
                    foreach ($images as $img_id) {
                        $img = wp_get_attachment_image_src($img_id, 'full');
                        $img_url = easymedia_imgresize($img[0], $deff_img_limit, $isresize, $img[1], $img[2]);
                        $img_url = explode(",", $img_url);
                        $img_info = get_post($img_id);
                        $ext = pathinfo($img[0], PATHINFO_EXTENSION);
                        $filenm = basename($img[0], "." . $ext);
                        $emgthumbimg = easymedia_resizer($img[0], $img[1], $img[2], $imwidth, $imheight, true);
                        if (get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery_opt2', true) == 'on') {
                            $thumbttl = $img_info->post_title;
                            $thumbttl = esc_html(esc_js($thumbttl));
                        } else {
                            $thumbttl = get_post_meta(get_the_id(), 'easmedia_metabox_title', true);
                        }
                        emg_gallery_markup($imwidth, $imheight, get_the_id() . '-' . $img_id, $img_url[0], $emgthumbimg, $filenm, stripslashes($thumbttl));
                    }
                } else {
                    echo '<div style="display:none"></div>';
                }
                ?>

<?php 
            }
        } else {
            echo '<div class="easymedia_center">';
            echo '<div class="view"><img src="' . plugins_url('images/ajax-loader.gif', __FILE__) . '" width="32" height="32"/></div>';
            $contnt = ob_get_clean();
            return $contnt;
        }
        wp_reset_postdata();
        echo '<div style="clear:both;"></div>';
        echo '</div></div>';
        // @since 1.3.75
        if (emg_get_aff_option('emg_affiliate_info', 'emg_aff_id', '')) {
            echo '<span class="emg-aff-link">Powered by <a href="https://secure.ghozylab.com/demo/?ref=' . emg_get_aff_option('emg_affiliate_info', 'emg_aff_id', '') . '&goto=emg" target="_blank">Easy Media Gallery Plugin</a></span>';
        }
        echo '</div>';
        // JS
        emg_put_script();
        // Dinamic CSS
        echo '<style>/*Dynamic CSS - By GhozyLab*/';
        echo emg_dynamic_css_generator();
        echo '</style>';
        $content = ob_get_clean();
        return $content;
    } else {
        ob_start();
        echo '<div style="display: none;"></div>';
        $contnt = ob_get_clean();
        return $contnt;
    }
}
Esempio n. 4
0
function easy_media_category($attsn)
{
    if (easy_get_option('easymedia_disen_plug') == '1') {
        extract(shortcode_atts(array('cat' => -1, 'style' => '', 'filter' => '', 'mark' => '', 'pag' => '', 'def' => '', 'size' => ''), $attsn));
        ob_start();
        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
        // for pagination
        $deff_img_limit = easy_get_option('easymedia_img_size_limit');
        // get the default image size limit
        $theopt = easy_get_option('easymedia_frm_size');
        $showbadge = easy_get_option('easymedia_disen_showcntrthumb');
        // Custom Filter
        if ($def != '') {
            echo '<script>var fodr = []; fodr[0] = ".fltr' . $def . '"; </script>';
            $clssltdall = 'class=""';
        } else {
            $def = '*';
            echo '<script>var fodr = []; fodr[0] = "' . $def . '"; </script>';
            $clssltdall = 'class="selected"';
        }
        // Custom Style
        if ($style != '') {
            if (easy_get_option('easymedia_disen_style_man') == '1') {
                $cus_style = ucfirst($style);
            } else {
                $cus_style = easy_get_option('easymedia_box_style');
            }
        } else {
            $cus_style = easy_get_option('easymedia_box_style');
        }
        // Custom size filter
        if ($size != '') {
            $sizeval = explode(",", $size);
            if ($sizeval[0] > 0 && $sizeval[1] > 0 && is_numeric($sizeval[0]) && is_numeric($sizeval[1])) {
                $imwidth = $sizeval[0];
                $imheight = $sizeval[1];
            } else {
                $imwidth = stripslashes($theopt['width']);
                $imheight = stripslashes($theopt['height']);
            }
        } else {
            $imwidth = stripslashes($theopt['width']);
            $imheight = stripslashes($theopt['height']);
        }
        if ($cat > '0') {
            $finid = explode(",", $cat);
            $medinarr = $finid;
            $emgargs = array('post_type' => 'easymediagallery', 'showposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'tax_query' => array(array('taxonomy' => 'emediagallery', 'terms' => $finid, 'field' => 'term_id')));
        }
        $emg_query = new WP_Query($emgargs);
        if ($emg_query->have_posts()) {
            $mediauniqueid = RandomString(6);
            //Random class for fitText
            if ($filter != '' && $pag == '') {
                echo '<section id="emgoptions" class="emgclearfix"><ul id="filters" class="portfolio-tabs emgoption-set emgclearfix" data-option-key="filter">';
                echo '<li><a href="#filter" data-option-value="*" ' . $clssltdall . ' id="emgshowall">' . __('Show All', 'easmedia') . '</a></li>';
                foreach ($medinarr as $eachcat) {
                    $terms = get_term($eachcat, 'emediagallery');
                    $filtid = $terms->name;
                    if ($def == $eachcat) {
                        $clssdeffil = 'class="selected"';
                    } else {
                        $clssdeffil = 'class=""';
                    }
                    if ($filtid) {
                        echo '<li><a href="#filter" ' . $clssdeffil . ' data-option-value=".fltr' . $eachcat . '">' . $filtid . '</a></li>';
                    } else {
                        echo '<li><a href="#filter" data-option-value=".fltruncategorized">Uncategorized</a></li>';
                    }
                }
                echo '</ul></section>';
            }
            if ($pag != '') {
                echo '<div class="pagwrap" id="' . $pag . '"><div id="pag-legend2" style="display:none;"></div><div class="emgpagntn easymedia_center emgclearfix">';
            } else {
                echo '<div class="emgajxloader"></div><div style="display: none;" class="pagwrap" id="nopagination"><div class="easycontainer easymedia_center emgclearfix">';
            }
            while ($emg_query->have_posts()) {
                $emg_query->the_post();
                //$image = wp_get_attachment_url( get_post_thumbnail_id( get_the_id() ) );
                //$image = get_the_post_thumbnail( get_the_id(), 'work-admin-thumb' ) ;
                $image = get_post_meta(get_the_id(), 'easmedia_metabox_img', true);
                $mediattl = esc_html(esc_js(get_post_meta(get_the_id(), 'easmedia_metabox_title', true)));
                $mediattl = stripslashes($mediattl);
                $mediatype = get_post_meta(get_the_id(), 'easmedia_metabox_media_type', true);
                $isvidsize = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_size', true);
                $ismapsize = get_post_meta(get_the_id(), 'easmedia_metabox_media_gmap_size', true);
                $galleryid = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery_id', true);
                $isresize = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery_opt1', true);
                $isresize1 = get_post_meta(get_the_id(), 'easmedia_metabox_media_image_opt1', true);
                $usegalleryinfo = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery_opt2', true);
                $link_type = get_post_meta(get_the_id(), 'easmedia_metabox_media_link_opt1', true);
                $thepostid = get_the_id();
                $medcat = wp_get_post_terms(get_the_id(), 'emediagallery');
                /*  Version 1.3.1.3 - 1.3.1.5
                		if ($medcat) {
                		foreach ( $medcat as $cat ) {
                			$mediaid= $cat->term_id;
                			unset($medcat);
                		} } else {$mediaid = 'uncategorized'; unset($medcat);}			
                */
                /*@since 1.3.1.7		*/
                $terms = get_the_terms(get_the_id(), 'emediagallery');
                if ($terms && !is_wp_error($terms)) {
                    $mcatid = array();
                    foreach ($terms as $term) {
                        $mcatid[] = $term->term_id;
                    }
                    $mediaid = "fltr" . join(" fltr", $mcatid);
                }
                if ($image == '') {
                    $image = plugins_url('images/no-image-available.jpg', __FILE__);
                } else {
                    $image = $image;
                }
                switch ($mediatype) {
                    case 'Single Image':
                        if (basename($image) == 'no-image-available.jpg') {
                            $medialink = $image;
                        } else {
                            $attid = wp_get_attachment_image_src(emg_get_attachment_id_from_src($image), 'full');
                            $medialink = easymedia_imgresize($attid[0], $deff_img_limit, $isresize1, $attid[1], $attid[2]);
                            $medialink = explode(",", $medialink);
                            $medialink = $medialink[0];
                        }
                        if ($mark) {
                            $therell = "easymedia[" . $mark . "]";
                        } else {
                            $therell = "easymedia";
                        }
                        break;
                    case 'Multiple Images (Slider)':
                        if ($pag != '') {
                            $therell = "easymedia[" . $mediauniqueid . "]";
                        } else {
                            $therell = "easymedia[" . $galleryid . "]";
                        }
                        $images = get_post_meta(get_the_id(), 'easmedia_metabox_media_gallery', true);
                        ob_start();
                        if (is_array($images)) {
                            $ig = 0;
                            echo '<div id="easymedia_gallerycontainer-' . $mediauniqueid . '" style="display:none">';
                            foreach ($images as $img_id) {
                                //Changelog version 1.3.1.3 => Set 1st Image Gallery
                                if ($ig++ == 0) {
                                    $img = wp_get_attachment_image_src($img_id, 'full');
                                    $frstimg = $img_id;
                                    $medialink = easymedia_imgresize($img[0], $deff_img_limit, $isresize, $img[1], $img[2]);
                                    $medialink = explode(",", $medialink);
                                    $medialink = $medialink[0];
                                }
                                $img = wp_get_attachment_image_src($img_id, 'full');
                                $img_url = easymedia_imgresize($img[0], $deff_img_limit, $isresize, $img[1], $img[2]);
                                $img_url = explode(",", $img_url);
                                ?>
                	<a class="<?php 
                                echo $thepostid;
                                ?>
-<?php 
                                echo $img_id;
                                ?>
" href="<?php 
                                echo $img_url[0];
                                ?>
" rel="<?php 
                                echo $therell;
                                ?>
"></a>
            		<?php 
                                $imgcount = $ig;
                            }
                            echo '</div>';
                        } else {
                            echo '<div style="display:none"></div>';
                        }
                        $galle = ob_get_clean();
                        if ($imgcount <= 1) {
                            $sorn = 'image';
                        } else {
                            $sorn = 'images';
                        }
                        break;
                    case 'Video':
                        $vidcover = get_post_meta(get_the_id(), 'easmedia_metabox_img', true);
                        $vidlink1 = get_post_meta(get_the_id(), 'easmedia_metabox_media_video', true);
                        $vidlink2 = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_webm', true);
                        $vidlink3 = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_ogg', true);
                        if ($vidlink1 != '') {
                            $vidlink1 = $vidlink1;
                        } else {
                            $vidlink1 = '-';
                        }
                        if ($vidlink2 != '') {
                            $vidlink2 = $vidlink2;
                        } else {
                            $vidlink2 = '-';
                        }
                        if ($vidlink3 != '') {
                            $vidlink3 = $vidlink3;
                        } else {
                            $vidlink3 = '-';
                        }
                        if ($vidcover != '') {
                            $vidcover = $vidcover;
                        } else {
                            $vidcover = '-';
                        }
                        if (pathinfo($vidlink1, PATHINFO_EXTENSION) == 'mp4' || pathinfo($vidlink2, PATHINFO_EXTENSION) == 'webm' || pathinfo($vidlink3, PATHINFO_EXTENSION) == 'ogv' || pathinfo($vidlink1, PATHINFO_EXTENSION) == 'wmv') {
                            $medialink = $vidlink1 . '#emg#' . $vidlink2 . '#emg#' . $vidlink3 . '#emg#' . emg_replace_extension($vidcover);
                        } else {
                            $medialink = $vidlink1;
                        }
                        if ($mediatype == 'Video' && $isvidsize == 'off') {
                            $cusvidw = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_size_vidw', true);
                            $cusvidh = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_size_vidh', true);
                            $therell = "easymedia[" . $cusvidw . " " . $cusvidh . "]";
                        } elseif ($mediatype == 'Video' && $isvidsize == 'on') {
                            $getarry = easy_get_option('easymedia_vid_size');
                            $defvidw = stripslashes($getarry['width']);
                            $defvidh = stripslashes($getarry['height']);
                            $therell = "easymedia[" . $defvidw . " " . $defvidh . "]";
                        } else {
                            $therell = "easymedia";
                        }
                        break;
                    case 'Google Maps':
                        $medialink = get_post_meta(get_the_id(), 'easmedia_metabox_media_gmap', true) . "&amp;output=embed";
                        if ($mediatype == 'Google Maps' && $ismapsize == 'off') {
                            $cusgmw = get_post_meta(get_the_id(), 'easmedia_metabox_media_gmap_size_gmidw', true);
                            $cusgmh = get_post_meta(get_the_id(), 'easmedia_metabox_media_gmap_size_gmidh', true);
                            $therell = "easymedia[" . $cusgmw . " " . $cusgmh . "]";
                        } elseif ($mediatype == 'Google Maps' && $ismapsize == 'on') {
                            $getarry = easy_get_option('easymedia_gmap_size');
                            $defgmw = stripslashes($getarry['width']);
                            $defgmh = stripslashes($getarry['height']);
                            $therell = "easymedia[" . $defgmw . " " . $defgmh . "]";
                        } else {
                            $therell = "easymedia";
                        }
                        break;
                    case 'Audio':
                        $curaudiosource = get_post_meta(get_the_id(), 'easmedia_metabox_media_audio_source', true);
                        $medialinktmp = get_post_meta(get_the_id(), 'easmedia_metabox_media_audio', true);
                        $medialink = get_post_meta(get_the_id(), 'easmedia_metabox_media_audio', true);
                        if ($mark) {
                            $therell = "easymedia[" . $mark . "]";
                        } else {
                            $therell = "easymedia";
                        }
                        if ($curaudiosource == 'soundcloud.com') {
                            $therell = "easymedia[600 170]";
                        } else {
                            $therell = "easymedia";
                        }
                        break;
                    case 'Link':
                        $media_link = get_post_meta(get_the_id(), 'easmedia_metabox_media_link', true);
                        if ($media_link != '') {
                            if (substr($media_link, 0, 4) === 'http' || substr($media_link, 0, 5) === 'https') {
                                $media_link_fin = $media_link;
                            } else {
                                $media_link_fin = 'http://' . $media_link;
                            }
                        } else {
                            $media_link_fin = $post->guid;
                        }
                        $medialink = $media_link_fin;
                        $therell = "";
                        break;
                }
                $emgthumbimg = emg_thumb_src($image, $imwidth, $imheight, '0', '0');
                $curimgnmane = basename($image);
                if ($curimgnmane == 'no-image-available.jpg') {
                    $emgthumbimg = $image;
                } else {
                    $emgthumbimg = $emgthumbimg;
                }
                if ($pag != '') {
                    $theclass = 'peasyitem';
                } else {
                    $theclass = 'easyitem';
                }
                if ($mediatype == 'Video' && get_post_meta(get_the_id(), 'easmedia_metabox_media_video_fetchurl', true) != '') {
                    $emgthumbimg = get_post_meta(get_the_id(), 'easmedia_metabox_media_video_fetchurl', true);
                }
                if ($showbadge == '1' && $mediatype == 'Multiple Images (Slider)') {
                    $addbadge = '<span class="emg-badges"><span class="icount">' . $imgcount . '</span><span class="imgtg">' . $sorn . '</span></span>';
                } else {
                    $addbadge = '';
                }
                if (easy_get_option('easymedia_disen_hovstyle') == '1') {
                    ?>
     <div style="width:<?php 
                    echo $imwidth;
                    ?>
px; height:<?php 
                    echo $imheight;
                    ?>
px;" class="<?php 
                    echo $theclass;
                    ?>
 view da-thumbs preloaderview <?php 
                    echo $mediaid;
                    ?>
"><?php 
                    echo $addbadge;
                    ?>
<div class="iehand"><img data-original="<?php 
                    echo $emgthumbimg;
                    ?>
" /><a onclick="easyActiveStyleSheet('<?php 
                    echo $cus_style;
                    ?>
');return true;" class="<?php 
                    if ($mediatype == 'Multiple Images (Slider)' && $usegalleryinfo == 'on') {
                        echo $thepostid . '-' . $frstimg;
                    } else {
                        echo $thepostid;
                    }
                    ?>
" rel="<?php 
                    echo $therell;
                    ?>
" href="<?php 
                    echo $medialink;
                    ?>
" <?php 
                    if ($link_type == 'on' && $mediatype == 'Link') {
                        echo 'target="_blank"';
                    }
                    ?>
><article class="da-animate da-slideFromRight"><p <?php 
                    if ($mediattl == '') {
                        echo 'style="display:none !important;"';
                    }
                    ?>
 class="emgfittext"><?php 
                    echo $mediattl;
                    ?>
</p><div class="forspan"><span class="zoom"></span></div></article></a></div></div>
            
<?php 
                } elseif (easy_get_option('easymedia_disen_hovstyle') == '') {
                    ?>
<div class="<?php 
                    echo $theclass;
                    ?>
 view da-thumbs preloaderview <?php 
                    echo $mediaid;
                    ?>
" style="width:<?php 
                    echo $imwidth;
                    ?>
px; height:<?php 
                    echo $imheight;
                    ?>
px;"><?php 
                    echo $addbadge;
                    ?>
<div class="iehand"><a onclick="easyActiveStyleSheet('<?php 
                    echo $cus_style;
                    ?>
');return true;" class="<?php 
                    if ($mediatype == 'Multiple Images (Slider)' && $usegalleryinfo == 'on') {
                        echo $thepostid . '-' . $frstimg;
                    } else {
                        echo $thepostid;
                    }
                    ?>
" rel="<?php 
                    echo $therell;
                    ?>
" href="<?php 
                    echo $medialink;
                    ?>
" <?php 
                    if ($link_type == 'on' && $mediatype == 'Link') {
                        echo 'target="_blank"';
                    }
                    ?>
><img data-original="<?php 
                    echo $emgthumbimg;
                    ?>
"/><p <?php 
                    if ($mediattl == '') {
                        echo 'style="display:none !important;"';
                    }
                    ?>
 class="da-animatenh emgfittext" style="display:none;"><?php 
                    echo $mediattl;
                    ?>
</p><div class="forspana"><span class="zooma"></span></div></a></div></div>
<?php 
                }
                //Changelog version 1.0.1.0 => Generate Image Gallery
                if ($mediatype == 'Multiple Images (Slider)') {
                    echo $galle;
                }
            }
        } else {
            echo '<div class="easymedia_center">';
            echo '<div class="view"><img src="' . plugins_url('images/ajax-loader.gif', __FILE__) . '" width="32" height="32"/></div>';
            $contnt = ob_get_clean();
            return $contnt;
        }
        wp_reset_postdata();
        echo '<div style="clear:both;"></div>';
        if ($pag != '') {
            echo '</div><div class="emg-pag-holder"></div></div>';
        } else {
            echo '</div></div>';
        }
        $content = ob_get_clean();
        return $content;
    } else {
        ob_start();
        echo '<div style="display: none;"></div>';
        $contnt = ob_get_clean();
        return $contnt;
    }
}