本文整理汇总了PHP中eo_get_venue函数的典型用法代码示例。如果您正苦于以下问题:PHP eo_get_venue函数的具体用法?PHP eo_get_venue怎么用?PHP eo_get_venue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eo_get_venue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: to_object
function to_object($events = array())
{
if (is_array($events) && !empty($events)) {
//Save event data
$this->event_id = intval($events[0]['event_id']);
$this->post_id = intval($events[0]['post_id']);
$this->start = new DateTIme($events[0]['StartDate'] . ' ' . $events[0]['StartTime'], eo_get_blog_timezone());
$this->end = new DateTIme($events[0]['EndDate'] . ' ' . $events[0]['FinishTime'], eo_get_blog_timezone());
if (function_exists('date_diff')) {
$this->duration = date_diff($this->start, $this->end);
}
//Work around for PHP < 5.3
$seconds = round(abs($this->start->format('U') - $this->end->format('U')));
// 86400 = 60*60*24 seconds in a normal day
$days = floor($seconds / 86400);
$sec_diff = $seconds - $days * 86400;
$this->duration_string = '+' . $days . 'days ' . $sec_diff . ' seconds';
$this->schedule_start = new DateTime($events[0]['reoccurrence_start'], eo_get_blog_timezone());
$this->schedule_end = new DateTime($events[0]['reoccurrence_end'], eo_get_blog_timezone());
$this->allday = $events[0]['event_allday'] == 1 ? true : false;
$this->venue = (int) eo_get_venue($this->post_id);
$this->schedule = esc_html($events[0]['event_schedule']);
if ($this->is_schedule('weekly')) {
$this->meta = esc_html(implode(',', unserialize($events[0]['event_schedule_meta'])));
$this->meta = explode(',', $this->meta);
}
if ($this->is_schedule('monthly')) {
$meta = esc_attr($events[0]['event_schedule_meta']);
$bymonthday = preg_match('/BYMONTHDAY=/', $meta);
$byday = preg_match('/BYDAY=/', $meta);
//Check for the old system first...;
if ($meta == 'date') {
$this->meta = 'BYMONTHDAY=' . $this->start->format('d');
} elseif (!($bymonthday || $byday)) {
$this->meta = 'BYDAY=' . $meta;
} else {
$this->meta = $meta;
}
}
$this->frequency = intval($events[0]['event_frequency']);
$this->timezone = 'UTC';
$this->exists = true;
//Save event occurrences
foreach ($events as $event) {
//Occurrences, array of datetime objects (start date time) in UTC Timezone
$this->occurrences[$event['event_occurrence']] = new DateTIme($event['StartDate'] . ' ' . $event['StartTime'], eo_get_blog_timezone());
}
}
}
示例2: eventorganiser_event_fill_columns
function eventorganiser_event_fill_columns($column_name, $id)
{
global $post;
$series_id = empty($post->event_id) ? $id : '';
$phpFormat = 'M, j Y';
if (!eo_is_all_day($series_id)) {
$phpFormat .= '\\<\\/\\b\\r\\>' . get_option('time_format');
}
switch ($column_name) {
case 'venue':
$venue_id = eo_get_venue($post->ID);
$venue_slug = eo_get_venue_slug($post->ID);
if ($venue_id) {
echo '<a href="' . add_query_arg('event-venue', $venue_slug) . '">' . esc_html(eo_get_venue_name($venue_id)) . '</a>';
echo '<input type="hidden" value="' . $venue_id . '"/>';
}
break;
case 'datestart':
eo_the_start($phpFormat, $series_id);
break;
case 'dateend':
eo_the_end($phpFormat, $series_id);
break;
case 'reoccurence':
eo_display_reoccurence($series_id);
break;
case 'eventcategories':
$terms = get_the_terms($post->ID, 'event-category');
if (!empty($terms)) {
foreach ($terms as $term) {
$post_terms[] = '<a href="' . add_query_arg('event-category', $term->slug) . '">' . esc_html(sanitize_term_field('name', $term->name, $term->term_id, 'event-category', 'display')) . '</a>';
}
echo join(', ', $post_terms);
}
break;
default:
break;
}
// end switch
}
示例3: eventorganiser_venue_dropdown
/**
*@ignore
*@access private
*/
function eventorganiser_venue_dropdown($post_id = 0, $args)
{
$venues = get_terms('event-venue', array('hide_empty' => false));
$current = (int) eo_get_venue($post_id);
$id = !empty($args['id']) ? 'id="' . esc_attr($args['id']) . '"' : '';
$name = !empty($args['name']) ? 'name="' . esc_attr($args['name']) . '"' : '';
?>
<select <?php
echo $id . ' ' . $name;
?>
>
<option><?php
_e("Select a venue", 'eventorganiser');
?>
</option>
<?php
foreach ($venues as $venue) {
?>
<option <?php
selected($venue->term_id, $current);
?>
value="<?php
echo $venue->term_id;
?>
"><?php
echo $venue->name;
?>
</option>
<?php
}
?>
</select><?php
}
示例4: export_events
//.........这里部分代码省略.........
for ($p = 0; $p < $length; $p++) {
$rand .= $base[mt_rand($start, $end)];
}
$uid = $now->format('Ymd\\THiT') . microtime(true) . '-' . $rand . '-EO' . $post->ID . '@' . $host;
//Output event
?>
BEGIN:VEVENT
UID:<?php
echo $uid;
?>
STATUS:<?php
echo $status;
?>
DTSTAMP:<?php
echo $dtstamp;
?>
CREATED:<?php
echo $created_date;
?>
LAST-MODIFIED:<?php
echo $modified_date;
?>
<?php
if ($event->is_all_day()) {
?>
DTSTART;VALUE=DATE:<?php
echo $start_date;
?>
DTEND;VALUE=DATE:<?php
echo $end_date;
} else {
?>
DTSTART:<?php
echo $start_date;
?>
DTEND:<?php
echo $end_date;
}
?>
<?php
if ($reoccurrence_rule) {
?>
RRULE:<?php
echo $reoccurrence_rule;
?>
<?php
}
?>
SUMMARY:<?php
echo $this->escape_icalText(get_the_title());
?>
<?php
$excerpt = get_the_excerpt();
$excerpt = apply_filters('the_excerpt_rss', $excerpt);
if (!empty($excerpt)) {
?>
DESCRIPTION:<?php
echo html_entity_decode($this->escape_icalText($excerpt));
?>
<?php
}
if ($event->venue_set()) {
$venue = eo_get_venue_name(eo_get_venue());
?>
LOCATION: <?php
echo $this->escape_icalText($venue);
?>
<?php
}
$author = get_the_author();
?>
ORGANIZER: <?php
echo $this->escape_icalText($author);
?>
END:VEVENT
<?php
}
}
?>
END:VCALENDAR
<?php
//Collect output and echo
$eventsical = ob_get_contents();
ob_end_clean();
echo $eventsical;
exit;
}
示例5: do_action
<?php
}
?>
<?php
do_action('eventorganiser_additional_event_meta');
?>
</ul>
<!-- Does the event have a venue? -->
<?php
if (eo_get_venue()) {
?>
<!-- Display map -->
<div class="eo-event-venue-map">
<?php
echo eo_get_venue_map(eo_get_venue(), array('width' => '100%'));
?>
</div>
<?php
}
?>
<div style="clear:both"></div>
<hr>
</div><!-- .entry-meta -->
示例6: parse_template
function parse_template($matches)
{
global $post;
$replacement = '';
$col = array('start' => array('date' => 'StartDate', 'time' => 'StartTime'), 'end' => array('date' => 'EndDate', 'time' => 'FinishTime'), 'schedule_start' => array('date' => 'reoccurrence_start', 'time' => 'StartTime'), 'schedule_end' => array('date' => 'reoccurrence_end', 'time' => 'FinishTime'));
switch ($matches[1]) {
case 'event_title':
$replacement = get_the_title();
break;
case 'start':
case 'end':
case 'schedule_start':
case 'schedule_end':
switch (count($matches)) {
case 2:
$dateFormat = get_option('date_format');
$dateTime = get_option('time_format');
break;
case 3:
$dateFormat = self::eo_clean_input($matches[2]);
$dateTime = '';
break;
case 5:
$dateFormat = self::eo_clean_input($matches[3]);
$dateTime = self::eo_clean_input($matches[4]);
break;
}
if (eo_is_all_day(get_the_ID())) {
$replacement = eo_format_date($post->{$col}[$matches[1]]['date'] . ' ' . $post->{$col}[$matches[1]]['time'], $dateFormat);
} else {
$replacement = eo_format_date($post->{$col}[$matches[1]]['date'] . ' ' . $post->{$col}[$matches[1]]['time'], $dateFormat . $dateTime);
}
break;
case 'event_tags':
$replacement = get_the_term_list(get_the_ID(), 'event-tag', '', ', ', '');
break;
case 'event_cats':
$replacement = get_the_term_list(get_the_ID(), 'event-category', '', ', ', '');
break;
case 'event_venue':
$replacement = eo_get_venue_name();
break;
case 'event_venue_map':
if (eo_get_venue()) {
$class = isset($matches[2]) ? self::eo_clean_input($matches[2]) : '';
$class = !empty($class) ? 'class=' . $class : '';
$replacement = do_shortcode('[eo_venue_map ' . $class . ']');
}
break;
case 'event_venue_url':
$venue_link = eo_get_venue_link();
$replacement = !is_wp_error($venue_link) ? $venue_link : '';
break;
case 'event_venue_address':
$address = eo_get_venue_address();
$replacement = $address['address'];
break;
case 'event_venue_postcode':
$address = eo_get_venue_address();
$replacement = $address['postcode'];
break;
case 'event_venue_country':
$address = eo_get_venue_address();
$replacement = $address['country'];
break;
case 'event_thumbnail':
$size = isset($matches[2]) ? self::eo_clean_input($matches[2]) : '';
$size = !empty($size) ? $size : 'thumbnail';
$replacement = get_the_post_thumbnail(get_the_ID(), $size);
break;
case 'event_url':
$replacement = get_permalink();
break;
case 'event_custom_field':
$field = $matches[2];
$meta = get_post_meta(get_the_ID(), $field);
$replacement = implode($meta);
break;
case 'event_excerpt':
//Using get_the_excerpt adds a link....
if (post_password_required($post)) {
$output = __('There is no excerpt because this is a protected post.');
} else {
$output = $post->post_excerpt;
}
$replacement = wp_trim_excerpt($output);
break;
case 'cat_color':
$replacement = eo_event_color();
break;
}
return $replacement;
}
示例7: eventorganiser_escape_ical_text
$description = eventorganiser_escape_ical_text($description);
if (!empty($description)) {
echo eventorganiser_fold_ical_text("DESCRIPTION: {$description}") . "\r\n";
}
$description = wpautop(html_entity_decode(get_the_content(), ENT_COMPAT, 'UTF-8'));
$description = str_replace("\r\n", '', $description);
//Remove new lines
$description = str_replace("\n", '', $description);
$description = eventorganiser_escape_ical_text($description);
echo eventorganiser_fold_ical_text("X-ALT-DESC;FMTTYPE=text/html: {$description}") . "\r\n";
$cats = get_the_terms(get_the_ID(), 'event-category');
if ($cats && !is_wp_error($cats)) {
$cat_names = wp_list_pluck($cats, 'name');
$cat_names = array_map('eventorganiser_escape_ical_text', $cat_names);
echo 'CATEGORIES:' . implode(',', $cat_names) . "\r\n";
}
if (eo_get_venue()) {
$venue = eo_get_venue_name(eo_get_venue());
echo "LOCATION:" . eventorganiser_fold_ical_text(eventorganiser_escape_ical_text($venue)) . "\r\n";
echo "GEO:" . implode(';', eo_get_venue_latlng($venue)) . "\r\n";
}
if (get_the_author_meta('ID')) {
$author_name = eventorganiser_escape_ical_text(get_the_author());
$author_email = eventorganiser_escape_ical_text(get_the_author_meta('user_email'));
echo eventorganiser_fold_ical_text('ORGANIZER;CN="' . $author_name . '":MAILTO:' . $author_email) . "\r\n";
}
echo eventorganiser_fold_ical_text('URL;VALUE=URI:' . get_permalink()) . "\r\n";
echo "END:VEVENT\r\n";
}
}
echo "END:VCALENDAR\r\n";
示例8: parse_template
static function parse_template($matches)
{
global $post;
$replacement = '';
switch ($matches[1]) {
case 'event_title':
$replacement = get_the_title();
break;
case 'start':
case 'end':
case 'schedule_start':
case 'schedule_last':
case 'schedule_end':
switch (count($matches)) {
case 2:
$dateFormat = get_option('date_format');
$dateTime = get_option('time_format');
break;
case 3:
$dateFormat = self::eo_clean_input($matches[2]);
$dateTime = '';
break;
case 5:
$dateFormat = self::eo_clean_input($matches[3]);
$dateTime = self::eo_clean_input($matches[4]);
break;
}
$format = eo_is_all_day(get_the_ID()) ? $dateFormat : $dateFormat . $dateTime;
switch ($matches[1]) {
case 'start':
$replacement = eo_get_the_start($format);
break;
case 'end':
$replacement = eo_get_the_end($format);
break;
case 'schedule_start':
$replacement = eo_get_schedule_start($format);
break;
case 'schedule_last':
case 'schedule_end':
$replacement = eo_get_schedule_end($format);
break;
}
break;
case 'event_duration':
$start = eo_get_the_start(DATETIMEOBJ);
$end = clone eo_get_the_end(DATETIMEOBJ);
if (eo_is_all_day()) {
$end->modify('+1 minute');
}
if (function_exists('date_diff')) {
$duration = date_diff($start, $end);
$replacement = $duration->format($matches[2]);
} else {
$replacement = eo_date_interval($start, $end, $matches[2]);
}
$replacement = false;
break;
case 'event_tags':
$replacement = get_the_term_list(get_the_ID(), 'event-tag', '', ', ', '');
break;
case 'event_cats':
$replacement = get_the_term_list(get_the_ID(), 'event-category', '', ', ', '');
break;
case 'event_venue':
$replacement = eo_get_venue_name();
break;
case 'event_venue_map':
if (eo_get_venue()) {
$class = isset($matches[2]) ? self::eo_clean_input($matches[2]) : '';
$class = !empty($class) ? 'class=' . $class : '';
$replacement = eo_get_venue_map(eo_get_venue(), compact('class'));
}
break;
case 'event_venue_url':
$venue_link = eo_get_venue_link();
$replacement = !is_wp_error($venue_link) ? $venue_link : '';
break;
case 'event_venue_address':
$address = eo_get_venue_address();
$replacement = $address['address'];
break;
case 'event_venue_postcode':
$address = eo_get_venue_address();
$replacement = $address['postcode'];
break;
case 'event_venue_city':
$address = eo_get_venue_address();
$replacement = $address['city'];
break;
case 'event_venue_country':
$address = eo_get_venue_address();
$replacement = $address['country'];
break;
case 'event_venue_state':
$address = eo_get_venue_address();
$replacement = $address['state'];
break;
case 'event_venue_city':
$address = eo_get_venue_address();
//.........这里部分代码省略.........
示例9: eo_get_event_meta_list_rcumc
/**
* Returns HTML mark-up for a list of event meta information.
*
* Uses microformat.
* @since 1.7
* @ignore
* @param int $post_id The event (post) ID. Uses current event if not supplied
* @return string|bool HTML mark-up. False if an invalid $post_is provided.
*/
function eo_get_event_meta_list_rcumc($event_id = 0)
{
$event_id = (int) (empty($event_id) ? get_the_ID() : $event_id);
if (empty($event_id)) {
return false;
}
$html = '<ul class="eo-event-byline" style="margin:10px 0px;">';
$venue = get_taxonomy('event-venue');
if (($venue_id = eo_get_venue($event_id)) && $venue) {
$html .= sprintf('<ul> <a href="%s">
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
<span itemprop="name">%s</span>
</span>
</a></ul>', eo_get_venue_link($venue_id), eo_get_venue_name($venue_id));
}
$html .= '</ul>';
/**
* Filters mark-up for the event details list.
*
* The event details list is just a simple list containing details pertaining
* to the event (venue, categories, tags) etc.
*
* @param array $html The generated mark-up
* @param int $event_id Post ID of the event
*/
$html = apply_filters('eventorganiser_event_meta_list', $html, $event_id);
return $html;
}
示例10: eo_get_event_meta_list
/**
* Returns HTML mark-up for a list of event meta information.
*
* Uses microformat.
* @since 1.7
* @ignore
* @param int $post_id The event (post) ID. Uses current event if not supplied
* @return string|bool HTML mark-up. False if an invalid $post_is provided.
*/
function eo_get_event_meta_list($event_id = 0)
{
$event_id = (int) (empty($event_id) ? get_the_ID() : $event_id);
if (empty($event_id)) {
return false;
}
$html = '<ul class="eo-event-meta" style="margin:10px 0px;">';
$venue = get_taxonomy('event-venue');
if (($venue_id = eo_get_venue($event_id)) && $venue) {
$html .= sprintf('<li><strong>%s:</strong> <a href="%s">
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
<span itemprop="name">%s</span>
<span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
<meta itemprop="latitude" content="%f" />
<meta itemprop="longitude" content="%f" />
</span>
</span>
</a></li>', $venue->labels->singular_name, eo_get_venue_link($venue_id), eo_get_venue_name($venue_id), eo_get_venue_lat($venue_id), eo_get_venue_lng($venue_id));
}
if (get_the_terms($event_id, 'event-category')) {
$html .= sprintf('<li><strong>%s:</strong> %s</li>' . "\n", __('Categories', 'eventorganiser'), get_the_term_list($event_id, 'event-category', '', ', ', ''));
}
if (get_the_terms($event_id, 'event-tag') && !is_wp_error(get_the_terms($event_id, 'event-tag'))) {
$html .= sprintf('<li><strong>%s:</strong> %s</li>' . "\n", __('Tags', 'eventorganiser'), get_the_term_list($event_id, 'event-tag', '', ', ', ''));
}
$html .= '</ul>';
/**
* Filters mark-up for the event details list.
*
* The event details list is just a simple list containig details pertaining
* to the event (venue, categories, tags) etc.
*
* @param array $html The generated mark-up
* @param int $event_id Post ID of the event
*/
$html = apply_filters('eventorganiser_event_meta_list', $html, $event_id);
return $html;
}
示例11: eo_venue_name
<h4><?php
eo_venue_name();
?>
</h4>
</div>
<?php
}
?>
<?php
the_content();
?>
<?php
if (eo_get_venue()) {
$location = explode(',', eo_get_venue_name(), 2);
echo do_shortcode("[google-map-sc width=100% height=300 zoom=15 type=ROADMAP address='" . $location[1] . "']");
}
?>
<?php
echo do_shortcode('[button url="http://www.buildinstitute.com/events/" arrow="left"]All Events[/button]');
?>
<?php
}
}
?>
</main>
示例12: eo_get_event_meta_list
/**
* Returns HTML mark-up for a list of event meta information.
*
* Uses microformat.
* @since 1.7
* @ignore
* @param int $post_id The event (post) ID. Uses current event if not supplied
* @return string|bool HTML mark-up. False if an invalid $post_is provided.
*/
function eo_get_event_meta_list($post_id = 0)
{
$post_id = (int) (empty($post_id) ? get_the_ID() : $post_id);
if (empty($post_id)) {
return false;
}
$html = '<ul class="eo-event-meta" style="margin:10px 0px;">';
if ($venue_id = eo_get_venue($post_id)) {
$html .= sprintf('<li><strong>%s:</strong> <a href="%s">
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
<span itemprop="name">%s</span>
<span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
<meta itemprop="latitude" content="%f" />
<meta itemprop="longitude" content="%f" />
</span>
</span></a></li>', __('Venue', 'eventorganiser'), eo_get_venue_link($venue_id), eo_get_venue_name($venue_id), eo_get_venue_lat($venue_id), eo_get_venue_lng($venue_id));
}
if (get_the_terms(get_the_ID(), 'event-category')) {
$html .= sprintf('<li><strong>%s:</strong> %s</li>', __('Categories', 'eventorganiser'), get_the_term_list(get_the_ID(), 'event-category', '', ', ', ''));
}
if (get_the_terms(get_the_ID(), 'event-tag') && !is_wp_error(get_the_terms(get_the_ID(), 'event-tag'))) {
$html .= sprintf('<li><strong>%s:</strong> %s</li>', __('Tags', 'eventorganiser'), get_the_term_list(get_the_ID(), 'event-tag', '', ', ', ''));
}
$html .= '</ul>';
return apply_filters('eventorganiser_event_meta_list', $html, $post_id);
}
示例13: _eventorganiser_details_metabox
/**
* Sets up the event data metabox
* This allows user to enter date / time, reoccurrence and venue data for the event
* @ignore
* @since 1.0.0
*/
function _eventorganiser_details_metabox($post)
{
global $wp_locale;
//Sets the format as php understands it, and textual.
$phpFormat = eventorganiser_get_option('dateformat');
if ('d-m-Y' == $phpFormat) {
$format = 'dd-mm-yyyy';
//Human form
} elseif ('Y-m-d' == $phpFormat) {
$format = 'yyyy-mm-dd';
//Human form
} else {
$format = 'mm-dd-yyyy';
//Human form
}
$is24 = eventorganiser_blog_is_24();
$time_format = $is24 ? 'H:i' : 'g:ia';
//Get the starting day of the week
$start_day = intval(get_option('start_of_week'));
$ical_days = array('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA');
//Retrieve event details
extract(eo_get_event_schedule($post->ID));
$venues = eo_get_venues();
$venue_id = (int) eo_get_venue($post->ID);
//$sche_once is used to disable date editing unless the user specifically requests it.
//But a new event might be recurring (via filter), and we don't want to 'lock' new events.
//See http://wordpress.org/support/topic/wrong-default-in-input-element
$sche_once = $schedule == 'once' || !empty(get_current_screen()->action);
if (!$sche_once) {
$notices = '<strong>' . __('This is a reoccurring event', 'eventorganiser') . '</strong>. ' . __('Check to edit this event and its reoccurrences', 'eventorganiser') . ' <input type="checkbox" id="HWSEvent_rec" name="eo_input[AlterRe]" value="yes">';
} else {
$notices = '';
}
//Start of meta box
if ($notices = apply_filters('eventorganiser_event_metabox_notice', $notices, $post)) {
echo '<div class="updated below-h2"><p>' . $notices . '</p></div>';
}
?>
<div class="<?php
echo $sche_once ? 'onetime' : 'reoccurence';
?>
">
<p><?php
printf(__('Ensure dates are entered in %1$s format and times in %2$s (24 hour) format', 'eventorganiser'), '<strong>' . $format . '</strong>', ' <strong>hh:mm</strong>');
?>
</p>
<table id="eventorganiser_event_detail" class="form-table">
<tr valign="top" class="event-date">
<td class="eo-label"><?php
echo __('Start Date/Time', 'eventorganiser') . ':';
?>
</td>
<td>
<input class="ui-widget-content ui-corner-all" name="eo_input[StartDate]" size="10" maxlength="10" id="from_date" <?php
disabled(!$sche_once);
?>
value="<?php
echo $start->format($phpFormat);
?>
"/>
<?php
printf('<input name="eo_input[StartTime]" class="eo_time ui-widget-content ui-corner-all" size="6" maxlength="8" id="HWSEvent_time" %s value="%s"/>', disabled(!$sche_once || $all_day, true, false), eo_format_datetime($start, $time_format));
?>
</td>
</tr>
<tr valign="top" class="event-date">
<td class="eo-label"><?php
echo __('End Date/Time', 'eventorganiser') . ':';
?>
</td>
<td>
<input class="ui-widget-content ui-corner-all" name="eo_input[EndDate]" size="10" maxlength="10" id="to_date" <?php
disabled(!$sche_once);
?>
value="<?php
echo $end->format($phpFormat);
?>
"/>
<?php
printf('<input name="eo_input[FinishTime]" class="eo_time ui-widget-content ui-corner-all" size="6" maxlength="8" id="HWSEvent_time2" %s value="%s"/>', disabled(!$sche_once || $all_day, true, false), eo_format_datetime($end, $time_format));
?>
<label>
<input type="checkbox" id="eo_allday" <?php
checked($all_day);
?>
name="eo_input[allday]" <?php
disabled(!$sche_once);
//.........这里部分代码省略.........
示例14: eventorganiser_details_metabox
//.........这里部分代码省略.........
checked($event->occursBy() == 'BYMONTHDAY', false);
?>
value="BYDAY=" />
<label for="byday" > <?php
_e("day of week", 'eventorganiser');
?>
</label>
</p>
<p class="reoccurrence_label">
<?php
_e("until", 'eventorganiser');
?>
<input <?php
disabled($event->is_reoccurring());
?>
class="ui-widget-content ui-corner-all" name="eo_input[schedule_end]" id="recend" size="10" maxlength="10" disabled="disabled" value="<?php
$event->the_schedule_end($phpFormat);
?>
"/>
</p>
<p id="event_summary"> </p>
</td>
</tr>
<tr>
<td class="label"> <?php
_e("Venue", 'eventorganiser');
?>
: </td>
<td>
<?php
$venues = get_terms('event-venue', array('hide_empty' => false));
$current_id = (int) eo_get_venue(get_the_ID());
?>
<!-- If javascript is disabed, a simple drop down menu box is displayed to choose venue.
Otherwise, the user is able to search the venues by typing in the input box.-->
<select size="50" id="venue_select" name="eo_input[event-venue]">
<option><?php
_e("Select a venue", 'eventorganiser');
?>
</option>
<?php
foreach ($venues as $venue) {
?>
<option <?php
selected($venue->term_id, $current_id);
?>
value="<?php
echo $venue->term_id;
?>
"><?php
echo $venue->name;
?>
</option>
<?php
}
?>
</select>
<span style="font-size:0.8em;line-height:0.8em;"> <?php
_e("Search for a venue. To add a venues go to the venue page.", 'eventorganiser');
?>
</span>
</td>
</tr>
<tr class="venue_row <?php
if (!$current_id) {
echo 'novenue';
}
?>
" >
<td></td>
<td>
<div id="eventorganiser_venue_meta" style="display:none;">
<input type="hidden" id="eo_venue_Lat" value="<?php
eo_venue_lat($current_id);
?>
" />
<input type="hidden" id="eo_venue_Lng" value="<?php
eo_venue_lng($current_id);
?>
" />
</div>
<div id="venuemap" class="ui-widget-content ui-corner-all gmap3"></div>
<div class="clear"></div>
</td>
</tr>
</table>
</div>
<?php
// create a custom nonce for submit verification later
wp_nonce_field('eventorganiser_event_update_' . get_the_ID(), '_eononce');
}
示例15: prepare_civi_event
/**
* Prepare a CiviEvent with data from an EO Event
*
* @since 0.1
*
* @param object $post The WordPress post object
* @return array $civi_event The basic CiviEvent data
*/
public function prepare_civi_event($post)
{
// init CiviEvent array
$civi_event = array('version' => 3);
// add items that are common to all CiviEvents
$civi_event['title'] = $post->post_title;
$civi_event['description'] = $post->post_content;
$civi_event['summary'] = strip_tags($post->post_excerpt);
$civi_event['created_date'] = $post->post_date;
$civi_event['is_public'] = 1;
$civi_event['is_active'] = 1;
$civi_event['participant_listing_id'] = NULL;
// get venue for this event
$venue_id = eo_get_venue($post->ID);
// get CiviEvent location
$location_id = $this->plugin->eo_venue->get_civi_location($venue_id);
// did we get one?
if (is_numeric($location_id)) {
// add to our params
$civi_event['loc_block_id'] = $location_id;
// set CiviCRM to add map
$civi_event['is_map'] = 1;
}
// online registration off by default
$civi_event['is_online_registration'] = 0;
// get CiviEvent online registration value
$is_reg = $this->plugin->eo->get_event_registration($post->ID);
// did we get one?
if (is_numeric($is_reg) and $is_reg != 0) {
// add to our params
$civi_event['is_online_registration'] = 1;
}
// participant_role default
$civi_event['default_role_id'] = 0;
// get existing role ID
$existing_id = $this->get_participant_role($post);
// did we get one?
if ($existing_id !== false and is_numeric($existing_id) and $existing_id != 0) {
// add to our params
$civi_event['default_role_id'] = $existing_id;
}
// get event type pseudo-ID (or value), because it is required in CiviCRM
$type_value = $this->get_default_event_type_value($post);
// well?
if ($type_value === false) {
// error
wp_die(__('You must have some CiviCRM event types defined', 'civicrm-event-organiser'));
}
// assign event type value
$civi_event['event_type_id'] = $type_value;
// --<
return $civi_event;
}