示例#1
0
function easymedia_frontend_script()
{
    wp_enqueue_script('fittext');
    if (easy_get_option('easymedia_plugin_core') != 'none') {
        wp_enqueue_script('mootools-core');
    }
    wp_enqueue_script('easymedia-core');
    wp_enqueue_script('easymedia-isotope');
    wp_enqueue_script('easymedia-frontend');
    wp_enqueue_script('easymedia-jpages');
    wp_enqueue_script('easymedia-lazyload');
    if (EMG_IS_AJAX == '1') {
        wp_enqueue_script('easymedia-ajaxfrontend');
    }
    easy_get_option('easymedia_disen_autopl') == '1' ? $audautoplay = 'true' : ($audautoplay = 'false');
    easy_get_option('easymedia_disen_audio_loop') == '1' ? $audioloop = 'true' : ($audioloop = 'false');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplaya = '&autoplay=1' : ($autoplaya = '');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayb = '?autoplay=1' : ($autoplayb = '');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayc = '1' : ($autoplayc = '0');
    easy_get_option('easymedia_disen_rclick') == '1' ? $disenrclck = 'true' : ($disenrclck = 'false');
    easy_get_option('easymedia_cls_pos') == 'Bottom' ? $cbpos = '0' : ($cbpos = '1');
    easy_get_option('easymedia_sos_pos') == 'Bottom' ? $sspos = '0' : ($sspos = '1');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayd = 'true' : ($autoplayd = 'false');
    easy_get_option('easymedia_disen_showcntr') == '1' ? $disencntr = 'true' : ($disencntr = 'false');
    $eparams = array('nblaswf' => plugins_url('/swf/NonverBlaster.swf', __FILE__), 'audiovol' => easy_get_option('easymedia_audio_vol'), 'audioautoplay' => $audautoplay, 'audioloop' => $audioloop, 'vidautopa' => $autoplaya, 'vidautopb' => $autoplayb, 'vidautopc' => $autoplayc, 'vidautopd' => $autoplayd, 'drclick' => $disenrclck, 'swcntr' => $disencntr, 'pageffect' => easy_get_option('easymedia_pag_effect'), 'ajaxconid' => easy_get_option('easymedia_ajax_con_id'), 'defstyle' => easy_get_option('easymedia_box_style'), 'mediaswf' => plugins_url('/addons/mediaelement/flashmediaelement.swf', __FILE__), 'ajaxpth' => plugins_url('easyloader.php', __FILE__), 'ovrlayop' => easy_get_option('easymedia_overlay_opcty') / 100, 'closepos' => $cbpos, 'sospos' => $sspos);
    wp_localize_script('easymedia-core', 'EasyM', $eparams);
}
示例#2
0
function easymedia_frontend_script()
{
    easy_get_option('easymedia_disen_autopl') == '1' ? $audautoplay = 'true' : ($audautoplay = 'false');
    easy_get_option('easymedia_disen_audio_loop') == '1' ? $audioloop = 'true' : ($audioloop = 'false');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplaya = '&autoplay=1' : ($autoplaya = '');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayb = '?autoplay=1' : ($autoplayb = '');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayc = '1' : ($autoplayc = '0');
    easy_get_option('easymedia_disen_autoplv') == '1' ? $autoplayd = 'true' : ($autoplayd = 'false');
    easy_get_option('easymedia_disen_rclick') == '1' ? $disenrclck = 'true' : ($disenrclck = 'false');
    $eparams = array('nblaswf' => plugins_url('/swf/NonverBlaster.swf', __FILE__), 'audiovol' => easy_get_option('easymedia_audio_vol'), 'audioautoplay' => $audautoplay, 'audioloop' => $audioloop, 'vidautopa' => $autoplaya, 'vidautopb' => $autoplayb, 'vidautopc' => $autoplayc, 'vidautopd' => $autoplayd, 'drclick' => $disenrclck, 'ajaxcid' => easy_get_option('easymedia_ajax_con_id'), 'ajaxpth' => admin_url('admin-ajax.php'), 'ajaxnonce' => wp_create_nonce('medialoader'), 'ovrlayop' => easy_get_option('easymedia_overlay_opcty') / 100);
    wp_localize_script('easymedia-core', 'EasyLite', $eparams);
}
示例#3
0
// IE <8 Handle
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 1 && $disenbor == 1) {
    $version = explode(".", $matches[1]);
    switch (true) {
        case $version[0] <= '8':
            echo '.view {border: 1px solid ' . $shdcol . ';}';
            echo '.iehand {border: ' . $imgborder . 'px solid ' . $frmcol . ';}';
            echo '.da-thumbs article{position: absolute; background-image:url(' . $thumbhov . '); background-repeat:repeat; width: 100%; height: 100%;}';
            break;
        case $version[0] > '8':
            $disenbor == 1 ? $addborder = '.view {border: ' . $imgborder . 'px solid rgba(' . $borderrgba . ',' . $borderrgbaopcty . ');}' : ($addborder = '');
            echo $addborder;
            echo '.da-thumbs article{position: absolute; background: rgba(' . $thumbhovcol . ',' . $thumbhovcolopcty . '); background-repeat:repeat; width: 100%; height: 100%;}';
            break;
        default:
    }
} else {
    if (count($matches) > 1 && $disenbor != '1') {
        echo '.da-thumbs article{position: absolute; background-image:url(' . $thumbhov . '); background-repeat:repeat; width: 100%; height: 100%;}';
    } else {
        echo '.da-thumbs article{position: absolute; background: rgba(' . $thumbhovcol . ',' . $thumbhovcolopcty . '); background-repeat:repeat; width: 100%; height: 100%;}';
    }
}
// Magnify Icon
if (easy_get_option('easymedia_mag_icon') != '') {
    echo '	
span.zoom{
background-image:url(../css/images/magnify/' . easy_get_option('easymedia_mag_icon') . '.png); background-repeat:no-repeat; background-position:center;
}';
}
示例#4
0
function easmedia_metabox_work()
{
    $meta_box = array('id' => 'easmedia_metaboxmediatypeselect', 'title' => __('Media Options', 'easmedia'), 'description' => __('' . (easy_get_option('easymedia_disen_admnotify') == '1' ? '<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>' : '') . '<br>Select videos, images, gallery or audio files.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'default', 'fields' => array(array('name' => __('Media Type', 'easmedia'), 'desc' => __('Choose the item type.', 'easmedia'), 'id' => 'easmedia_metabox_media_type', 'type' => 'select', 'defflimit' => '0', 'options' => array('Select', 'Multiple Images (Slider)', 'Single Image', 'Video', 'Audio', 'Link (PRO ONLY)', 'Google Maps (PRO ONLY)'), 'std' => 'Select')));
    easmedia_add_meta_box($meta_box);
    // VIDEO METABOX
    $meta_box = array('id' => 'easmedia_metaboxmediavideo', 'title' => __('Video Options', 'easmedia'), 'description' => __('Paste video URL to field below.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'default', 'fields' => array(array('name' => __('Video URL', 'easmedia'), 'desc' => __('', 'easmedia'), 'id' => 'easmedia_metabox_media_video', 'type' => 'video', 'defflimit' => '0', 'std' => ''), array('name' => __('Video Size', 'easmedia'), 'desc' => __('If ON, video size will use the default settings on the control panel.', 'easmedia'), 'id' => 'easmedia_metabox_media_video_size', 'type' => 'checkboxopt', 'defflimit' => '0', 'width' => 'vidw', 'height' => 'vidh', 'std' => 'on', "pixopr" => 'px')));
    easmedia_add_meta_box($meta_box);
    // GALLERY METABOX
    $meta_box = array('id' => 'easmedia_metaboxmediagallery', 'title' => __('Select Multiple Images', 'easmedia'), 'description' => __('Click Add Images button to select image from your Wordpress Media Library.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'default', 'fields' => array(array('name' => __('<span class="gtips">Tips:</span>', 'easmedia'), 'desc' => __('<ul class="gtipslist"><li>Use <b>Ctrl + Click</b> on each image to select multiple images at once.</li><li>You also can drag and drop images to re-order.</li><li>Click on image to edit title/subtitle ( <i>Pro Version only</i> )</li><li class="messivideo" data-yvid="https://www.youtube.com/embed/H1Z3fidyEbE?rel=0">Tutorial How to Create Gallery</li>
<li class="messivideo" data-yvid="https://www.youtube.com/embed/H1Z3fidyEbE?rel=0">Tutorial How to Create Album</li></ul>', 'easmedia'), 'id' => 'easmedia_metabox_media_gallery', 'gallid' => 'easmedia_metabox_media_gallery_id', 'type' => 'gallery', 'defflimit' => '0', 'std' => ''), array('name' => __('Full-size image control', 'easmedia'), 'desc' => __('If ON, image which exceeds the specified size limit will be automatically resized. You can change image size limit through plugin control panel.', 'easmedia'), 'id' => 'easmedia_metabox_media_gallery_opt1', 'type' => 'checkboxoptdef', 'defflimit' => '1', 'std' => 'on'), array('name' => __('Use information of each image', 'easmedia'), 'desc' => __('If ON, each image will use individual title based on Wordpress Media informations. If OFF, this gallery will use title, sub title and description from Media Information below.', 'easmedia'), 'id' => 'easmedia_metabox_media_gallery_opt2', 'type' => 'checkboxoptdef', 'defflimit' => '0', 'std' => 'off')));
    easmedia_add_meta_box($meta_box);
    // AUDIO METABOX
    $meta_box = array('id' => 'easmedia_metaboxmediaaudio', 'title' => __('Audio Options', 'easmedia'), 'description' => __('Upload audio or paste audio URL on field below. Is it possible to use audio external source.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'default', 'fields' => array(array('name' => __('Audio Path', 'easmedia'), 'desc' => __('', 'easmedia'), 'id' => 'easmedia_metabox_media_audio', 'type' => 'audio', 'defflimit' => '0', 'std' => '')));
    easmedia_add_meta_box($meta_box);
    // SINGLE IMAGE (FOR ALL MEDIA)
    $meta_box = array('id' => 'emediaimagediv', 'title' => __('Select Image', 'easmedia'), 'description' => __('You can upload image with supported file types: jpg, jpeg, gif, png.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'default', 'fields' => array(array('name' => __('Image URL', 'easmedia'), 'desc' => __('Select or upload your image.', 'easmedia'), 'id' => 'easmedia_metabox_img', 'type' => 'images', 'defflimit' => '0', 'std' => ''), array('name' => __('Full-size image control', 'easmedia'), 'desc' => __('If ON, image which exceeds the specified size limit will be automatically resized. You can change image size limit through plugin control panel.', 'easmedia'), 'id' => 'easmedia_metabox_media_image_opt1', 'type' => 'checkboxoptdef', 'defflimit' => '1', 'std' => 'on')));
    easmedia_add_meta_box($meta_box);
    // MEDIA DESC METABOX
    $meta_box = array('id' => 'easmedia_metabox_media_desc', 'title' => __('Media Information', 'easmedia'), 'description' => __('Input basic info for this media.', 'easmedia'), 'page' => 'easymediagallery', 'context' => 'normal', 'priority' => 'low', 'fields' => array(array('name' => __('Media Title', 'easmedia'), 'desc' => __('Enter a media title.', 'easmedia'), 'id' => 'easmedia_metabox_title', 'type' => 'text', 'defflimit' => '0', 'std' => ''), array('name' => __('Media Subtitle', 'easmedia'), 'desc' => __('You can use this field for (ex: author, title track, etc.)', 'easmedia'), 'id' => 'easmedia_metabox_sub_title', 'type' => 'text', 'defflimit' => '0', 'std' => '')));
    easmedia_add_meta_box($meta_box);
}
示例#5
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>';
}
示例#6
0
function emg_popup_content()
{
    if (strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php')) {
        if (get_post_type(get_the_ID()) != 'easymediagallery') {
            // START GENERATE POPUP CONTENT
            ?>
<div id="modal" style="display:none;">
<div id="tinyform" style="width: 550px;">

<div id="horizontalTab">
<ul>
<li><a href="#tab-1">Gallery, Album & Slider</a></li>
<li><a href="#tab-2">Basic Album, Media & Categories</a></li>
</ul>

<form method="post">

<div id="tab-1"> 
<label class="label_optionglry" for="listgallery">Select Gallery</label>
	<select class="tinymce_select" name="listgallery" id="listcustomgallery">
<?php 
            global $post;
            $args = array('post_type' => 'easymediagallery', 'order' => 'ASC', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array(array('key' => 'easmedia_metabox_media_type', 'value' => 'Multiple Images (Slider)', 'compare' => '=')));
            $myposts = get_posts($args);
            foreach ($myposts as $post) {
                setup_postdata($post);
                ?>
<option id="<?php 
                echo $post->ID;
                ?>
" type="text" value="<?php 
                echo $post->ID;
                ?>
" /><?php 
                echo esc_html(esc_js(the_title(NULL, NULL, FALSE)));
                ?>
</option>
<?php 
            }
            ?>
</select>
                
               <div id="markas_div" style="margin-left:25px; margin-top: 20px;">
               <div class="emgspacer">
               <input id="defgallery" class="emgradiogalltype" type="radio" name="emgtinymce_mark_as" value="easymedia-gallery" checked="checked"/>Set as Simple Gallery</div>
               <div class="emgspacer">
               <input id="emgspacer" class="emgradiogalltype setaspro" type="radio" name="emgtinymce_mark_as" value="easymedia-gallery" checked="checked"/>Set as Filterable Gallery --- <span class="promarker">(PRO Version)</span> - <a href="http://goo.gl/kUTxQa" target="_blank">see demo</a>
                </div>
                <div class="emgspacer">
                <input class="emgradiogalltype setaspro" type="radio" name="emgtinymce_mark_as" value="easy-media-album"/>Set as Album --- <span class="promarker">(PRO Version)</span> - <a href="http://goo.gl/Tid7jL" target="_blank">see demo</a>
                </div>
                <div class="emgspacer">
                <input class="emgradiogalltype setaspro" type="radio" name="emgtinymce_mark_as" value="easymedia-slider-one" />Set as Slider --- <span class="promarker">(PRO Version)</span> - <a href="http://goo.gl/VMFnKc" target="_blank">see demo</a>
                </div>
                <div class="emgspacer">
                <input class="emgradiogalltype setaspro" type="radio" name="emgtinymce_mark_as" value="easymedia-fotorama" />Set as Fotorama Slider --- <span class="promarker">(PRO Version)</span> - <a href="http://goo.gl/k3tcl8" target="_blank">see demo</a>
                </div>                
                <div class="emgspacer">
                <input class="emgradiogalltype setaspro" type="radio" name="emgtinymce_mark_as" value="easymedia-carousel" />Set as Carousel --- <span class="promarker">(PRO Version)</span> - <a href="http://goo.gl/K1HGkR" target="_blank">see demo</a>
                </div>                   
               </div>
<div style="display:none;" id="thisgallresult"></div>            
</div><!-- #TAB-1 END  -->



<div id="tab-2">
<?php 
            global $optn;
            foreach ($optn as $value) {
                switch ($value['type']) {
                    case "text":
                        ?>

<div class="sc_input sc_text">
	<label for="<?php 
                        echo $value['id'];
                        ?>
"><?php 
                        echo $value['name'];
                        ?>
</label>	<br />
 	<input name="<?php 
                        echo $value['id'];
                        ?>
" id="<?php 
                        echo $value['id'];
                        ?>
" type="text" value="<?php 
                        $value['std'];
                        ?>
" />
<div class="clearfix"></div>
 </div>
<?php 
                        break;
                    case 'select':
                        ?>

<div class="sc_input sc_select" id="<?php 
                        echo $value['id'];
                        ?>
_div">
<label class="label_optionttl" for="<?php 
                        echo $value['id'];
                        ?>
"><?php 
                        echo $value['name'];
                        ?>
</label>
<select class="tinymce_select" name="<?php 
                        echo $value['id'];
                        ?>
" id="<?php 
                        echo $value['id'];
                        ?>
">
    <?php 
                        foreach ($value['options'] as $state) {
                            ?>
        <option id="<?php 
                            echo $state;
                            ?>
" value="<?php 
                            echo $state;
                            ?>
"><?php 
                            echo $state;
                            ?>
</option>
    <?php 
                        }
                        ?>
</select>

<div class="clearfix"></div>
</div>
<?php 
                        break;
                    case 'selectcat':
                        ?>

<div class="sc_input sc_select" id="<?php 
                        echo $value['id'];
                        ?>
_div">
<label class="label_optionttl" for="<?php 
                        echo $value['id'];
                        ?>
"><?php 
                        echo $value['name'];
                        ?>
</label>
<?php 
                        $states = get_terms('emediagallery', array('hide_empty' => true));
                        ?>
<select class="tinymce_select" name="<?php 
                        echo $value['id'];
                        ?>
" id="<?php 
                        echo $value['id'];
                        ?>
">
 <option id="default" value="default">Select</option>
    <?php 
                        foreach ($states as $state) {
                            ?>
        <option id="<?php 
                            echo $state->term_id;
                            ?>
" value="<?php 
                            echo $state->term_id;
                            ?>
"><?php 
                            echo $state->name;
                            ?>
</option>
    <?php 
                        }
                        ?>
</select>
<div class="clearfix"></div>
</div>
<?php 
                        break;
                    case 'selectmedia':
                        ?>

<div class="sc_input sc_select" id="<?php 
                        echo $value['id'];
                        ?>
_div">
<label class="label_optionttl" for="<?php 
                        echo $value['id'];
                        ?>
"><?php 
                        echo $value['name'];
                        ?>
</label>
	<select class="tinymce_select" name="<?php 
                        echo $value['id'];
                        ?>
" id="<?php 
                        echo $value['id'];
                        ?>
">
<?php 
                        global $post;
                        $args = array('post_type' => 'easymediagallery', 'order' => 'ASC', 'post_status' => 'publish', 'posts_per_page' => -1);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) {
                            setup_postdata($post);
                            ?>
<option id="<?php 
                            echo $post->ID;
                            ?>
" type="text" value="<?php 
                            echo $post->ID;
                            ?>
" /><?php 
                            echo esc_html(esc_js(the_title(NULL, NULL, FALSE)));
                            ?>
</option>
<?php 
                        }
                        /*
                        Thanks to Kevin Falcoz (aka 0pc0deFR) for this discovery and this patch.
                        ::: esc_html(esc_js(the_title(NULL, NULL, FALSE))); :::
                        */
                        ?>
</select>
<div class="clearfix"></div>
</div>
<?php 
                        break;
                }
            }
            ?>


<div class="sc_input sc_select" id="custom_col_div">
<label class="label_optionttl" for="emgtinymce_custom_columns">Custom columns</label>
                <div>
                <input type="hidden" name="emgtinymce_custom_columns" value="off" />
                <input class="switch" type="checkbox" id="emgtinymce_custom_columns" value="off" /></div>
			<div id="customcolumns" style="margin-top: 10px;">
		<label class="label_suboption">Columns :</label><div>
					
<select class="tinymce_select" name="select_custom_cola" id="select_custom_col">
        <option value="0">Select</option>
		 <option value="1">1</option>
		  <option value="2">2</option>
          <option value="3">3</option>
	</select>					
					</div></div>
<div class="clearfix"></div>
</div>

<div class="sc_input sc_select" id="custom_align_div">
<label class="label_optionttl" for="emgtinymce_custom_align">Custom alignment</label>
                <div>
                <input type="hidden" name="emgtinymce_custom_align" value="off" />
                <input class="switch" type="checkbox" id="emgtinymce_custom_align" value="off" /></div>
			<div id="customalign" style="margin-top: 10px;">
		<label class="label_suboption">Align :</label><div>					
<select class="tinymce_select" name="select_cus_align" id="select_cus_align">
        <option value="0">Select</option>
		   <option value="Center">Center</option>
           <option value="None">None</option>
	</select>					
					</div></div>
<div class="clearfix"></div>
</div>

<div style="display:none;" id="thisresult"></div>
</div><!-- #TAB-2 END  -->

<?php 
            if (easy_get_option('easymedia_disen_admnotify') == '1') {
                ?>
<div class="sc_input sc_select" id="upd_topro">
<p class="emg_blink" style="color:#F00;">UPGRADE to PRO Version and get Advanced Shortcode, <a target="_blank" href="<?php 
                echo plugins_url('includes/images/pro-version-shortcode-manager.png', dirname(__FILE__));
                ?>
" style="text-decoration:underline !important;">Click for Screenshot</a></p>
<div class="clearfix"></div>
</div> <?php 
            }
            ?>

</form>






</div> <!-- #TAB END  -->


<div class="sc_button1">
<input type="button" value="Insert Shortcode" name="emg_insert_scrt" id="emg_insert_scrt" class="button-secondary" />	
<div class="clearfix"></div>
</div>

</div>
</div>
<?php 
        }
    }
    //END
}
示例#7
0
function emg_put_script()
{
    wp_enqueue_script('fittext');
    if (easy_get_option('easymedia_plugin_core') != 'none') {
        wp_enqueue_script('mootools-core');
    }
    wp_enqueue_script('easymedia-core');
    wp_enqueue_script('easymedia-frontend');
    if (EMG_IS_AJAX == '1') {
        wp_enqueue_script('easymedia-ajaxfrontend');
    }
}
/*
|--------------------------------------------------------------------------
| CHECK PLUGIN DEFAULT SETTINGS
|--------------------------------------------------------------------------
*/
function emg_plugin_activate()
{
    add_option('Activated_Emg_Plugin', 'emg-activate');
}
register_activation_hook(__FILE__, 'emg_plugin_activate');
/*
|--------------------------------------------------------------------------
| PLUGIN AUTO UPDATE
|--------------------------------------------------------------------------
*/
$emg_is_auto_update = easy_get_option('easymedia_disen_autoupdt');
switch ($emg_is_auto_update) {
    case '1':
        if (!wp_next_scheduled("emg_auto_update")) {
            wp_schedule_event(time(), "daily", "emg_auto_update");
        }
        add_action("emg_auto_update", "plugin_emg_auto_update");
        break;
    case '':
        wp_clear_scheduled_hook("emg_auto_update");
        break;
}
function plugin_emg_auto_update()
{
    try {
        require_once ABSPATH . "wp-admin/includes/class-wp-upgrader.php";
示例#9
0
function easmedia_demo_page()
{
    wp_enqueue_style('emg-bootstrap-css');
    wp_enqueue_script('emg-bootstrap-js');
    ?>
    <div class="wrap">

   <div class="metabox-holder" style="display:inline-block; max-width: 30%; float:right; vertical-align:top;">
			<div class="postbox">
            <h3><?php 
    _e('Check it Out!', 'easmedia');
    ?>
</h3> 
            <?php 
    easmedia_news_metabox();
    ?>
           </div>
      </div>
<div class="metabox-holder" style="max-width:73%; display:block;">
			<div class="postbox">
				<h3><?php 
    _e('Subscribe and Get Free Updates', 'easmedia');
    ?>
</h3>
        <div id="easymedia_docs2" style="padding:10px !important; ">
<script src="https://apis.google.com/js/platform.js"></script>  <div class="g-ytsubscribe" data-channel="GhozyLab" data-layout="full"></div>
    </div>
    </div>
  </div>
  

<div class="metabox-holder" style="max-width:73%; display:block;">
			<div class="postbox">
				<h3><?php 
    _e('New Plugin, check it out!', 'easmedia');
    ?>
</h3>
        <div id="easymedia_docs3" style="padding:10px !important; ">
<a style="outline: none !important;" href="http://demo.ghozylab.com/plugins/easy-contact-form-plugin/" target="_blank"><img style="cursor:pointer;" src="<?php 
    echo plugins_url('images/best-cp-plugin.png', dirname(__FILE__));
    ?>
" width="728" height="90" alt="New Release!" ></a>
    </div>
    </div>
  </div>  
  
  
 <?php 
    if (easy_get_option('easymedia_disen_dasnews') == '1') {
        ?>
 <div class="metabox-holder" style="max-width:73%; display:block;">
			<div class="postbox">
				<h3><?php 
        _e('Share Easy Media Gallery', 'easmedia');
        ?>
</h3>
        <div id="easymedia_docs2" style="padding: 3px 3px 3px 17px !important; ">
        <?php 
        emg_dashboard_widget();
        ?>
    </div>
    </div>
  </div>
  <?php 
    }
    ?>

		<div class="metabox-holder" style="max-width:73%; display:block;">
			<div class="postbox">
				<h3><?php 
    _e('Video Tutorials', 'easmedia');
    ?>
</h3>
        <div id="easymedia_docs1" style="padding-left:10px !important;">
        <ul id="vidlist" style="list-style: square; position:relative; margin-left:15px; margin-bottom:25px">
        <li><a href="#" data-toggle="modal" data-target="#videoModal" data-theVideo="http://www.youtube.com/embed/pjHvRoV2Bn8">How to Create Simple Photo Albums</a>&nbsp;&nbsp;<i style="color:red;">(NEW Feature @since version 1.3.10)</i></li>
        <li><a href="#" data-toggle="modal" data-target="#videoModal" data-theVideo="http://www.youtube.com/embed/H1Z3fidyEbE">How to Create Simple Gallery</a>&nbsp;&nbsp;<i style="color:red;">(NEW Feature @since version 1.2.79)</i></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/dXFBNY5t6E8">How to Create Single Image Media</a></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/htxwZw_aPF0">How to Create Video Media Types</a></li>  
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/Bsn-CB5Hpbw">How to Create Audio (mp3) Media Types</a></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/Z2qwXz7GIRw">How to Publish Easy Media Gallery</a></li>                  
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/2T73wvt_wOA">How to Change Media Border Size and Color</a></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/56f_C7OXiAE">How to Change Media Columns</a></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/TQ1MMxhsyD8">How to Create Grid Gallery</a>&nbsp;&nbsp;<i>(Pro version)</i></li> 
		<li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/OEoNB2LpnSE">How to Create Portfolio</a>&nbsp;&nbsp;<i>(Pro version)</i></li>
        
		<li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/-N0JNcToHOI">How to Create Grid Gallery with Pagination</a>&nbsp;&nbsp;<i>(Pro version)</i></li>        
        
		<li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/skCMKvVLD5o">How to Set Order of Image</a>&nbsp;&nbsp;<i>(Pro version)</i></li>
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/Oee2cpKT-kE">How to Create Audio Soundcloud</a>&nbsp;&nbsp;<i>(Pro version)</i></li>
        
<li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/uAGWUcs5ofE">How to Fetch Youtube or Vimeo Thumbnail</a>&nbsp;&nbsp;<i>(Pro version)</i></li>        
        
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/SYH8Yl2SQd4">How to Create Audio Reverbnation</a>&nbsp;&nbsp;<i>(Pro version)</i></li>    
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/PEgfleRf6hg">How to Create Google Maps</a>&nbsp;&nbsp;<i>(Pro version)</i></li>               
        <li><a data-toggle="modal" data-target="#videoModal" href="#" data-theVideo="http://www.youtube.com/embed/9cuYyBMKx2k">How to Insert Image into Media Description</a>&nbsp;&nbsp;<i>(Pro version)</i></li>        
                          
        </ul>
    </div>
  </div> 
  
 <!-- Video on Modal  -->
<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="videoModal" aria-hidden="true">
    <div style="width: 835px; height:450px;" class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <div>
                    <iframe width="803" height="430" src=""></iframe>
                </div>
            </div>
        </div>
    </div>
</div> 
 <!-- End Video on Modal  -->  
 
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($) {

      var trigger =jQuery("body").find('[data-toggle="modal"]');
      trigger.click(function () {
          var theModal = jQuery(this).data("target"),
              videoSRC = jQuery(this).attr("data-theVideo"),
              videoSRCauto = videoSRC + "?autoplay=1&rel=0";
          jQuery(theModal + ' iframe').attr('src', videoSRCauto);
          jQuery(theModal + ' button.close').click(function () {
              jQuery(theModal + ' iframe').attr('src', videoSRC);
          });
          jQuery('.modal').click(function () {
              jQuery(theModal + ' iframe').attr('src', videoSRC);
          });
      });
	  
});
// ]]></script>
 
  
 </div>     

  </div> 
	<?php 
}
示例#10
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;
    }
}
示例#11
0
function spg_admin()
{
    global $emgplugname, $theshort, $theopt;
    $i = 0;
    $msgicon = plugins_url('images/confirm-check.png', __FILE__);
    if (isset($_REQUEST['saved'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings saved...';
    }
    if (isset($_REQUEST['reset'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings reset...';
    }
    ?>
<div id="spg_container">
    <div id="header">
      <div class="logo">
      <div class="emg-icon-option-left"></div>
        <div class="emg-cp-title"><h2><?php 
    echo EASYMEDIA_NAME . " (v " . EASYMEDIA_VERSION . ")";
    ?>
</h2></div>
      </div>
      <div class="emg-icon-option-right"> </div>
      <div style="clear: both;"></div>
    </div>

<div id="main">
<div style="width: auto;" class="infoboxdemo"><a target='_blank' href='https://ghozylab.com/plugins/'>Click Here to See Amazing Pro Version DEMO</a></div>
<div class="infoboxsaveorreset"><?php 
    echo $saveresmsg;
    ?>
</div>
<form method="post">
<div class="sps_wrap">
<div class="sps_opts">


<?php 
    settings_fields('easy_options_group');
    ?>

<?php 
    foreach ($theopt as $theval) {
        switch ($theval['type']) {
            case "open":
                ?>
	<?php 
                break;
            case "close":
                ?>
 
</div>
</div>
<br />

 
<?php 
                break;
            case 'text':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'margin':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input style="width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'size':
                $default = $theval['std'];
                $sizeall = easy_get_option($theval['id']);
                if (!is_array($sizeall) || empty($sizeall)) {
                    $sizeall = $default;
                }
                ?>
	
<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
   
 	<strong>Width</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[width]" id="<?php 
                echo $theval['id'];
                ?>
[width]" type="text" value="<?php 
                if ($sizeall['width'] != "") {
                    echo stripslashes($sizeall['width']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
    
<span style="border-right:solid 1px #CCC; margin-right:11px; margin-left:9px;"></span>
 	<strong>Height</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[height]" id="<?php 
                echo $theval['id'];
                ?>
[height]" type="text" value="<?php 
                if ($sizeall['height'] != "") {
                    echo stripslashes($sizeall['height']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'textarea':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows=""><?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'textareainfo':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea id="emgwpinfo" style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows="" readonly><?php 
                echo easmedia_get_wpinfo();
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'select':
                ?>

<div class="sps_input sps_select">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
<select name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
">
<?php 
                foreach ($theval['options'] as $option) {
                    ?>
		<option <?php 
                    if (easy_get_option($theval['id']) == $option) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option><?php 
                }
                ?>
</select>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "checkbox":
                ?>

<div class="sps_input sps_checkbox">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
<?php 
                easy_get_option($theval['id']) == 1 ? $checked = 'checked="checked"' : ($checked = '');
                ?>
<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" class="switch" type="checkbox" <?php 
                echo $checked;
                ?>
 value="1"></input>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>

<?php 
                break;
            case 'slider':
                ?>

<div class="sps_input">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
    <div id="<?php 
                echo $theval['id'];
                ?>
_slider" ></div><input style="margin-left:10px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "color":
                ?>

<div class="sps_input sps_text">
<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>

<div id="<?php 
                echo $theval['id'];
                ?>
_picker" class="colorSelector"><div></div></div>
<input style="margin-left:3px; width:75px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
<small><?php 
                echo $theval['desc'];
                ?>
</small>
<div class="clearfix"></div>
</div>


<?php 
                break;
            case 'pattern':
                ?>

<div class="sps_input">
	<label style="vertical-align:top !important;" for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
    <input type="hidden" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" />
    
    <div class="pattern_box">
    
                	<div style="float: left;" class="pattern_overlay <?php 
                if (!easy_get_option($theval['id']) || easy_get_option($theval['id']) == 'none') {
                    echo 'pattern_selected';
                }
                ?>
" id="no_pattern"> no pattern </div>
    
                <?php 
                foreach (easmedia_patterns_ls() as $pattern) {
                    easy_get_option($theval['id']) == $pattern ? $sel = 'pattern_selected' : ($sel = '');
                    echo '<div class="pattern_overlay ' . $sel . '" id="' . $pattern . '" style="background: url(' . plugins_url('css/images/patterns/', dirname(__FILE__)) . $pattern . ') repeat top left transparent;"></div>';
                }
                ?>
  
</div>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>


<?php 
                break;
            case "section":
                $i++;
                ?>

<div class="sps_section">
<?php 
                $imgpth = plugins_url('images/trans.png', __FILE__);
                ?>
<div class="sps_title"><h3><img src="<?php 
                echo $imgpth;
                ?>
" class="inactive" alt="""><?php 
                echo $theval['name'];
                ?>
</h3><span class="submit"><input name="save<?php 
                echo $i;
                ?>
" type="submit" value="Save Changes" class="button button-primary" />
</span><div class="clearfix"></div></div>
<div class="sps_options">

<?php 
                break;
        }
    }
    ?>
 
<input type="hidden" name="action" value="save" />
<p><a target="_blank" href="https://ghozylab.com/plugins/ordernow.php?order=proplus&utm_source=lite&utm_medium=settingspage&utm_campaign=orderfromcp" class="tsc_buttons2 red">Upgrade to Pro Version  &nbsp;for only $<?php 
    echo EASYMEDIA_PRICE;
    ?>
</a> <span style="color:#666666;margin-left:2px; font-size:11px;">&nbsp; Need More Features? Upgrade to Pro Version!</span></p>
 </div> </div>
 </form>
 </div>
 
<p class="submit">
<a onClick="return false;" class="emgresetnow button-secondary" title="Reset Options" href="#">Reset Options</a>
<span style="color:#666666;margin-left:2px; font-size:11px;"> Use this button to restore these settings to default.</span></p>
 </div>



<?php 
}
示例#12
0
    if (easy_get_option('easymedia_badge_pos') == 'Top Right') {
        echo 'span.emg-badges{right:1px; top:1px;}';
    } else {
        if (easy_get_option('easymedia_badge_pos') == 'Bottom Right') {
            echo 'span.emg-badges{right:1px; bottom:1px;}';
        } else {
            if (easy_get_option('easymedia_badge_pos') == 'Bottom Left') {
                echo 'span.emg-badges{left:1px; bottom:1px;}';
            } else {
                if (easy_get_option('easymedia_badge_pos') == 'Bottom Center') {
                    echo 'span.emg-badges{right:0; left:0; bottom: 1px; margin: auto;}';
                } else {
                    if (easy_get_option('easymedia_badge_pos') == 'Top Center') {
                        echo 'span.emg-badges{right:0; left:0; top:1px; margin: auto;}';
                    } else {
                        if (easy_get_option('easymedia_badge_pos') == 'Center') {
                            echo 'span.emg-badges{top: 0;right: 0;bottom: 0;left: 0;margin: auto;}';
                        } else {
                            echo 'span.emg-badges{right:1px; top:1px;}';
                        }
                    }
                }
            }
        }
    }
}
// CUSTOM CSS
if ($cuscss != '') {
    echo $cuscss;
    echo "\n";
}
示例#13
0
function spg_admin()
{
    global $emgplugname, $theshort, $theopt;
    $i = 0;
    $msgicon = plugins_url('images/confirm-check.png', __FILE__);
    if (isset($_REQUEST['saved'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings saved...';
    }
    if (isset($_REQUEST['reset'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings reset...';
    }
    ?>
<div id="spg_container">
    <div id="header">
      <div class="logo">
        <h2><?php 
    echo $emgplugname . "  (v " . easymedia_get_plugin_version() . ")";
    ?>
</h2>
      </div>
      <div class="icon-option"> </div>
      <div style="clear: both;"></div>
    </div>

<div id="main">
<div class="infoboxsaveorreset"><?php 
    echo $saveresmsg;
    ?>
</div>
<form method="post">
<div class="sps_wrap">
<div class="sps_opts">


<?php 
    settings_fields('easy_options_group');
    ?>

<?php 
    foreach ($theopt as $theval) {
        switch ($theval['type']) {
            case "open":
                ?>
	<?php 
                break;
            case "close":
                ?>
 
</div>
</div>
<br />

 
<?php 
                break;
            case 'text':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'margin':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input style="width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'size':
                $default = $theval['std'];
                $sizeall = easy_get_option($theval['id']);
                if (!is_array($sizeall) || empty($sizeall)) {
                    $sizeall = $default;
                }
                ?>
	
<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
   
 	<strong>Width</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[width]" id="<?php 
                echo $theval['id'];
                ?>
[width]" type="text" value="<?php 
                if ($sizeall['width'] != "") {
                    echo stripslashes($sizeall['width']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
    
<span style="border-right:solid 1px #CCC; margin-right:11px; margin-left:9px;"></span>
 	<strong>Height</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[height]" id="<?php 
                echo $theval['id'];
                ?>
[height]" type="text" value="<?php 
                if ($sizeall['height'] != "") {
                    echo stripslashes($sizeall['height']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'textarea':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows=""><?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'select':
                ?>

<div class="sps_input sps_select">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
<select name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
">
<?php 
                foreach ($theval['options'] as $option) {
                    ?>
		<option <?php 
                    if (easy_get_option($theval['id']) == $option) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option><?php 
                }
                ?>
</select>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "checkbox":
                ?>

<div class="sps_input sps_checkbox">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
<?php 
                easy_get_option($theval['id']) == 1 ? $checked = 'checked="checked"' : ($checked = '');
                ?>
<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" class="switch" type="checkbox" <?php 
                echo $checked;
                ?>
 value="1"></input>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>

<?php 
                break;
            case 'slider':
                ?>

<div class="sps_input">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
    <div id="<?php 
                echo $theval['id'];
                ?>
_slider" ></div><input style="margin-left:10px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "color":
                ?>

<div class="sps_input sps_text">
<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>

<div id="<?php 
                echo $theval['id'];
                ?>
_picker" class="colorSelector"><div></div></div>
<input style="margin-left:3px; width:75px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
<small><?php 
                echo $theval['desc'];
                ?>
</small>
<div class="clearfix"></div>
</div>


<?php 
                break;
            case 'pattern':
                ?>

<div class="sps_input">
	<label style="vertical-align:top !important;" for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
    <input type="hidden" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" />
    
    <div class="pattern_box">
    
                	<div style="float: left;" class="pattern_overlay <?php 
                if (!easy_get_option($theval['id']) || easy_get_option($theval['id']) == 'none') {
                    echo 'pattern_selected';
                }
                ?>
" id="no_pattern"> no pattern </div>
    
                <?php 
                foreach (easmedia_patterns_ls() as $pattern) {
                    easy_get_option($theval['id']) == $pattern ? $sel = 'pattern_selected' : ($sel = '');
                    echo '<div class="pattern_overlay ' . $sel . '" id="' . $pattern . '" style="background: url(' . plugins_url('css/images/patterns/', dirname(__FILE__)) . $pattern . ') repeat top left transparent;"></div>';
                }
                ?>
  
</div>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>


<?php 
                break;
            case "section":
                $i++;
                ?>

<div class="sps_section">
<?php 
                $imgpth = plugins_url('images/trans.png', __FILE__);
                ?>
<div class="sps_title"><h3><img src="<?php 
                echo $imgpth;
                ?>
" class="inactive" alt="""><?php 
                echo $theval['name'];
                ?>
</h3><span class="submit"><input name="save<?php 
                echo $i;
                ?>
" type="submit" value="Save Changes" class="button button-primary" />
</span><div class="clearfix"></div></div>
<div class="sps_options">

<?php 
                break;
        }
    }
    ?>
 
<input type="hidden" name="action" value="save" />
 </div> </div>
 </form>
 </div>
 
<form method="post">
<p class="submit">
<input class="button button-secondary" name="reset" type="submit" value="Reset Options" onclick="return confirm('Are you sure? This will restore these settings to default.');"/>
<input type="hidden" name="action" value="reset" />
<span style="color:#666666;margin-left:2px; font-size:11px;"> Use this button to restore these settings to default.</span></p>
</form>
 
 </div>



<?php 
}
示例#14
0
function easymedia_sc_handler($scdata, $scl)
{
    switch ($scl) {
        case '0':
            if ($scdata != '' && $scdata <= 3) {
                $finaldata = $scdata;
            } else {
                $finaldata = easy_get_option('easymedia_columns');
            }
            break;
        case '1':
            if ($scdata != '' && $scdata == 'center' || $scdata != '' && $scdata == 'none') {
                $finaldata = $scdata;
            } else {
                $finaldata = strtolower(easy_get_option('easymedia_alignstyle'));
            }
            break;
        default:
            break;
    }
    return $finaldata;
}
示例#15
0
function ajax_req_handle($id, $isdinamccntn)
{
    global $post;
    $usegalleryinfo = get_post_meta($id, 'easmedia_metabox_media_gallery_opt2', true);
    if ($isdinamccntn != '') {
        if ($usegalleryinfo == 'on') {
            $img_info = get_post($isdinamccntn);
            $boxmediattl = $img_info->post_title;
            $boxmediasbttl = $img_info->post_excerpt;
            $boxshortdecs = $img_info->post_content;
            $boxshortdecs = str_replace("\r", "", $boxshortdecs);
            $boxshortdecs = str_replace("\n", "", $boxshortdecs);
            $boxshortdecs = do_shortcode(wpautop($boxshortdecs));
        } else {
            $boxshortdecs = do_shortcode(wpautop(get_post_meta($id, 'easmedia_metabox_shordesc', true)));
            //$boxshortdecs = get_post_meta( $id, 'easmedia_metabox_shordesc', true );
            $boxmediattl = get_post_meta($id, 'easmedia_metabox_title', true);
            $boxmediasbttl = get_post_meta($id, 'easmedia_metabox_sub_title', true);
        }
    } else {
        $boxshortdecs = do_shortcode(wpautop(get_post_meta($id, 'easmedia_metabox_shordesc', true)));
        //$boxshortdecs = get_post_meta( $id, 'easmedia_metabox_shordesc', true );
        $boxmediattl = get_post_meta($id, 'easmedia_metabox_title', true);
        $boxmediasbttl = get_post_meta($id, 'easmedia_metabox_sub_title', true);
    }
    $imgsrc = get_post_meta($id, 'easmedia_metabox_img', true);
    $mediatype = get_post_meta($id, 'easmedia_metabox_media_type', true);
    $domname = preg_replace('/^www\\./', '', $_SERVER['SERVER_NAME']);
    switch ($mediatype) {
        case 'Single Image':
            $boxlink = $imgsrc;
            break;
        case 'Multiple Images (Slider)':
            $boxlink = wp_get_attachment_image_src($isdinamccntn, 'full');
            $imgsrc = $boxlink[0];
            $boxlink = $boxlink[0];
            //$boxlink = $imgsrc;
            break;
        case 'Video':
            $boxlink = get_post_meta($id, 'easmedia_metabox_media_video', true);
            break;
        case 'Audio':
            $boxlink = get_post_meta($id, 'easmedia_metabox_media_audio', true);
            break;
        case 'Google Maps':
            $boxlink = get_post_meta($id, 'easmedia_metabox_media_gmap', true);
            break;
        case 'Link':
            $boxlink = get_post_meta($id, 'easmedia_metabox_media_link', true);
            $link_type = get_post_meta($id, 'easmedia_metabox_media_link_opt1', true);
            if ($boxlink != '') {
                $media_link_fin = $boxlink;
            } else {
                $media_link_fin = $post->guid;
            }
            $boxlink = $media_link_fin;
            break;
    }
    $isfb = easy_get_option('easymedia_disen_fb');
    $istwt = easy_get_option('easymedia_disen_twt');
    $ispin = easy_get_option('easymedia_disen_pin');
    $tempdesc = strlen($boxshortdecs);
    $trim_length = 200;
    if ($boxshortdecs) {
        if ($tempdesc > $trim_length) {
            $shortenerdesc = rtrim(substr($boxshortdecs, 0, $trim_length - 3));
            $shortenerdesc = $shortenerdesc . "...";
        } else {
            $shortenerdesc = rtrim(substr($boxshortdecs, 0, $trim_length));
        }
    } else {
        $shortenerdesc = "Description goes here...";
    }
    //if ( $boxmediattl == '' && get_the_title( $id ) == '' ) {$sharemediattl = 'Media';}
    //else if ( $boxmediattl == '' && get_the_title( $id ) != '' ) {$sharemediattl = get_the_title( $id );}
    if ($boxmediattl == '' && get_the_title($id) == '') {
        $sharemediattl = 'Media';
    }
    if ($boxmediattl == '' && get_the_title($id) != '') {
        $sharemediattl = get_the_title($id);
    }
    if ($boxmediattl != '' && get_the_title($id) != '') {
        $sharemediattl = $boxmediattl;
    }
    ob_start();
    if ($isfb || $istwt || $ispin) {
        ?>

              <div id="mbsosmed">
            	<ul>
                <?php 
        if ($isfb) {
            ?>
                  <li id="sosmedfb">
					<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php 
            echo urlencode($sharemediattl);
            ?>
&amp;p[summary]=<?php 
            echo urlencode(strip_tags($shortenerdesc));
            ?>
&amp;p[url]=CONVTOURL&amp;&amp;p[images][0]=<?php 
            echo urlencode($imgsrc);
            ?>
','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)"><span title="Share it!"></span></a>
                  </li>
                  <?php 
        }
        ?>

                <?php 
        if ($istwt) {
            ?>
                  <li id="sosmedtw">
					<a onClick="window.open('https://twitter.com/share?text=<?php 
            echo urlencode('Check out "' . $sharemediattl . '" on ' . get_bloginfo('name'));
            ?>
&url=CONVTOURL','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)"><span title="Tweet it!"></span></a>
                  </li>
                  <?php 
        }
        ?>
                  
                <?php 
        if ($ispin) {
            ?>
                  
                  <li id="sosmedpn">
                  	<a onClick="window.open('http://pinterest.com/pin/create/button/?url=<?php 
            echo urlencode($boxlink);
            ?>
&media=<?php 
            echo urlencode($imgsrc);
            ?>
&description=<?php 
            echo urlencode(strip_tags($shortenerdesc));
            ?>
','sharer','toolbar=0,status=0,width=575,height=330');" href="javascript: void(0)"><span title="Pin it!"></span></a>
                  </li>
                  <?php 
        }
        ?>
                  
                </ul>
              </div>
            <?php 
    }
    $content = ob_get_clean();
    if ($boxmediattl == '') {
        $boxmediattl = 'none';
    }
    if ($content == '') {
        $content = 'none';
    }
    if ($boxmediasbttl == '') {
        $boxmediasbttl = 'none';
    }
    if ($boxshortdecs == '') {
        $boxshortdecs = 'none';
    }
    $therest = array($boxmediattl, $boxmediasbttl, html_entity_decode(htmlspecialchars($boxshortdecs)), $content);
    echo json_encode($therest);
    exit;
}
示例#16
0
function emg_dynamic_css_generator()
{
    //Get Plugin settings
    $frmcol = easy_get_option('easymedia_frm_col');
    $shdcol = easy_get_option('easymedia_shdw_col');
    $mrgnbox = easy_get_option('easymedia_margin_box');
    $imgborder = easy_get_option('easymedia_frm_border');
    $curstyle = strtolower(easy_get_option('easymedia_cur_style'));
    $imgbbrdrradius = easy_get_option('easymedia_brdr_rds');
    $disenbor = easy_get_option('easymedia_disen_bor');
    $disenshadow = easy_get_option('easymedia_disen_sdw');
    $brdrbtm = $mrgnbox * 2;
    $marginhlf = $mrgnbox / 2;
    $theoptstl = easy_get_option('easymedia_frm_size');
    $globalwidth = stripslashes($theoptstl['width']);
    $pattover = easy_get_option('easymedia_style_pattern');
    $overcol = easy_get_option('easymedia_overlay_col');
    $ttlcol = easy_get_option('easymedia_ttl_col');
    $thumbhov = ucfirst(easy_get_option('easymedia_hover_style')) . '.png';
    $thumbhov = plugins_url('css/images/' . $thumbhov . '', dirname(__FILE__));
    $thumbhovcol = easymedia_hex2rgb(easy_get_option('easymedia_thumb_col'));
    $thumbhovcolopcty = easy_get_option('easymedia_hover_opcty') / 100;
    $thumbiconcol = easy_get_option('easymedia_icon_col');
    $disenico = easy_get_option('easymedia_disen_ticon');
    $borderrgba = easymedia_hex2rgb(easy_get_option('easymedia_frm_col'));
    $borderrgbaopcty = easy_get_option('easymedia_thumb_border_opcty') / 100;
    ob_start();
    // IMAGES
    echo '.view {margin-bottom:' . $mrgnbox . 'px; margin-right:' . $marginhlf . 'px; margin-left:' . $marginhlf . 'px;}';
    echo '.da-thumbs article.da-animate p{color:' . $ttlcol . ' !important;}';
    if (easy_get_option('easymedia_disen_icocol') == '1') {
        echo 'span.link_post, span.zoom, span.zooma {background-color:' . $thumbiconcol . ';}';
    }
    if (easy_get_option('easymedia_disen_hovstyle') == '1') {
        echo '.da-thumbs article.da-animate {cursor: ' . $curstyle . ';}';
    } else {
        echo '.da-thumbs img {cursor: ' . $curstyle . ';}';
    }
    $imgbbrdrradius != '' ? $addborradius = '.view,.view img,.da-thumbs,.da-thumbs article.da-animate {border-radius:' . $imgbbrdrradius . 'px;}' : ($addborradius = '');
    echo $addborradius;
    $disenbor == 1 ? $addborder = '.view {border: ' . $imgborder . 'px solid rgba(' . $borderrgba . ',' . $borderrgbaopcty . ');}' : ($addborder = '');
    echo $addborder;
    $disenico == 1 ? $showicon = '' : ($showicon = '.forspan {display: none !important;}');
    echo $showicon;
    $disenshadow == 1 ? $addshadow = '.view {-webkit-box-shadow: 1px 1px 3px ' . $shdcol . ';
   -moz-box-shadow: 1px 1px 3px ' . $shdcol . ';
   box-shadow: 1px 1px 3px ' . $shdcol . ';}' : ($addshadow = '.view { box-shadow: none !important; -moz-box-shadow: none !important; -webkit-box-shadow: none !important;}');
    echo $addshadow;
    // MEDIA BOX Patterns
    if ($pattover != '' || $pattover != 'no_pattern') {
        echo '#mbOverlay {background: url(' . EASYMEDG_PLUGIN_URL . 'css/images/patterns/' . $pattover . '); background-repeat: repeat;}';
    }
    // Thumbnails Title Background color @since 1.2.61
    echo '.da-thumbs article.da-animate p { background: rgba(' . easymedia_hex2rgb(easy_get_option('easymedia_ttl_back_col')) . ',0.5) !important;}';
    // IE <8 Handle
    preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
    if (isset($matches)) {
        if (count($matches) > 1 && $disenbor == 1) {
            $version = explode(".", $matches[1]);
            switch (true) {
                case $version[0] <= '8':
                    echo '.view {border: 1px solid ' . $shdcol . ';}';
                    echo '.iehand {border: ' . $imgborder . 'px solid ' . $frmcol . ';}';
                    echo '.da-thumbs article{position: absolute; background-image:url(' . $thumbhov . '); background-repeat:repeat; width: 100%; height: 100%;}';
                    break;
                case $version[0] > '8':
                    $disenbor == 1 ? $addborder = '.view {border: ' . $imgborder . 'px solid rgba(' . $borderrgba . ',' . $borderrgbaopcty . ');}' : ($addborder = '');
                    echo $addborder;
                    echo '.da-thumbs article{position: absolute; background: rgba(' . $thumbhovcol . ',' . $thumbhovcolopcty . '); background-repeat:repeat; width: 100%; height: 100%;}';
                    break;
                default:
                    break;
            }
        } else {
            if (count($matches) > 1 && $disenbor != '1') {
                echo '.da-thumbs article{position: absolute; background-image:url(' . $thumbhov . '); background-repeat:repeat; width: 100%; height: 100%;}';
            } else {
                echo '.da-thumbs article{position: absolute; background: rgba(' . $thumbhovcol . ',' . $thumbhovcolopcty . '); background-repeat:repeat; width: 100%; height: 100%;}';
            }
        }
    }
    // Magnify Icon
    if (easy_get_option('easymedia_mag_icon') != '' && $disenico == 1) {
        echo '	
span.zoom{
background-image:url(' . EASYMEDG_PLUGIN_URL . 'css/images/magnify/' . easy_get_option('easymedia_mag_icon') . '.png); background-repeat:no-repeat; background-position:center;
}';
    }
    $content = ob_get_clean();
    echo emg_css_compress($content);
}
示例#17
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>';
}
示例#18
0
function emg_thumb_src($img_src, $width, $height, $gsze1, $gsze2)
{
    if (!$img_src) {
        return false;
    }
    if (is_multisite()) {
        return false;
    }
    if (easy_get_option('easymedia_disen_tthumb') == '1') {
        $emg_thumb_url = EMG_THUMB_FILE . "?src=" . $img_src . "&h=" . $height . "&w=" . $width . "&zc=1&q=100";
    } else {
        if ($gsze1 != '0' && $gsze2 != '0') {
            $gsize1 = $gsze1;
            $gsize2 = $gsze2;
        } else {
            $globalsize = wp_get_attachment_image_src(emg_get_attachment_id_from_src($img_src), 'full');
            $gsize1 = $globalsize[1];
            $gsize2 = $globalsize[2];
        }
        $emg_thumb_url = easymedia_resizer($img_src, $gsize1, $gsize2, $width, $height, true);
    }
    return $emg_thumb_url;
}