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


PHP mpp_get_template函数代码示例

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


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

示例1: mpp_shortcode_uploader

function mpp_shortcode_uploader($atts = array(), $content = '')
{
    $default = array('gallery_id' => 0, 'component' => mpp_get_current_component(), 'component_id' => mpp_get_current_component_id(), 'type' => '', 'status' => mpp_get_default_status(), 'view' => '', 'selected' => 0, 'label_empty' => __('Please select a gallery', 'mediapress'), 'show_error' => 1);
    $atts = shortcode_atts($default, $atts);
    //dropdown list of galleries to sllow userselect one
    $view = 'list';
    if (!empty($atts['gallery_id']) && is_numeric($atts['gallery_id'])) {
        $view = 'single';
        //single gallery uploader
        //override component and $component id
        $gallery = mpp_get_gallery($atts['gallery_id']);
        if (!$gallery) {
            return __('Nonexistent gallery should not be used', 'mediapress');
        }
        //reset
        $atts['component'] = $gallery->component;
        $atts['component_id'] = $gallery->component_id;
        $atts['type'] = $gallery->type;
    }
    //the user must be able to upload to current component or galler
    $can_upload = false;
    if (mpp_user_can_upload($atts['component'], $atts['component_id'], $atts['gallery_id'])) {
        $can_upload = true;
    }
    if (!$can_upload && $atts['show_error']) {
        return __('Sorry, you are not allowed to upload here.', 'mediapress');
    }
    //if we are here, the user can upload
    //we still have one issue, what if the user has not created any gallery and the admin intends to allow the user to upload to their created gallery
    $atts['context'] = 'shortcode';
    //from where it is being uploaded,
    $atts['view'] = $view;
    //passing the 2nd arg makes all these variables available to the loaded file
    mpp_get_template('shortcodes/uploader.php', $atts);
}
开发者ID:Kemitestech,项目名称:WordPress-Skeleton,代码行数:35,代码来源:mpp-shortcode-media-uploader.php

示例2: mpp_shortcode_create_gallery

function mpp_shortcode_create_gallery($atts = array(), $content = null)
{
    $defaults = array();
    //do not show it to the non logged user
    if (!is_user_logged_in()) {
        return $content;
    }
    ob_start();
    mpp_get_template('shortcodes/create-gallery.php');
    $content = ob_get_clean();
    return $content;
}
开发者ID:enboig,项目名称:mediapress,代码行数:12,代码来源:mpp-shortcode-create-gallery.php

示例3: load_dir_list

 /**
  * Loads directroy gallery list via ajax
  * 
  */
 public function load_dir_list()
 {
     $type = isset($_POST['filter']) ? $_POST['filter'] : '';
     $page = absint($_POST['page']);
     $scope = $_POST['scope'];
     $search_terms = $_POST['search_terms'];
     //make the query and setup
     mediapress()->is_directory = true;
     //get all public galleries, should we do type filtering
     mediapress()->the_gallery_query = new MPP_Gallery_Query(array('status' => 'public', 'type' => $type, 'page' => $page, 'search_terms' => $search_terms));
     mpp_get_template('gallery/loop-gallery.php');
     exit(0);
 }
开发者ID:enboig,项目名称:mediapress,代码行数:17,代码来源:mpp-ajax.php

示例4: mpp_shortcode_list_gallery

function mpp_shortcode_list_gallery($atts = null, $content = '')
{
    //allow everything that can be done to be passed via this shortcode
    $defaults = array('type' => false, 'id' => false, 'in' => false, 'exclude' => false, 'slug' => false, 'status' => false, 'component' => false, 'component_id' => false, 'per_page' => false, 'offset' => false, 'page' => false, 'nopaging' => false, 'order' => 'DESC', 'orderby' => 'date', 'user_id' => false, 'include_users' => false, 'exclude_users' => false, 'user_name' => false, 'scope' => false, 'search_terms' => '', 'year' => false, 'month' => false, 'week' => '', 'day' => '', 'hour' => '', 'minute' => '', 'second' => '', 'yearmonth' => false, 'meta_key' => '', 'meta_value' => '', 'fields' => false, 'column' => 4);
    $atts = shortcode_atts($defaults, $atts);
    if (!$atts['meta_key']) {
        unset($atts['meta_key']);
        unset($atts['meta_value']);
    }
    $shortcode_column = $atts['column'];
    mpp_shortcode_save_gallery_data('column', $shortcode_column);
    unset($atts['column']);
    //unset( $atts['view'] );
    $query = new MPP_Gallery_Query($atts);
    mpp_shortcode_save_gallery_data('gallery_list_query', $query);
    ob_start();
    //include temlate
    mpp_get_template('shortcodes/gallery-list.php');
    $content = ob_get_clean();
    mpp_shortcode_reset_gallery_data('column');
    mpp_shortcode_reset_gallery_data('gallery_list_query');
    return $content;
}
开发者ID:enboig,项目名称:mediapress,代码行数:23,代码来源:mpp-shortcode-gallery-list.php

