當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EM_Events::get方法代碼示例

本文整理匯總了PHP中EM_Events::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP EM_Events::get方法的具體用法?PHP EM_Events::get怎麽用?PHP EM_Events::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EM_Events的用法示例。


在下文中一共展示了EM_Events::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bp_em_events_content

function bp_em_events_content()
{
    global $bp, $EM_Notices;
    echo $EM_Notices;
    ?>
		<h4><?php 
    _e('My Events', 'dbem');
    ?>
</h4>
		<?php 
    $events = EM_Events::get(array('owner' => $bp->displayed_user->id));
    if (count($events) > 0) {
        $args = array('format_header' => get_option('dbem_bp_events_list_format_header'), 'format' => get_option('dbem_bp_events_list_format'), 'format_footer' => get_option('dbem_bp_events_list_format_footer'), 'owner' => $bp->displayed_user->id);
        echo EM_Events::output($events, $args);
    } else {
        ?>
			<p><?php 
        _e('No Events', 'dbem');
        ?>
</p>
			<?php 
    }
    ?>
		<h4><?php 
    _e("Events I'm Attending", 'dbem');
    ?>
</h4>
		<?php 
    bp_em_attending_content();
}
開發者ID:hypenotic,項目名稱:slowfood,代碼行數:30,代碼來源:profile.php

示例2: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     $instance = array_merge($this->defaults, $instance);
     $instance = $this->fix_scope($instance);
     // depcreciate
     echo $args['before_widget'];
     echo $args['before_title'];
     echo $instance['title'];
     echo $args['after_title'];
     if (is_numeric($instance['time_limit']) && $instance['time_limit'] > 0) {
         $instance['scope'] = date('Y-m-d') . "," . date('Y-m-t', strtotime('+' . ($instance['time_limit'] - 1) . ' month'));
     }
     $instance['owner'] = false;
     $events = EM_Events::get($instance);
     echo "<ul>";
     $li_wrap = !preg_match('/^<li>/i', trim($instance['format']));
     if (count($events) > 0) {
         foreach ($events as $event) {
             if ($li_wrap) {
                 echo '<li>' . $event->output($instance['format']) . '</li>';
             } else {
                 echo $event->output($instance['format']);
             }
         }
     } else {
         echo '<li>' . __('No events', 'dbem') . '</li>';
     }
     if (!empty($instance['all_events'])) {
         $events_link = !empty($instance['all_events_text']) ? em_get_link($instance['all_events_text']) : em_get_link(__('all events', 'dbem'));
         echo '<li>' . $events_link . '</li>';
     }
     echo "</ul>";
     echo $args['after_widget'];
 }
開發者ID:hypenotic,項目名稱:slowfood,代碼行數:35,代碼來源:em-events.php

示例3: mob_shortcode_countdown

