当前位置: 首页>>代码示例>>PHP>>正文


PHP media_upload_header函数代码示例

本文整理汇总了PHP中media_upload_header函数的典型用法代码示例。如果您正苦于以下问题:PHP media_upload_header函数的具体用法?PHP media_upload_header怎么用?PHP media_upload_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了media_upload_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: S2FilePicker_frame

function S2FilePicker_frame()
{
    media_upload_header();
    $path = WP_PLUGIN_DIR . '/s2member-files';
    $files = glob($path . '/*.{mp3,mp4,avi,mpeg,doc,docx,pdf,txt}', GLOB_BRACE);
    $html = '<form action="" id="s2member-files-archive-form">';
    foreach ($files as $i => $file) {
        $html .= '<input type="checkbox" data-filename="' . basename($file) . '" class="file" name="file[]" />';
        $html .= basename($file);
    }
    $html .= '
		<br />
		<br />
		<button type="button" onclick="javascript:s2member_files_pick();">' . esc_attr(__('Link selected files')) . '</button>
		<script>
		function s2member_files_pick() {
			jQuery("#s2member-files-archive-form").find("input[type=checkbox]:checked").each(function(index, el) {
				var $check = jQuery(el);
				parent.send_to_editor(\'[s2Link download="\' +$check.data("filename")+ \'" download_key="true" /]\');
			});
			
			parent.tb_remove();
		}
		</script>
	</form>
	';
    echo $html;
}
开发者ID:hiryu85,项目名称:s2member-secure-file-picker,代码行数:28,代码来源:s2member-secure-file-picker.php

示例2: insert_media_upload

 function insert_media_upload()
 {
     global $wp_version;
     if ($wp_version < '2.6') {
         add_action('admin_head_middmedia_media_upload', 'media_admin_css');
     } else {
         wp_admin_css('media');
     }
     media_upload_header();
     return wp_iframe('middmedia_media_upload', $this);
 }
开发者ID:adamfranco,项目名称:middmedia-wordpressplugin,代码行数:11,代码来源:middmedia.php

示例3: media_upload_crystal_form

function media_upload_crystal_form()
{
    global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $redir_tab;
    $redir_tab = 'crystal';
    media_upload_header();
    $post_id = intval($_REQUEST['post_id']);
    $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=crystal&post_id={$post_id}");
    ?>
<script type="text/javascript">
<!--
jQuery(function($){
	var preloaded = $(".media-item.preloaded");
	if ( preloaded.length > 0 ) {
		preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
	}
	updateMediaForm();
});
-->
</script>
<form enctype="multipart/form-data" method="post" action="<?php 
    echo attribute_escape($form_action_url);
    ?>
" class="media-upload-form validate" id="gallery-form">
<div id="media-items">
<?php 
    echo get_media_items($post_id, $errors);
    ?>
</div>
<input type="submit" class="button" name="save" value="<?php 
    echo attribute_escape(__('Save all changes'));
    ?>
" />
<input type="submit" class="button" name="insert-gallery" value="<?php 
    echo attribute_escape(__('Insert Crystal gallery!'));
    ?>
" />
<input type="hidden" name="post_id" id="post_id" value="<?php 
    echo (int) $post_id;
    ?>
" />
<input type="hidden" name="type" value="<?php 
    echo attribute_escape($GLOBALS['type']);
    ?>
" />
<input type="hidden" name="tab" value="<?php 
    echo attribute_escape($GLOBALS['tab']);
    ?>
" />
</p>
</form>
<?php 
}
开发者ID:shell,项目名称:Crystal-Gallery,代码行数:52,代码来源:crystal.php

示例4: media_upload_gallery_form

 function media_upload_gallery_form($errors)
 {
     global $redir_tab, $type;
     $redir_tab = 'gallery';
     media_upload_header();
     $post_id = intval($_REQUEST['post_id']);
     $form_action_url = admin_url("media-upload.php?type={$type}&tab=gallery&post_id={$post_id}");
     $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
     $form_class = 'media-upload-form validate';
     if (get_user_setting('uploader')) {
         $form_class .= ' html-uploader';
     }
     require_once dirname(__FILE__) . '/view/gallery_form.php';
 }
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:14,代码来源:init.php

示例5: upload_test_upload_form

function upload_test_upload_form()
{
    //echos the tabs at the top of the media window
    media_upload_header();
    //Adds your javascript
    upload_test_scripts();
    ?>
	<div class="test-form">
		<input type='text' id='name' />
		<input id='insert_shortcode' type='button' class='button' value='Insert Shortcode'>
	</div> 	

<?php 
}
开发者ID:aaronbrosef,项目名称:Wordpress-Plugin--Media-Upload-Skeleton,代码行数:14,代码来源:upload-media.php

示例6: media_imgbedtab_form

function media_imgbedtab_form()
{
    $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
    $files = imgbed_get_files($post_id);
    media_upload_header();
    if (is_array($files) && count($files) > 0) {
        $msg = '点击图片添加到文章';
    } else {
        $msg = '还没有上传图片';
    }
    echo '<div style="margin-top:20px; margin:1em;"><h3 class="media-title">' . $msg . '</h3>';
    echo '<script type="text/javascript">imgbed_files = ' . json_encode($files, true) . '</script>';
    echo '<div id="media-tuku"></div></div>';
}
开发者ID:yakeing,项目名称:imgbed,代码行数:14,代码来源:media_imgbedtab_form.php

示例7: media_upload_flickr_form

function media_upload_flickr_form()
{
    global $type, $tab, $post_mime_types, $flickr_manager;
    add_filter('media_upload_tabs', array($flickr_manager, 'modifyMediaTab'));
    ?>
	
	<div id="media-upload-header">
		<?php 
    media_upload_header();
    ?>
	</div>
	
    <?php 
    flickrMediaBrowse();
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:15,代码来源:MediaPanel.php

示例8: media_cincopabox_process

function media_cincopabox_process()
{
    if (isset($_REQUEST['wrt'])) {
        _cpmp_media_upload_type_cincopa();
        return;
    }
    if (sizeof($_POST) > 0) {
        var_dump($_POST);
    }
    media_upload_header();
    ?>
    <iframe src="<?php 
    echo _cpmp_url() . '/media-platform/start.aspx?ver=' . _cpmp_plugin_ver() . '&rdt=' . urlencode(_cpmp_selfURL() . "&");
    ?>
&" width="100%" height="98%"></iframe>
    <?php 
}
开发者ID:samuelshih,项目名称:daily-gazette,代码行数:17,代码来源:wp-media-cincopa.php

示例9: media_upload_type_s2sfu

/**
 * Modified From media_upload_type_form in WordPress 3.2.1 Core
 * {@internal Missing Short Description}}
 *
 * @since 2.5.0
 *
 * @param unknown_type $type
 * @param unknown_type $errors
 * @param unknown_type $id
 */
function media_upload_type_s2sfu($type = 'file', $errors = null, $id = null)
{
    media_upload_header();
    $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
    $form_action_url = admin_url("media-upload.php?type={$type}&tab=type&post_id={$post_id}");
    $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
    ?>
	
	<form enctype="multipart/form-data" method="post" action="<?php 
    echo esc_attr($form_action_url);
    ?>
" class="media-upload-form type-form validate" id="<?php 
    echo $type;
    ?>
-form">
	<?php 
    submit_button('', 'hidden', 'save', false);
    ?>
	<input type="hidden" name="post_id" id="post_id" value="<?php 
    echo (int) $post_id;
    ?>
" />
	<?php 
    wp_nonce_field('media-form');
    ?>
	
	<h3 class="media-title"><?php 
    _e('Add media files from your computer');
    ?>
</h3>
	
	<?php 
    s2sfu_media_upload_form($errors);
    ?>
	
	</form>
	<?php 
}
开发者ID:hiryu85,项目名称:s2member-secure-file-uploader,代码行数:48,代码来源:s2member-secure-file-uploader.php

示例10: media_pac_pickapic_final_form

/**
 * Download the picture selected, associate it to the post and displays the 
 * final form using get_media_item()
 *
 * @param noting.
 * @return noting.
 **/
function media_pac_pickapic_final_form()
{
    global $type, $wp_version;
    $post_id = absint($_REQUEST['post_id']);
    $form_action_url = admin_url("media-upload.php?type={$type}&tab=pickapictab&post_id={$post_id}");
    $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
    media_upload_header();
    $flickr_info = pac_pickapic_flickr_getInfo($_POST['pac_pickapic_flickr_id']);
    $photo_url = pac_pickapic_flickr_getSizes($_POST['pac_pickapic_flickr_id']);
    if (is_wp_error($photo_url)) {
        pac_pickapic_show_error($rsp_obj);
        return;
    }
    ?>
    <form id="pickapic-media-form" enctype="multipart/form-data" action="<?php 
    echo esc_html($form_action_url);
    ?>
" class="media-upload-form type-form validate" method="post">
        <?php 
    wp_nonce_field('media-form');
    ?>

        <div id="media-items">
            <?php 
    if (version_compare($wp_version, '3.4', '<')) {
        $excerpt = __('Foto: ' . $flickr_info['owner'], 'pickapic');
    } else {
        $excerpt = __('Foto: ', 'pickapic') . "<a href='" . $flickr_info['url'] . "' target='_blank'>" . $flickr_info['owner'] . "</a>";
        $show_license = pac_pickapic_get_option('flickrshowlicense');
        if ($show_license) {
            $flickr_licenses = unserialize(PICKAPIC_FLICKR_LICENSES);
            $excerpt .= ' - ' . $flickr_licenses[$flickr_info['license']];
        }
    }
    $attachment_id = pac_pickapic_media_sideload_image($photo_url, $post_id, '', array('post_title' => __($flickr_info['title'], 'pickapic'), 'post_excerpt' => $excerpt), $flickr_info['url'], $flickr_info['owner']);
    if (is_wp_error($attachment_id)) {
        echo '<div id="media-upload-error">' . esc_html($attachment_id->get_error_message()) . '</div></div>';
    } else {
        // Render the form content using get_media_item
        $args = array('toggle' => false, 'show_title' => true);
        echo get_media_item($attachment_id, $args);
    }
    ?>
        </div>
    </form>
    <?php 
}
开发者ID:AK-Digitale-Gesellschaft,项目名称:flickr-pick-a-picture,代码行数:54,代码来源:pick-a-pic.php

示例11: thickboxInclude

 function thickboxInclude()
 {
     $pages = array('ecordia-score', 'ecordia-keyword-analysis', 'ecordia-change-keywords', 'ecordia-tags', 'ecordia-serp', 'ecordia-seo-best-practices', 'ecordia-error');
     if (defined('ECORDIA_DEBUG') && ECORDIA_DEBUG) {
         $pages[] = 'ecordia-debug';
     }
     $tab = in_array($_GET['tab'], $pages) ? $_GET['tab'] : 'ecordia-score';
     $page = str_replace('ecordia-', '', $tab);
     if (false === strpos($tab, 'error')) {
         add_filter('media_upload_tabs', array(&$this, 'thickboxTabs'));
         media_upload_header();
     }
     $info = $this->getSeoInfoForPost($_GET['post']);
     if (false === $info && false === strpos($tab, 'error')) {
         print '<form><p>No analysis present.</p></form>';
         return;
     }
     include 'views/popup/' . $page . '.php';
 }
开发者ID:simpsonjulian,项目名称:puppet-wordpress,代码行数:19,代码来源:scribe.php

示例12: media_upload_shared_media

    /**
     * {@internal Missing Short Description}}
     *
     * @since 2.5.0
     *
     * @param unknown_type $errors
     */
    function media_upload_shared_media($errors)
    {
        global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $blog_id;
        media_upload_header();
        if (count($this->blogs) == 0) {
            echo '<form><h3 class="media-title">' . __("You don't have access to any other sites media...", 'networksharedmedia') . '</h3></form>';
            return;
        }
        // set the first part of the form action url now, to the current active site, to prevent X-Frame-Options problems
        $form_action_url = plugins_url('media-upload.php', __FILE__);
        $nsm_blog_id = null;
        if (!array_key_exists('blog_id', $_GET)) {
            $_GET['blog_id'] = null;
        }
        foreach ($this->blogs as $blog) {
            if ($_GET['blog_id'] == $blog['blog_id']) {
                $nsm_blog_id = $blog['blog_id'];
                break;
            }
        }
        if (null == $nsm_blog_id) {
            $nsm_blog_id = $this->blogs[0]['blog_id'];
        }
        switch_to_blog($nsm_blog_id);
        ?>

<?php 
        $post_id = intval($_REQUEST['post_id']);
        // fix to make get_media_item add "Insert" button
        unset($_GET['post_id']);
        $form_action_url .= "?type={$type}&tab=library&post_id={$post_id}&blog_id={$blog_id}";
        $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
        $form_class = 'media-upload-form validate';
        $_GET['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 0;
        if ($_GET['paged'] < 1) {
            $_GET['paged'] = 1;
        }
        $start = ($_GET['paged'] - 1) * 10;
        if ($start < 1) {
            $start = 0;
        }
        add_filter('post_limits', create_function('$a', "return 'LIMIT {$start}, 10';"));
        list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
        ?>
	
	<form id="filter" action="" method="get">
	<input type="hidden" name="type" value="<?php 
        echo esc_attr($type);
        ?>
" />
	<input type="hidden" name="tab" value="<?php 
        echo esc_attr($tab);
        ?>
" />
	<input type="hidden" name="post_id" value="<?php 
        echo (int) $post_id;
        ?>
" />
	<input type="hidden" name="blog_id" value="<?php 
        echo (int) $blog_id;
        ?>
" />
	<input type="hidden" name="post_mime_type" value="<?php 
        echo isset($_GET['post_mime_type']) ? esc_attr($_GET['post_mime_type']) : '';
        ?>
" />
	<?php 
        if (isset($_GET['chromeless'])) {
            ?>
	<input type="hidden" name="chromeless" value="<?php 
            echo (bool) $_GET['chromeless'];
            ?>
" />
	<?php 
        }
        ?>

	<style type="text/css">
		#media-upload #filter .nsm-site-select { float: none; width: 100%; margin: 0 1em 2em 1em; white-space: normal; }
	</style>

	<ul class="subsubsub nsm-site-select">
	<?php 
        if (count($this->blogs) == 1) {
            $blog = reset($this->blogs);
            echo "<li>" . __('Selected site:', 'networksharedmedia') . "</li>" . "<li><a href='" . esc_url(add_query_arg(array('blog_id' => $blog['blog_id'], 'paged' => false))) . "' class='current'>" . $blog['name'] . '</a>' . '</li>';
        } else {
            $all_blog_names = array();
            foreach ($this->blogs as $blog) {
                $all_blog_names[] = $blog['name'];
            }
            if (strlen(__('Select site:', 'networksharedmedia') . ' ' . implode(' | ', $all_blog_names)) < 71) {
                $blog_links = array();
//.........这里部分代码省略.........
开发者ID:Buooy,项目名称:wp_network_shared_media,代码行数:101,代码来源:network_shared_media.php

示例13: popup_wp_upload

    function popup_wp_upload($errors)
    {
        global $redir_tab, $type, $tab;
        $redir_tab = 'wp_upload';
        media_upload_header();
        $flash_action_url = admin_url('async-upload.php');
        // If Mac and mod_security, no Flash. :(
        $flash = true;
        /*
        	if(false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security')) {
                    $flash = false;
                }*/
        $flash = apply_filters('flash_uploader', $flash);
        $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
        $upload_size_unit = $max_upload_size = wp_max_upload_size();
        $sizes = array('KB', 'MB', 'GB');
        for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
            $upload_size_unit /= 1024;
        }
        if ($u < 0) {
            $upload_size_unit = 0;
            $u = 0;
        } else {
            $upload_size_unit = (int) $upload_size_unit;
        }
        echo $this->messages(true);
        ?>
        <div class="updated"><ul><li><?php 
        _e('Please update your WordPress to the latest version, in order to get the latest uploading system.', WYSIJA);
        ?>
</li></ul></div>
        <div id="overlay"><img id="loader" src="<?php 
        echo WYSIJA_URL;
        ?>
img/wpspin_light.gif" /></div>
        <div class="popup_content media-wp-upload">
            <script type="text/javascript">
            //<![CDATA[
            var uploaderMode = 0;
            jQuery(document).ready(function($){
                    uploaderMode = getUserSetting('uploader');
                    $('.upload-html-bypass a').click(function(){deleteUserSetting('uploader');uploaderMode=0;swfuploadPreLoad();return false;});
                    $('.upload-flash-bypass a').click(function(){setUserSetting('uploader', '1');uploaderMode=1;swfuploadPreLoad();return false;});
            });
            //]]>
            </script>

            <div id="media-upload-notice">
            <?php 
        if (isset($errors['upload_notice'])) {
            ?>
                    <?php 
            echo $errors['upload_notice'];
            ?>
            <?php 
        }
        ?>
            </div>
            <div id="media-upload-error">
            <?php 
        if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) {
            ?>
                    <?php 
            echo $errors['upload_error']->get_error_message();
            ?>
            <?php 
        }
        ?>
            </div>
            <?php 
        // Check quota for this blog if multisite
        if (is_multisite() && !is_upload_space_available()) {
            echo '<p>' . sprintf(__('Sorry, you have filled your storage quota (%s MB).'), get_space_allowed()) . '</p>';
            return;
        }
        do_action('pre-upload-ui');
        if ($flash) {
            ?>
            <script type="text/javascript">
            //<![CDATA[
            var swfu;
            SWFUpload.onload = function() {
                    var settings = {
                                    button_text: '<span class="button"><?php 
            _e('Select Files');
            ?>
<\/span>',
                                    button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; font-size: 11px; text-shadow: 0 1px 0 #FFFFFF; color:#464646; }',
                                    button_height: "23",
                                    button_width: "132",
                                    button_text_top_padding: 3,
                                    button_image_url: '<?php 
            echo includes_url('images/upload.png?ver=20100531');
            ?>
',
                                    button_placeholder_id: "flash-browse-button",
                                    upload_url : "<?php 
            echo esc_attr($flash_action_url);
            ?>
",
//.........这里部分代码省略.........
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:101,代码来源:campaigns.php

示例14: fpGrabFromURLIframe

function fpGrabFromURLIframe()
{
    media_upload_header();
    if (isset($_POST['grabfrom_url'])) {
        // this is an upload request. let's see!
        $attachmentId = fpHandleUpload();
        if (is_wp_error($attachmentId)) {
            fpUploadForm('<div class="error form-invalid">' . $attachmentId->get_error_message() . '</div>');
        } else {
            echo "<style>h3, #plupload-upload-ui,.max-upload-size { display: none }</style>";
            media_upload_type_form("image", null, $attachmentId);
        }
    } else {
        fpUploadForm();
    }
}
开发者ID:basteln3rk,项目名称:save-import-image-from-url,代码行数:16,代码来源:save-import-image-from-url.php

示例15: media_tab_process

    function media_tab_process()
    {
        media_upload_header();
        ?>
		<form id="new_royalslider_add_shortcode" action="media-new.php" method="post">
			<?php 
        submit_button(__('Add RoyalSlider', 'new_royalslider'));
        ?>
		</form>
		<?php 
    }
开发者ID:elliottoman,项目名称:shero2016,代码行数:11,代码来源:NewRoyalSliderBackend.php


注:本文中的media_upload_header函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。