示例5: mpp_reset_media_data

    ?>
    <?php 
    mpp_reset_media_data();
    ?>
   
<?php 
} else {
    ?>
	<?php 
    //we should seriously think about adding create gallery button here
    ?>
	<?php 
    if (mpp_user_can_upload(mpp_get_current_component(), mpp_get_current_component_id())) {
        ?>
		<?php 
        mpp_get_template('gallery/manage/add-media.php');
        ?>
	
	<?php 
    } else {
        ?>

		<div class="mpp-notice mpp-no-gallery-notice">
			<p> <?php 
        _ex('Nothing to see here!', 'No media Message', 'mediapress');
        ?>
</p> 
		</div>
	<?php 
    }
    ?>
开发者ID:markc,项目名称:mediapress,代码行数:31,代码来源:single.php

示例6: mpp_media_menu

<?php

// Exit if the file is accessed directly over web
if (!defined('ABSPATH')) {
    exit;
}
?>
<div class="mpp-menu mpp-menu-open mpp-menu-horizontal mpp-media-admin-menu">
	
	<?php 
mpp_media_menu(mpp_get_current_media(), mpp_get_current_edit_action());
?>
</div>
<hr />
<?php 
if (mpp_is_media_delete()) {
    $template = 'gallery/media/manage/delete.php';
} elseif (mpp_is_media_management()) {
    $template = 'gallery/media/manage/edit.php';
}
$template = apply_filters('mpp_get_media_management_template', $template);
//load it
mpp_get_template($template);
开发者ID:markc,项目名称:mediapress,代码行数:23,代码来源:manage.php

示例7: loade_template

 public function loade_template()
 {
     $template = $this->path . 'home.php';
     $template = apply_filters('mpp_get_sitewide_gallery_template', $template);
     mpp_get_template($template);
 }
开发者ID:enboig,项目名称:mediapress,代码行数:6,代码来源:class-mpp-sitewide-gallery-template-loader.php

示例8: display

 public function display($gallery)
 {
     mpp_get_template('gallery/views/playlist-audio.php');
 }
开发者ID:enboig,项目名称:mediapress,代码行数:4,代码来源:class-mpp-gallery-view-audio-playlist.php

示例9: display

 public function display($media)
 {
     mpp_get_template('gallery/media/views/audio.php');
 }
开发者ID:enboig,项目名称:mediapress,代码行数:4,代码来源:class-mpp-media-view-audio.php

示例10: content_create_gallery

 public function content_create_gallery()
 {
     mpp_get_template('members/home.php');
     //load gallery-create.php form
 }
开发者ID:baden03,项目名称:mediapress,代码行数:5,代码来源:screen.php

示例11: display

 public function display($group_id = null)
 {
     mpp_get_template('groups/home.php');
 }
开发者ID:baden03,项目名称:mediapress,代码行数:4,代码来源:group-extension.php

示例12: mpp_get_template

<?php

// Exit if the file is accessed directly over web
if (!defined('ABSPATH')) {
    exit;
}
/**
 * Load Add Media form/New Upload form
 */
mpp_get_template('gallery/manage/upload-form.php');
开发者ID:markc,项目名称:mediapress,代码行数:10,代码来源:add-media.php

示例13: do_action

	
							
						<?php 
do_action('mpp_gallery_directory_order_options');
?>
					</select>
				</li>
					
			</ul>

			
		</div><!-- .item-list-tabs -->

		<div id="mpp-dir-list" class="mpp mpp-dir-list dir-list">
			<?php 
mpp_get_template('gallery/loop-gallery.php');
?>
		</div><!-- #mpp-dir-list -->

		<?php 
do_action('mpp_directory_gallery_content');
?>

		<?php 
wp_nonce_field('directory_mpp', '_wpnonce-mpp-filter');
?>

		<?php 
do_action('mpp_after_directory_gallery_content');
?>
开发者ID:markc,项目名称:mediapress,代码行数:28,代码来源:index.php


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