function mob_shortcode_countdown($atts)
{
    $defaults = array('id' => 'countdown_' . uniqid(), 'day' => 0, 'month' => 0, 'year' => 0, 'hour' => 0, 'minutes' => 0, 'seconds' => 0, 'nextevent' => false, 'labels' => "['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds']", 'labels1' => "['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second']", 'compactLabels' => "['y', 'm', 'w', 'd']", 'whichLabels' => null, 'digits' => "['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']", 'timeSeparator' => ':', 'isRTL' => false, 'since' => null, 'timezone' => null, 'serverSync' => null, 'format' => 'dHMS', 'layout' => '', 'compact' => false, 'padZeroes' => false, 'significant' => 0, 'description' => '', 'expiryUrl' => null, 'alwaysExpire' => false, 'onExpiry' => null, 'onTick' => null, 'tickInterval' => 1);
    $a = shortcode_atts($defaults, $atts);
    if ($a['nextevent'] && class_exists('EM_Events')) {
        if ($events = EM_Events::get(array('limit' => 1))) {
            $datetime = strtotime($events[0]->event_start_date . ' ' . $events[0]->event_start_time);
            $a['day'] = date('j', $datetime);
            $a['month'] = date('n', $datetime);
            $a['year'] = date('Y', $datetime);
            $a['hour'] = date('G', $datetime);
            $a['minutes'] = intval(date('i', $datetime));
            $a['seconds'] = intval(date('s', $datetime));
        }
    }
    $return = '<div id="' . $a['id'] . '"></div><script type="text/javascript">jQuery(document).ready(function(){
		jQuery(\'#' . $a['id'] . '\').countdown({';
    foreach (array_diff_key($a, array('id' => '', 'day' => '', 'month' => '', 'year' => '', 'hour' => '', 'minutes' => '', 'seconds' => '')) as $k => $v) {
        if ($v != $defaults[$k] && $v != null && $v != false && !empty($v)) {
            $return .= $k . ':' . (substr($defaults[$k], 0, 1) == '[' || $defaults[$k] == null || is_numeric($defaults[$k]) || is_bool($defaults[$k]) ? $v : '"' . $v . '"') . ',';
        }
    }
    $return .= '
			until: new Date(' . intval($a['year']) . ',' . intval($a['month'] - 1) . ',' . intval($a['day']) . ',' . intval($a['hour']) . ',' . intval($a['minutes']) . ',' . intval($a['seconds']) . '),
		});
	});</script>';
    if (isset($events[0]->event_slug)) {
        $return = '<a href="' . $events[0]->event_slug . '">' . $return . '</a>';
    }
    return $return;
}
開發者ID:markoliverbrawn,項目名稱:moby-wordpress-template,代碼行數:31,代碼來源:countdown.php

示例4: queue_emails

 /**
  * Run on cron and prep emails to go out
  */
 public static function queue_emails()
 {
     global $EM_Event, $wpdb;
     //save old event in case already set
     $old_EM_Event = !empty($EM_Event) ? clone $EM_Event : null;
     //disable the current events are past rule
     add_filter('option_pre_dbem_events_current_are_past', 'em_emails_return_false', create_function('$a', 'return false;'));
     //For each event x days on
     $days = get_option('dbem_emp_emails_reminder_days', 1);
     $scope = $days > 0 ? date('Y-m-d', current_time('timestamp') + 86400 * $days) : date('Y-m-d', current_time('timestamp') + 86400);
     //make sure we don't get past events, only events starting that specific date
     $events_are_past = get_option('dbem_events_current_are_past');
     update_option('dbem_events_current_are_past', true);
     $output_type = get_option('dbem_smtp_html') ? 'html' : 'email';
     foreach (EM_Events::get(array('scope' => $scope, 'private' => 1, 'blog' => get_current_blog_id())) as $EM_Event) {
         /* @var $EM_Event EM_Event */
         $emails = array();
         //get ppl attending
         foreach ($EM_Event->get_bookings()->get_bookings()->bookings as $EM_Booking) {
             //get confirmed bookings
             /* @var $EM_Booking EM_Booking */
             if (is_email($EM_Booking->get_person()->user_email)) {
                 $subject = $EM_Booking->output(get_option('dbem_emp_emails_reminder_subject'), 'raw');
                 $message = $EM_Booking->output(get_option('dbem_emp_emails_reminder_body'), $output_type);
                 $emails[] = array($EM_Booking->get_person()->user_email, $subject, $message, $EM_Booking->booking_id);
             }
         }
         if (count($emails) > 0) {
             $attachments = serialize(array());
             if (get_option('dbem_emp_emails_reminder_ical')) {
                 //create invite ical
                 $upload_dir = wp_upload_dir();
                 if (file_exists(trailingslashit($upload_dir['basedir']) . "em-cache") || mkdir(trailingslashit($upload_dir['basedir']) . "em-cache")) {
                     $icalfilename = trailingslashit($upload_dir['basedir']) . "em-cache/invite_" . $EM_Event->event_id . ".ics";
                     $icalfile = fopen($icalfilename, 'w+');
                     if ($icalfile) {
                         ob_start();
                         em_locate_template('templates/ical.php', true, array('args' => array('event' => $EM_Event->event_id)));
                         $icalcontent = preg_replace("/([^\r])\n/", "\$1\r\n", ob_get_clean());
                         fwrite($icalfile, $icalcontent);
                         fclose($icalfile);
                         $ical_file_array = array('name' => 'invite.ics', 'type' => 'text/calendar', 'path' => $icalfilename);
                         $attachments = serialize(array($ical_file_array));
                     }
                 }
             }
             foreach ($emails as $email) {
                 $wpdb->insert(EM_EMAIL_QUEUE_TABLE, array('email' => $email[0], 'subject' => $email[1], 'body' => $email[2], 'attachment' => $attachments, 'event_id' => $EM_Event->event_id, 'booking_id' => $email[3]));
             }
         }
     }
     //cleanup
     update_option('dbem_events_current_are_past', $events_are_past);
     //reset previous current events are past setting
     $EM_Event = $old_EM_Event;
     //reset global
     remove_filter('option_pre_dbem_events_current_are_past', 'em_emails_return_false');
 }
開發者ID:shieldsdesignstudio,項目名稱:trilogic,代碼行數:61,代碼來源:emails.php

示例5: em_rss

function em_rss()
{
    global $post, $wp_query;
    if (!empty($_REQUEST['dbem_rss']) || is_object($post) && $post->ID == get_option('dbem_events_page') && $wp_query->get('rss')) {
        header("Content-type: text/xml");
        ob_start();
        echo "<?xml version='1.0'?>\n";
        ?>
<rss version="2.0">
	<channel>
		<title><?php 
        echo get_option('dbem_rss_main_title');
        ?>
</title>
		<link><?php 
        echo get_permalink(get_option('dbem_events_page'));
        ?>
</link>
		<description><?php 
        echo get_option('dbem_rss_main_description');
        ?>
</description>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator>Weblog Editor 2.0</generator>
				
		<?php 
        $description_format = str_replace(">", "&gt;", str_replace("<", "&lt;", get_option('dbem_rss_description_format')));
        $events = EM_Events::get(array('limit' => 5, 'owner' => false));
        foreach ($events as $event) {
            $description = $event->output(get_option('dbem_rss_description_format'), "rss");
            $description = ent2ncr(convert_chars(strip_tags($description)));
            //Some RSS filtering
            ?>
			<item>
				<title><?php 
            echo $event->output(get_option('dbem_rss_title_format'), "rss");
            ?>
</title>
				<link><?php 
            echo $event->output('#_EVENTURL');
            ?>
</link>
				<description><?php 
            echo $description;
            ?>
</description>
			</item>
			<?php 
        }
        ?>
		
	</channel>
</rss>
		<?php 
        echo apply_filters('em_rss', ob_get_clean());
        die;
    }
}
開發者ID:pyropictures,項目名稱:wordpress-plugins,代碼行數:58,代碼來源:em-rss.php

示例6: find

 public function find($params)
 {
     $events = EM_Events::get(array('limit' => 0, 'offset' => 100));
     $events = self::filter_events($events, $params);
     $events = array_slice($events, $params['offset']);
     $remaped_events = array();
     foreach ($events as $event) {
         $remaped_events[] = $this->convert_to_se_event($event);
     }
     return $paged_posts = $this->add_paging_info($remaped_events, $params);
 }
開發者ID:gopinathshiva,項目名稱:wordpress-vip-plugins,代碼行數:11,代碼來源:class-shoutem-events-manager-dao.php

示例7: widget

    /** @see WP_Widget::widget */
    function widget($args, $instance) {
    	$instance = array_merge($this->defaults, $instance);
    	$instance = $this->fix_scope($instance); // depcreciate	

    	echo $args['before_widget'];
    	if( !empty($instance['title']) ){
		    echo $args['before_title'];
		    echo apply_filters('widget_title',$instance['title'], $instance, $this->id_base);
		    echo $args['after_title'];
    	}
    	//remove owner searches
		$instance['owner'] = false;
		
		//legacy stuff
		//add li tags to old widgets that have no forced li wrappers
		if ( !preg_match('/^<li/i', trim($instance['format'])) ) $instance['format'] = '<li>'. $instance['format'] .'</li>';
		if (!preg_match('/^<li/i', trim($instance['no_events_text'])) ) $instance['no_events_text'] = '<li>'.$instance['no_events_text'].'</li>';
		//orderby fix for previous versions with old orderby values
		if( !array_key_exists($instance['orderby'], $this->em_orderby_options) ){
			//replace old values
			$old_vals = array(
				'name' => 'event_name',
				'end_date' => 'event_end_date',
				'start_date' => 'event_start_date',
				'end_time' => 'event_end_time',
				'start_time' => 'event_start_time'
			);
			foreach($old_vals as $old_val => $new_val){
				$instance['orderby'] = str_replace($old_val, $new_val, $instance['orderby']);
			}
		}
		
		//get events
		$events = EM_Events::get(apply_filters('em_widget_events_get_args',$instance));
		
		//output events
		echo "<ul>";
		if ( count($events) > 0 ){
			foreach($events as $event){				
				echo $event->output( $instance['format'] );
			}
		}else{
		    echo $instance['no_events_text'];
		}
		if ( !empty($instance['all_events']) ){
			$events_link = (!empty($instance['all_events_text'])) ? em_get_link($instance['all_events_text']) : em_get_link(__('all events','charity'));
			echo '<li class="all-events-link">'.$events_link.'</li>';
		}
		echo "</ul>";
		
	    echo $args['after_widget'];
    }
開發者ID:kautzar,項目名稱:drpp4,代碼行數:53,代碼來源:event-widget.php

示例8: EM_Events

 function EM_Events($args = array())
 {
     if (is_array($args)) {
         if (is_object(current($args)) && get_class(current($args)) == 'EM_Event') {
             $this->events = $args;
         } else {
             $this->events = EM_Events::get($args);
         }
     } else {
         $this->events = EM_Events::get();
     }
     do_action('em_events', $this);
 }
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:13,代碼來源:em-events.php

示例9: export

 /**
  * export the data in selected format
  */
 public function export()
 {
     $EM_Events = EM_Events::get();
     $format = isset($_POST['exp_format']) ? wp_unslash($_POST['exp_format']) : '';
     switch ($format) {
         case 'xCal':
             $this->exportXCal($EM_Events);
             break;
         case 'iCal':
             $this->exportICal($EM_Events);
             break;
         case 'Event Espresso':
             $this->exportEventEspresso($EM_Events);
             break;
     }
 }
開發者ID:webaware,項目名稱:events-manager-import-export,代碼行數:19,代碼來源:class.EM_ImpExpExport.php

示例10: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     $instance = array_merge($this->defaults, $instance);
     $instance = $this->fix_scope($instance);
     // depcreciate
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'];
         echo apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
         echo $args['after_title'];
     }
     $instance['owner'] = false;
     //orderby fix for previous versions with old orderby values
     if (!array_key_exists($instance['orderby'], $this->em_orderby_options)) {
         //replace old values
         $old_vals = array('name' => 'event_name', 'end_date' => 'event_end_date', 'start_date' => 'event_start_date', 'end_time' => 'event_end_time', 'start_time' => 'event_start_time');
         foreach ($old_vals as $old_val => $new_val) {
             $instance['orderby'] = str_replace($old_val, $new_val, $instance['orderby']);
         }
     }
     $events = EM_Events::get(apply_filters('em_widget_events_get_args', $instance));
     echo "<div id='events'>";
     $li_wrap = !preg_match('/^<div class="item">/i', trim($instance['format']));
     if (count($events) > 0) {
         foreach ($events as $event) {
             if ($li_wrap) {
                 echo '<div class="item">' . $event->output($instance['format']) . '</div>';
             } else {
                 echo $event->output($instance['format']);
             }
         }
     } else {
         echo '<div class="item"><h4>' . $instance['no_events_text'] . '</h4></div>';
     }
     if (!empty($instance['all_events'])) {
         $events_link = !empty($instance['all_events_text']) ? em_get_link($instance['all_events_text']) : em_get_link(__('all events', 'dbem'));
         echo '<div class="all-events-link">&raquo; ' . $events_link . '</div>';
     }
     echo "</div>";
     echo $args['after_widget'];
 }
