• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP em_locate_template函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: em_ical

/**
 * generates an ical feed on init if url is correct
 */
function em_ical($regenerate = false)
{
    $cal_file_request = preg_match('/events.ics$/', $_SERVER['REQUEST_URI']);
    //are we askig for the ics file directly but doesn't exist?
    if ($cal_file_request || $regenerate) {
        ob_start();
        em_locate_template('templates/ical.php', true);
        $calendar = str_replace("\n", "\r\n", ob_get_clean());
        //get the contents to output and clean crlf issues
        $calendar = str_replace("\n\n", "\n", $calendar);
        //let's create a cache file
        /*
        if( get_option('dbem_regenerate_ical') || !file_exists(ABSPATH . "/events.ics") ){
        	$file = fopen( ABSPATH . "/events.ics", 'w');
        	if($file){
        		fwrite($file, $calendar, strlen($calendar));
        		fclose($file);
        		update_option('dbem_regenerate_ical',false);
        	}
        }
        */
        echo $calendar;
        die;
    }
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:28,代码来源:em-ical.php


示例2: em_ical_events

function em_ical_events()
{
    ob_start();
    em_locate_template('templates/ical.php', true);
    return preg_replace("/([^\r])\n/", "\$1\r\n", ob_get_clean());
    //get the contents to output and clean crlf issues
}
开发者ID:rajankz,项目名称:webspace,代码行数:7,代码来源:em-ical.php


示例3: the_content

 function the_content($content)
 {
     global $post, $EM_Event;
     if ($post->post_type == EM_POST_TYPE_EVENT) {
         if (is_archive() || is_search()) {
             if (get_option('dbem_cp_events_archive_formats')) {
                 $EM_Event = em_get_event($post);
                 $content = $EM_Event->output(get_option('dbem_event_list_item_format'));
             }
         } else {
             if (get_option('dbem_cp_events_formats') && !post_password_required()) {
                 $EM_Event = em_get_event($post);
                 ob_start();
                 em_locate_template('templates/event-single.php', true);
                 $content = ob_get_clean();
             } else {
                 $EM_Event = em_get_event($post);
                 if ($EM_Event->event_rsvp) {
                     $content .= $EM_Event->output('<h2>Bookings</h2>#_BOOKINGFORM');
                 }
             }
         }
     }
     return $content;
 }
开发者ID:hscale,项目名称:webento,代码行数:25,代码来源:em-event-post.php


示例4: the_content

 function the_content($content)
 {
     global $wp_query, $EM_Tag;
     $EM_Tag = new EM_Tag($wp_query->queried_object);
     ob_start();
     em_locate_template('templates/tag-single.php', true);
     return ob_get_clean();
 }
开发者ID:rajankz,项目名称:webspace,代码行数:8,代码来源:em-tag-taxonomy.php


示例5: em_get_locations_map_shortcode

/**
 * Generates a map of locations that match given query attributes. Accepts any location query attributes. 
 * @param array $args
 * @return string
 */
function em_get_locations_map_shortcode($args)
{
    $args['width'] = !empty($args['width']) ? $args['width'] : 450;
    $args['height'] = !empty($args['height']) ? $args['height'] : 300;
    ob_start();
    em_locate_template('templates/map-global.php', true, array('args' => $args));
    return ob_get_clean();
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:13,代码来源:em-shortcode.php


示例6: em_get_locations_map_shortcode

/**
 * Generates a map of locations that match given query attributes. Accepts any location query attributes. 
 * @param unknown_type $atts
 * @return string
 */
function em_get_locations_map_shortcode($atts)
{
    $clean_atts = EM_Locations::get_default_search($atts);
    $clean_atts['width'] = !empty($atts['width']) ? $atts['width'] : 450;
    $clean_atts['height'] = !empty($atts['height']) ? $atts['height'] : 300;
    ob_start();
    em_locate_template('templates/map-global.php', true, array('args' => $atts));
    return ob_get_clean();
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:14,代码来源:em-shortcode.php


示例7: the_content

 function the_content($content)
 {
     global $wp_query, $EM_Tag, $post, $em_tag_id;
     if (!empty($wp_query->em_tag_id) || $post->ID == get_option('dbem_tags_page') && !empty($em_tag_id)) {
         $EM_Tag = empty($wp_query->em_tag_id) ? em_get_tag($em_tag_id) : em_get_tag($wp_query->em_tag_id);
         ob_start();
         em_locate_template('templates/tag-single.php', true);
         return ob_get_clean();
     }
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:10,代码来源:em-tag-taxonomy.php


示例8: the_content

 function the_content($content)
 {
     global $wp_query, $EM_Category, $post;
     if (empty($post->ID)) {
         $EM_Category = new EM_Category($wp_query->queried_object);
         ob_start();
         em_locate_template('templates/category-single.php', true);
         return ob_get_clean();
     }
     return $content;
 }
开发者ID:hscale,项目名称:webento,代码行数:11,代码来源:em-category-taxonomy.php


示例9: the_content

 function the_content($content)
 {
     global $wp_query, $EM_Category, $post, $em_category_id;
     if (!empty($wp_query->em_category_id) || $post->ID == get_option('dbem_categories_page') && !empty($em_category_id)) {
         $EM_Category = empty($wp_query->em_category_id) ? em_get_category($em_category_id) : em_get_category($wp_query->em_category_id);
         ob_start();
         em_locate_template('templates/category-single.php', true);
         return ob_get_clean();
     }
     return $content;
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:11,代码来源:em-category-taxonomy.php


示例10: the_content

 public static function the_content($content)
 {
     global $wp_query, $EM_Tag, $post, $em_tag_id;
     $is_tags_page = $post->ID == get_option('dbem_tags_page');
     $tag_flag = !empty($wp_query->em_tag_id) || !empty($em_tag_id);
     if ($is_tags_page && $tag_flag || empty($post->ID) && $tag_flag) {
         $EM_Tag = empty($wp_query->em_tag_id) ? em_get_tag($em_tag_id) : em_get_tag($wp_query->em_tag_id);
         ob_start();
         em_locate_template('templates/tag-single.php', true);
         return ob_get_clean();
     }
     return $content;
 }
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:13,代码来源:em-tag-taxonomy.php


示例11: em_ical_item

/**
 * Generates an ics file for a single event 
 */
function em_ical_item()
{
    global $wpdb, $wp_query, $wp_rewrite;
    //check if we're outputting an ical feed
    if (!empty($wp_query) && $wp_query->get('ical')) {
        $execute_ical = false;
        $filename = 'events';
        $args = array();
        //single event
        if ($wp_query->get(EM_POST_TYPE_EVENT)) {
            $event_id = $wpdb->get_var('SELECT event_id FROM ' . EM_EVENTS_TABLE . " WHERE event_slug='" . $wp_query->get(EM_POST_TYPE_EVENT) . "' AND event_status=1 LIMIT 1");
            if (!empty($event_id)) {
                $filename = $wp_query->get(EM_POST_TYPE_EVENT);
                $args['event'] = $event_id;
            }
            //single location
        } elseif ($wp_query->get(EM_POST_TYPE_LOCATION)) {
            $location_id = $wpdb->get_var('SELECT location_id FROM ' . EM_LOCATIONS_TABLE . " WHERE location_slug='" . $wp_query->get(EM_POST_TYPE_LOCATION) . "' AND location_status=1 LIMIT 1");
            if (!empty($location_id)) {
                $filename = $wp_query->get(EM_POST_TYPE_LOCATION);
                $args['location'] = $location_id;
            }
            //taxonomies
        } else {
            $taxonomies = EM_Object::get_taxonomies();
            foreach ($taxonomies as $tax_arg => $taxonomy_info) {
                $taxonomy_term = $wp_query->get($taxonomy_info['query_var']);
                if ($taxonomy_term) {
                    $filename = $taxonomy_term;
                    $args[$tax_arg] = $taxonomy_term;
                }
            }
        }
        //only output the ical if we have a match from above
        if (count($args) > 0) {
            //send headers and output ical
            header('Content-type: text/calendar; charset=utf-8');
            header('Content-Disposition: inline; filename="' . $filename . '.ics"');
            em_locate_template('templates/ical.php', true, array('args' => $args));
            exit;
        } else {
            //no item exists, so redirect to original URL
            $url_to_redirect = preg_replace("/ical\\/\$/", '', esc_url_raw(add_query_arg(array('ical' => null))));
            wp_redirect($url_to_redirect, '302');
            exit;
        }
    }
}
开发者ID:Olaf1989,项目名称:Cakes-and-more,代码行数:51,代码来源:em-ical.php


示例12: em_ical_event

/**
 * Generates an ics file for a single event 
 */
function em_ical_event()
{
    global $wpdb, $wp_query;
    //add endpoints to events
    if (!empty($wp_query) && $wp_query->get(EM_POST_TYPE_EVENT) && $wp_query->get('ical')) {
        $event_id = $wpdb->get_var('SELECT event_id FROM ' . EM_EVENTS_TABLE . " WHERE event_slug='" . $wp_query->get(EM_POST_TYPE_EVENT) . "' AND event_status=1 LIMIT 1");
        if (!empty($event_id)) {
            global $EM_Event;
            $EM_Event = em_get_event($event_id);
            //send headers
            header('Content-type: text/calendar; charset=utf-8');
            header('Content-Disposition: inline; filename="' . $EM_Event->event_slug . '.ics"');
            em_locate_template('templates/ical.php', true);
            exit;
        }
    }
}
开发者ID:batruji,项目名称:metareading,代码行数:20,代码来源:em-ical.php


示例13: the_content

 function the_content($content)
 {
     global $post, $EM_Location;
     if ($post->post_type == EM_POST_TYPE_LOCATION) {
         if (is_archive() || is_search()) {
             if (get_option('dbem_cp_locations_archive_formats')) {
                 $EM_Location = em_get_location($post);
                 $content = $EM_Location->output(get_option('dbem_location_list_item_format'));
             }
         } else {
             if (get_option('dbem_cp_locations_formats') && !post_password_required()) {
                 $EM_Location = em_get_location($post);
                 ob_start();
                 em_locate_template('templates/location-single.php', true);
                 $content = ob_get_clean();
             }
         }
     }
     return $content;
 }
开发者ID:batruji,项目名称:metareading,代码行数:20,代码来源:em-location-post.php


示例14: template_include

 public function template_include($template)
 {
     if (is_post_type_archive('event')) {
         $new_template = em_locate_template('archive-event.php');
     }
     if (is_tax('event-category')) {
         $new_template = em_locate_template('taxonomy-event-category.php');
     }
     if (is_tax('event-location')) {
         $new_template = em_locate_template('taxonomy-event-location.php');
     }
     if (is_tax('event-organizer')) {
         $new_template = em_locate_template('taxonomy-event-organizer.php');
     }
     if (is_tax('event-tag')) {
         $new_template = em_locate_template('taxonomy-event-tag.php');
     }
     if (is_singular('event')) {
         $new_template = em_locate_template('single-event.php');
     }
     return apply_filters('em_template_include', !empty($new_template) ? $new_template : $template);
 }
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:22,代码来源:class-templates.php


示例15: em_admin_location

function em_admin_location($message = "")
{
    global $EM_Location, $EM_Notices;
    if (empty($EM_Location) || !is_object($EM_Location)) {
        $title = __('Add location', 'dbem');
        $EM_Location = new EM_Location();
    } else {
        $title = __('Edit location', 'dbem');
    }
    ?>
	<div class='wrap'>
		<div id='icon-edit' class='icon32'>
			<br/>
		</div>
		<h2><?php 
    echo $title;
    ?>
</h2>
		<?php 
    em_locate_template('forms/location-editor.php', true);
    ?>
	</div>
	<?php 
}
开发者ID:rajankz,项目名称:webspace,代码行数:24,代码来源:em-ms-locations.php


示例16: em_locate_template

<?php

/*
 * Default Events List Template
 * This page displays a list of events, called during the em_content() if this is an events list page.
 * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
 * You can display events however you wish, there are a few variables made available to you:
 * 
 * $args - the args passed onto EM_Events::output()
 * 
 */
if (get_option('dbem_events_page_search') && !defined('DOING_AJAX')) {
    em_locate_template('templates/events-search.php', true);
}
//TODO fine tune ajax searches - we have some pagination issues otherwise, due to search querystrings
if (get_option('dbem_events_page_ajax', defined('EM_AJAX_SEARCH'))) {
    echo "<div class='em-events-search-ajax'>";
}
$events_count = EM_Events::count(apply_filters('em_content_events_args', $args));
$args['limit'] = get_option('dbem_events_default_limit');
$args['page'] = !empty($_REQUEST['pno']) && is_numeric($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
if ($events_count > 0) {
    //If there's a search, let's change the pagination a little here
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'search_events') {
        $args['pagination'] = false;
        if (get_option('dbem_event_list_groupby')) {
            $args['mode'] = get_option('dbem_event_list_groupby');
            $args['date_format'] = get_option('dbem_event_list_groupby_format');
            echo em_events_list_grouped($args);
        } else {
            echo EM_Events::output($args);
开发者ID:interfisch,项目名称:lm,代码行数:31,代码来源:events-list.php


示例17: foreach

    foreach (em_get_countries() as $country_key => $country_name) {
        ?>
					<option value="<?php 
        echo $country_key;
        ?>
" <?php 
        echo $EM_Location->location_country == $country_key || $EM_Location->location_country == '' && $EM_Location->location_id == '' && get_option('dbem_location_default_country') == $country_key ? 'selected="selected"' : '';
        ?>
><?php 
        echo $country_name;
        ?>
</option>
					<?php 
    }
    ?>
				</select><?php 
    echo $required;
    ?>
			</td>
		</tr>
	</table>
	<?php 
}
?>
	<?php 
if (get_option('dbem_gmap_is_active')) {
    em_locate_template('forms/map-container.php', true);
}
?>
	<br style="clear:both;" />
</div>
开发者ID:mjrobison,项目名称:FirstCareCPR,代码行数:31,代码来源:location.php


示例18: bp_em_meta_box_group

function bp_em_meta_box_group()
{
    em_locate_template('forms/event/group.php', true);
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:4,代码来源:bp-em-groups.php


示例19: output


//.........这里部分代码省略.........
                 if ($result == '#_LINKEDNAME' || $result == '#_EVENTLINK') {
                     $replace = '<a href="' . $event_link . '" title="' . esc_attr($this->event_name) . '">' . esc_attr($this->event_name) . '</a>';
                 } else {
                     $replace = $event_link;
                 }
                 break;
             case '#_EDITEVENTURL':
             case '#_EDITEVENTLINK':
                 if ($this->can_manage('edit_events', 'edit_others_events')) {
                     $link = esc_url($this->get_edit_url());
                     if ($result == '#_EDITEVENTLINK') {
                         $replace = '<a href="' . $link . '">' . esc_html(sprintf(__('Edit Event', 'dbem'))) . '</a>';
                     } else {
                         $replace = $link;
                     }
                 }
                 break;
                 //Bookings
             //Bookings
             case '#_ADDBOOKINGFORM':
                 //Depreciated
             //Depreciated
             case '#_REMOVEBOOKINGFORM':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGFORM':
                 if (get_option('dbem_rsvp_enabled')) {
                     if (!defined('EM_XSS_BOOKINGFORM_FILTER') && locate_template('plugins/events-manager/placeholders/bookingform.php')) {
                         //xss fix for old overriden booking forms
                         add_filter('em_booking_form_action_url', 'esc_url');
                         define('EM_XSS_BOOKINGFORM_FILTER', true);
                     }
                     ob_start();
                     $template = em_locate_template('placeholders/bookingform.php', true, array('EM_Event' => $this));
                     EM_Bookings::enqueue_js();
                     $replace = ob_get_clean();
                 }
                 break;
             case '#_BOOKINGBUTTON':
                 if (get_option('dbem_rsvp_enabled') && $this->event_rsvp) {
                     ob_start();
                     $template = em_locate_template('placeholders/bookingbutton.php', true, array('EM_Event' => $this));
                     $replace = ob_get_clean();
                 }
                 break;
             case '#_EVENTPRICERANGEALL':
                 $show_all_ticket_prices = true;
                 //continues below
             //continues below
             case '#_EVENTPRICERANGE':
                 //get the range of prices
                 $min = false;
                 $max = 0;
                 if ($this->get_bookings()->is_open() || !empty($show_all_ticket_prices)) {
                     foreach ($this->get_tickets()->tickets as $EM_Ticket) {
                         /* @var $EM_Ticket EM_Ticket */
                         if ($EM_Ticket->is_available() || get_option('dbem_bookings_tickets_show_unavailable') || !empty($show_all_ticket_prices)) {
                             if ($EM_Ticket->get_price() > $max) {
                                 $max = $EM_Ticket->get_price();
                             }
                             if ($EM_Ticket->get_price() < $min || $min === false) {
                                 $min = $EM_Ticket->get_price();
                             }
                         }
                     }
                 }
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:67,代码来源:em-event.php


示例20: meta_box_recurrence

 public static function meta_box_recurrence()
 {
     em_locate_template('forms/event/recurring-when.php', true);
 }
开发者ID:batruji,项目名称:metareading,代码行数:4,代码来源:em-event-post-admin.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP em_options_input_text函数代码示例发布时间:2022-05-15
下一篇:
PHP em_get_scopes函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap