function update

This commit is contained in:
magepeopleteam 2020-12-03 05:54:04 +00:00
parent 9532c785bb
commit 6893782d91
4 changed files with 65 additions and 23 deletions

View File

@ -3420,4 +3420,65 @@ if($thumbnail_id > 0){
}else{
echo get_the_post_thumbnail($event_id, 'full');
}
}
}
add_action('mep_event_list_date_li','mep_event_list_upcoming_date_li',10,2);
function mep_event_list_upcoming_date_li($event_id,$type='grid'){
$hide_only_end_time_list = mep_get_option('mep_event_hide_end_time_list', 'general_setting_sec', 'no');
$event_start_datetime = get_post_meta($event_id,'event_start_datetime',true);
$event_end_datetime = get_post_meta($event_id,'event_end_datetime',true);
$event_multidate = get_post_meta($event_id,'mep_event_more_date',true) ? get_post_meta($event_id,'mep_event_more_date',true) : [];
$event_std[] = array(
'event_std' => $event_start_datetime
);
$event_std[] = array(
'event_etd' => $event_end_datetime
);
if(sizeof($event_multidate) > 0){
foreach($event_multidate as $event_mdt){
$event_std[]['event_std'] = $event_mdt['event_more_start_date'].' '.$event_mdt['event_more_start_time'];
$event_std[]['event_etd'] = $event_mdt['event_more_end_date'].' '.$event_mdt['event_more_end_time'];
}
}
// print_r($event_std);
$cn = 0;
foreach($event_std as $_event_std){
// print_r($_event_std);
$std = $_event_std['event_std'];
if (strtotime(current_time('Y-m-d H:i')) < strtotime($std) && $cn == 0) {
if($type == 'grid'){
?>
<li class="mep_list_event_date">
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
<div class="evl-cc">
<h5>
<?php echo get_mep_datetime($std, 'date-text'); ?>
<?php echo mep_get_option('mep_time_text', 'label_setting_sec') ? mep_get_option('mep_time_text', 'label_setting_sec') : _e('Time:', 'mage-eventpress'); ?>
</h5>
<h6><?php echo get_mep_datetime($_event_std['event_std'], 'time');
if ($hide_only_end_time_list == 'no') { ?> - <?php echo get_mep_datetime($_event_std['event_etd'], 'date-time-text'); } ?></h6>
</div>
</li>
<?php
}elseif($type == 'minimal'){
?>
<span class='mep_minimal_list_date'><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($std, 'date-text').' '; echo get_mep_datetime($_event_std['event_std'], 'time'); if ($hide_only_end_time_list == 'no') { ?> - <?php echo get_mep_datetime($_event_std['event_etd'], 'date-time-text'); } ?></span>
<?php
}
$cn++;
}
}
}

View File

@ -89,26 +89,7 @@ $mep_hide_event_hover_btn_text = mep_get_option('mep_hide_event_hover_btn_text
<?php }
}
if ($hide_time_list == 'no' && $recurring == 'no') {
?>
<li class="mep_list_event_date">
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
<div class="evl-cc">
<?php if (strtotime(current_time('Y-m-d H:i')) < strtotime($event_meta['event_start_datetime'][0])) { ?>
<h5>
<?php if (sizeof($event_multidate) > 0) {
//echo get_mep_datetime($event_meta['event_start_datetime'][0], 'date-text');
}
?>
<?php echo mep_get_option('mep_time_text', 'label_setting_sec') ? mep_get_option('mep_time_text', 'label_setting_sec') : _e('Time:', 'mage-eventpress'); ?>
</h5>
<?php } ?>
<h6><?php echo get_mep_datetime($event_meta['event_start_datetime'][0], 'time');
if ($hide_only_end_time_list == 'no') { ?> - <?php echo get_mep_datetime($event_meta['event_end_datetime'][0], 'time'); } ?></h6>
</div>
</li>
<?php
do_action('mep_event_list_date_li',$event_id,'grid');
}elseif($hide_time_list == 'no' && $recurring != 'no'){
do_action('mep_event_list_upcoming_date_li',$event_id);
}?>

View File

@ -18,7 +18,7 @@
<?php if ($available_seat == 0) {
do_action('mep_show_waitlist_label');
} ?>
<h3 class='mep_list_date'> <?php if($recurring == 'no'){ ?><span class='mep_minimal_list_date'><i class="fa fa-calendar"></i> <?php echo mep_get_event_upcomming_date($event_id,'time'); ?> - <?php if($start_datetime == $end_datetime){ echo get_mep_datetime($event_meta['event_end_datetime'][0],'time'); }else{ echo get_mep_datetime($event_meta['event_end_datetime'][0],'date-time-text'); } ?></span> <?php } ?> <span class='mep_minimal_list_location'><i class='fa fa-map-marker'></i> <?php mep_get_event_city($event_id); ?></span></h3>
<h3 class='mep_list_date'> <?php do_action('mep_event_list_date_li',$event_id,'minimal'); ?> <span class='mep_minimal_list_location'><i class='fa fa-map-marker'></i> <?php mep_get_event_city($event_id); ?></span></h3>
</a>
<?php do_action('mep_event_list_loop_footer',$event_id); ?>

View File

@ -11,7 +11,7 @@
<?php if ($available_seat == 0) {
do_action('mep_show_waitlist_label');
} ?>
<h3 class='mep_list_date'> <?php if($recurring == 'no'){ ?> <span class='mep_minimal_list_date'><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($event_meta['event_start_datetime'][0],'date-time-text'); ?> - <?php if($start_datetime == $end_datetime){ echo get_mep_datetime($event_meta['event_end_datetime'][0],'time'); }else{ echo get_mep_datetime($event_meta['event_end_datetime'][0],'date-time-text'); } ?></span> <?php } ?> <span class='mep_minimal_list_location'><i class='fa fa-map-marker'></i> <?php mep_get_event_city($event_id); ?></span></h3></a>
<h3 class='mep_list_date'> <?php do_action('mep_event_list_date_li',$event_id,'minimal'); ?> <span class='mep_minimal_list_location'><i class='fa fa-map-marker'></i> <?php mep_get_event_city($event_id); ?></span></h3></a>
<?php do_action('mep_event_list_loop_footer',$event_id); ?>
</div>
</div>