開發者ID:sezj,項目名稱:ufl-template-responsive,代碼行數:42,代碼來源:widget-em-events.php

示例11: em_get_events_list_shortcode_all

function em_get_events_list_shortcode_all($atts, $format = '')
{
    $atts = (array) $atts;
    $atts['format'] = $format != '' || empty($atts['format']) ? $format : $atts['format'];
    $atts['format'] = html_entity_decode($atts['format']);
    //shorcode doesn't accept html
    $atts['page'] = !empty($atts['page']) && is_numeric($atts['page']) ? $atts['page'] : 1;
    $atts['page'] = !empty($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : $atts['page'];
    // get recurrence events
    $atts['recurring'] = 1;
    $evts_recurring = EM_Events::get($atts);
    // get non-recurrence events
    $atts['recurring'] = 0;
    $evts = EM_Events::get($atts);
    // filter out the events that are instances of recurring events
    $non_recurrence_evts = array_filter($evts, 'is_no_recurrence');
    // merge recurrence and non-recurring events
    $evts_all = array_merge($non_recurrence_evts, $evts_recurring);
    // sort them by start==start date+time
    usort($evts_all, 'evt_start_sort');
    //
    return EM_Events::output($evts_all, $atts);
}
開發者ID:juanpablogdl,項目名稱:Intranet_GDL,代碼行數:23,代碼來源:functions.php

示例12: em_are_events_available

/**
 * Returns true if there are any events that exist in the given scope (default is future events).
 * @param string $scope
 * @return boolean
 */
function em_are_events_available($scope = "future")
{
    $scope = $scope == "" ? "future" : $scope;
    $events = EM_Events::get(array('limit' => 1, 'scope' => $scope));
    return count($events) > 0;
}
開發者ID:hypenotic,項目名稱:slowfood,代碼行數:11,代碼來源:em-template-tags.php

示例13: get_gmt_from_date

</link>
					<guid><?php 
        echo $event_url;
        ?>
</guid>
					<pubDate><?php 
        echo get_gmt_from_date(date('Y-m-d H:i:s', $EM_Event->start), 'D, d M Y H:i:s +0000');
        ?>
</pubDate>
					<description><![CDATA[<?php 
        echo $description;
        ?>
]]></description>
				</item>
				<?php 
        $count++;
    }
    if ($rss_limit != 0 && $count >= $rss_limit) {
        //we've reached our limit, or showing one event only
        break;
    } else {
        //get next page of results
        $args['page']++;
        $EM_Events = EM_Events::get($args);
    }
}
?>

		
	</channel>
</rss>
開發者ID:batruji,項目名稱:metareading,代碼行數:31,代碼來源:rss.php

示例14: output

 function output($format, $target = "html")
 {
     preg_match_all('/\\{([a-zA-Z0-9_]+)\\}([^{]+)\\{\\/[a-zA-Z0-9_]+\\}/', $format, $conditionals);
     if (count($conditionals[0]) > 0) {
         //Check if the language we want exists, if not we take the first language there
         foreach ($conditionals[1] as $key => $condition) {
             $format = str_replace($conditionals[0][$key], apply_filters('em_category_output_condition', '', $condition, $conditionals[0][$key], $this), $format);
         }
     }
     $category_string = $format;
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([a-zA-Z0-9,]+)})?/", $format, $placeholders);
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_CATEGORYNAME':
                 $replace = $this->name;
                 break;
             case '#_CATEGORYID':
                 $replace = $this->term_id;
                 break;
             case '#_CATEGORYNOTES':
             case '#_CATEGORYDESCRIPTION':
                 $replace = $this->description;
                 break;
             case '#_CATEGORYIMAGE':
             case '#_CATEGORYIMAGEURL':
                 if ($this->get_image_url() != '') {
                     $image_url = esc_url($this->get_image_url());
                     if ($result == '#_CATEGORYIMAGEURL') {
                         $replace = $image_url;
                     } else {
                         if (empty($placeholders[3][$key])) {
                             $replace = "<img src='" . esc_url($this->get_image_url()) . "' alt='" . esc_attr($this->name) . "'/>";
                         } else {
                             $image_size = explode(',', $placeholders[3][$key]);
                             if (self::array_is_numeric($image_size) && count($image_size) > 1) {
                                 if ($this->get_image_id()) {
                                     //get a thumbnail
                                     if (get_option('dbem_disable_thumbnails')) {
                                         $image_attr = '';
                                         $image_args = array();
                                         if (empty($image_size[1]) && !empty($image_size[0])) {
                                             $image_attr = 'width="' . $image_size[0] . '"';
                                             $image_args['w'] = $image_size[0];
                                         } elseif (empty($image_size[0]) && !empty($image_size[1])) {
                                             $image_attr = 'height="' . $image_size[1] . '"';
                                             $image_args['h'] = $image_size[1];
                                         } elseif (!empty($image_size[0]) && !empty($image_size[1])) {
                                             $image_attr = 'width="' . $image_size[0] . '" height="' . $image_size[1] . '"';
                                             $image_args = array('w' => $image_size[0], 'h' => $image_size[1]);
                                         }
                                         $replace = "<img src='" . esc_url(em_add_get_params($image_url, $image_args)) . "' alt='" . esc_attr($this->name) . "' {$image_attr} />";
                                     } else {
                                         //since we previously didn't store image ids along with the url to the image (since taxonomies don't allow normal featured images), sometimes we won't be able to do this, which is why we check there's a valid image id first
                                         self::ms_global_switch();
                                         $replace = wp_get_attachment_image($this->get_image_id(), $image_size);
                                         self::ms_global_switch_back();
                                     }
                                 }
                             } else {
                                 $replace = "<img src='" . esc_url($this->get_image_url()) . "' alt='" . esc_attr($this->name) . "'/>";
                             }
                         }
                     }
                 }
                 break;
             case '#_CATEGORYCOLOR':
                 $replace = $this->get_color();
                 break;
             case '#_CATEGORYLINK':
             case '#_CATEGORYURL':
                 $link = $this->get_url();
                 $replace = $result == '#_CATEGORYURL' ? $link : '<a href="' . $link . '">' . esc_html($this->name) . '</a>';
                 break;
             case '#_CATEGORYICALURL':
             case '#_CATEGORYICALLINK':
                 $replace = $this->get_ical_url();
                 if ($result == '#_CATEGORYICALLINK') {
                     $replace = '<a href="' . esc_url($replace) . '">iCal</a>';
                 }
                 break;
             case '#_CATEGORYRSSURL':
             case '#_CATEGORYRSSLINK':
                 $replace = $this->get_rss_url();
                 if ($result == '#_CATEGORYRSSLINK') {
                     $replace = '<a href="' . esc_url($replace) . '">RSS</a>';
                 }
                 break;
             case '#_CATEGORYSLUG':
                 $replace = $this->slug;
                 break;
             case '#_CATEGORYEVENTSPAST':
                 //deprecated, erroneous documentation, left for compatability
             //deprecated, erroneous documentation, left for compatability
             case '#_CATEGORYEVENTSNEXT':
                 //deprecated, erroneous documentation, left for compatability
             //deprecated, erroneous documentation, left for compatability
             case '#_CATEGORYEVENTSALL':
//.........這裏部分代碼省略.........
開發者ID:interfisch,項目名稱:lm,代碼行數:101,代碼來源:em-category.php

示例15: output

 function output($format, $target = "html")
 {
     preg_match_all('/\\{([a-zA-Z0-9_]+)\\}([^{]+)\\{\\/[a-zA-Z0-9_]+\\}/', $format, $conditionals);
     if (count($conditionals[0]) > 0) {
         //Check if the language we want exists, if not we take the first language there
         foreach ($conditionals[1] as $key => $condition) {
             $format = str_replace($conditionals[0][$key], apply_filters('em_location_output_condition', '', $conditionals[0][$key], $condition, $this), $format);
         }
     }
     $location_string = $format;
     preg_match_all("/#_[A-Za-z]+/", $format, $placeholders);
     foreach ($placeholders[0] as $result) {
         $match = true;
         $replace = '';
         switch ($result) {
             case '#_LOCATIONID':
                 $replace = $this->id;
                 break;
             case '#_NAME':
                 //Depreciated
             //Depreciated
             case '#_LOCATIONNAME':
                 $replace = $this->name;
                 break;
             case '#_ADDRESS':
                 //Depreciated
             //Depreciated
             case '#_LOCATIONADDRESS':
                 $replace = $this->address;
                 break;
             case '#_TOWN':
                 //Depreciated
             //Depreciated
             case '#_LOCATIONTOWN':
                 $replace = $this->town;
                 break;
             case '#_LOCATIONSTATE':
                 $replace = $this->state;
                 break;
             case '#_LOCATIONPOSTCODE':
                 $replace = $this->postcode;
                 break;
             case '#_LOCATIONREGION':
                 $replace = $this->region;
                 break;
             case '#_LOCATIONCOUNTRY':
                 $replace = $this->get_country();
                 break;
             case '#_LOCATIONFULLLINE':
                 $replace = $this->address . ', ';
                 $replace = empty($this->town) ? '' : ', ' . $this->town;
                 $replace = empty($this->state) ? '' : ', ' . $this->state;
                 $replace = empty($this->postcode) ? '' : ', ' . $this->postcode;
                 $replace = empty($this->region) ? '' : ', ' . $this->region;
                 break;
             case '#_LOCATIONFULLBR':
                 $replace = $this->address . '<br /> ';
                 $replace = empty($this->town) ? '' : '<br /> ' . $this->town;
                 $replace = empty($this->state) ? '' : '<br /> ' . $this->state;
                 $replace = empty($this->postcode) ? '' : '<br /> ' . $this->postcode;
                 $replace = empty($this->region) ? '' : '<br /> ' . $this->region;
                 break;
             case '#_MAP':
                 //Depreciated
             //Depreciated
             case '#_LOCATIONMAP':
                 ob_start();
                 $template = em_locate_template('placeholders/locationmap.php', true, array('EM_Location' => $this));
                 $replace = ob_get_clean();
                 break;
             case '#_DESCRIPTION':
                 //Depreciated
             //Depreciated
             case '#_EXCERPT':
                 //Depreciated
             //Depreciated
             case '#_LOCATIONNOTES':
             case '#_LOCATIONEXCERPT':
                 $replace = $this->description;
                 if ($result == "#_EXCERPT" || $result == "#_LOCATIONEXCERPT") {
                     $matches = explode('<!--more', $this->description);
                     $replace = $matches[0];
                 }
                 break;
             case '#_LOCATIONIMAGE':
                 if ($this->image_url != '') {
                     $replace = "<img src='" . $this->image_url . "' alt='" . $this->name . "'/>";
                 }
                 break;
             case '#_LOCATIONURL':
             case '#_LOCATIONLINK':
             case '#_LOCATIONPAGEURL':
                 //Depreciated
                 $joiner = stristr(EM_URI, "?") ? "&amp;" : "?";
                 $link = EM_URI . $joiner . "location_id=" . $this->id;
                 $replace = $result == '#_LOCATIONURL' || $result == '#_LOCATIONPAGEURL' ? $link : '<a href="' . $link . '">' . $this->name . '</a>';
                 break;
             case '#_PASTEVENTS':
                 //Depreciated
             //Depreciated
//.........這裏部分代碼省略.........
開發者ID:hypenotic,項目名稱:slowfood,代碼行數:101,代碼來源:em-location.php


注:本文中的EM_Events::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。