version 3.2.6 released

This commit is contained in:
magepeopleteam 2020-05-24 08:17:41 +00:00
parent 07b4abc7e3
commit 3f2589d3a8
38 changed files with 1681 additions and 1402 deletions

View File

@ -1,4 +1,7 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action( 'admin_menu', 'mep_addon_list_menu',10,99);
function mep_addon_list_menu() {

View File

@ -1,4 +1,7 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* The Admin Enqueue Scripts & Style Files are Hooked up below for WooOCmmerce Event Manager Plugin

View File

@ -1,4 +1,8 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This File is a very important file, Because Its gettings Data from user selection on event details page, and prepare the data send to cart item and lastly save into order table after checkout
*/
@ -31,6 +35,11 @@ function mep_add_custom_fields_text_to_cart_item($cart_item_data, $product_id, $
$user = $form_position == 'details_page' ? mep_save_attendee_info_into_cart($product_id) : array();
$validate = mep_cart_ticket_type('validation_data', $total_price,$product_id);
// echo '<pre>';
// print_r($ticket_type_arr);
// // print_r($qty);
// die();
/**
* Now Store the datas into Cart Session
*/
@ -160,30 +169,30 @@ function mep_checkout_validation($posted)
foreach ($items as $item => $values) {
$event_id = array_key_exists('event_id', $values) ? $values['event_id'] : 0; // $values['event_id'];
if (get_post_type($event_id) == 'mep_events') {
$total_seat = mep_event_total_seat($event_id, 'total');
$total_resv = mep_event_total_seat($event_id, 'resv');
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat($event_id, 'total'), $event_id);
$total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat($event_id, 'resv'), $event_id);
$total_sold = mep_ticket_sold($event_id);
$total_left = $total_seat - ($total_sold + $total_resv);
$event_validate_info = $values['event_validate_info'] ? $values['event_validate_info'] : array();
$ee = 0;
if (is_array($event_validate_info) && sizeof($event_validate_info) > 0) {
foreach ($event_validate_info as $inf) {
$ee = $ee + $inf['validation_ticket_qty'];
if($recurring == 'no'){
$event_validate_info = $values['event_validate_info'] ? $values['event_validate_info'] : array();
$ee = 0;
if (is_array($event_validate_info) && sizeof($event_validate_info) > 0) {
foreach ($event_validate_info as $inf) {
$ee = $ee + $inf['validation_ticket_qty'];
}
}
}
if ($ee > $total_left) {
$event = get_the_title($event_id);
wc_add_notice(__("Sorry, Seats are not available in <b>$event</b>, Available Seats <b>$total_left</b> but you selected <b>$ee</b>", 'mage-eventpress'), 'error');
}
if ($ee > $total_left) {
$event = get_the_title($event_id);
wc_add_notice(__("Sorry, Seats are not available in <b>$event</b>, Available Seats <b>$total_left</b> but you selected <b>$ee</b>", 'mage-eventpress'), 'error');
}
}
}
}
}
/**
* The Final function for cart handleing, If everything is fine after user hit the place order button then the below function will send the order data into the next hook for order processing and save to order meta data.
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,8 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This is the Main Query Function For Query the Event List, Just Pass the Required values It will return the Query As Object.
*/

View File

@ -1,4 +1,8 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This will be used for Taxonomy Meta Box with the Brand New Mage Freamwork
*/

View File

@ -1,4 +1,7 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_org_add_form_fields', 'mep_org_tax_location_fileds', 10, 2);
function mep_org_tax_location_fileds($taxonomy)

View File

@ -1,4 +1,7 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('wp_head', 'mep_user_custom_styles', 10, 999);
function mep_user_custom_styles()

View File

@ -1,19 +1,23 @@
<?php
add_action('mep_event_add_calender','mep_ev_calender');
function mep_ev_calender($event_id){
?>
<div class="calender-url">
<?php
/**
* Action Hook mep_before_add_calendar_button & mep_after_add_calendar_button
*/
do_action('mep_before_add_calendar_button');
mep_add_to_google_calender_link($event_id);
do_action('mep_after_add_calendar_button');
?>
</div>
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_add_calender', 'mep_ev_calender');
if (!function_exists('mep_ev_calender')) {
function mep_ev_calender($event_id)
{
?>
<div class="calender-url">
<?php
/**
* Action Hook mep_before_add_calendar_button & mep_after_add_calendar_button
*/
do_action('mep_before_add_calendar_button');
mep_add_to_google_calender_link($event_id);
do_action('mep_after_add_calendar_button');
?>
</div>
<?php
}
}

View File

@ -1,278 +1,282 @@
<?php
add_action('mep_add_to_cart','mep_get_event_reg_btn');
// Get Event Registration Button
function mep_get_event_reg_btn($event_id=''){
global $post,$event_meta;
$total_book = 0;
$post_id = $event_id ? $event_id : get_the_id();
$event_meta = get_post_custom($post_id);
$event_expire_on_old = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$event_expire_date = $event_meta[$event_expire_on][0];
$event_sqi = $event_meta['mep_sqi'][0];
$mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
$mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
$mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
$mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
$mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
$mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
$mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
$mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
$mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
$mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
// $simple_rsv = array_key_exists('mep_rsv_seat', $event_meta) ? $event_meta['mep_rsv_seat'][0] : 0;
// $total_book = ($total_book + $simple_rsv);
// $seat_left = ((int)$event_meta['mep_total_seat'][0]- (int)$total_book);
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s',$time);
$datetime1 = new DateTime();
$datetime2 = new DateTime($newformat);
$interval = $datetime1->diff($datetime2);
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$total_seat = mep_event_total_seat($post_id,'total');
$total_resv = mep_event_total_seat($post_id,'resv');
$total_sold = mep_ticket_sold($post_id);
$total_left = $total_seat - ($total_sold + $total_resv);
$reg_status = array_key_exists('mep_reg_status', $event_meta) ? $event_meta['mep_reg_status'][0] : '';
$seat_left = apply_filters( 'mep_event_total_seat_count', $total_left, $post_id );
$current = current_time('Y-m-d H:i:s');
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s',$time);
$recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no';
if($recurring == 'yes'){
$event_more_dates = get_post_meta($post_id,'mep_event_more_date',true) ? get_post_meta($post_id,'mep_event_more_date',true) : array();
$md = end($event_more_dates);
$more_date = $md['event_more_start_date'].' '.$md['event_more_start_time'];
$newformat = empty($event_more_dates) ? $newformat : date('Y-m-d H:i:s',strtotime($more_date));
}
// $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC';
// date_default_timezone_set($default_timezone_val);
$datetime1 = new DateTime($newformat);
$datetime2 = new DateTime($current);
$interval = date_diff($datetime2, $datetime1);
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$leftt = apply_filters( 'mep_event_total_seat_count', $total_left, $post_id );
$days = $interval->d;
$hours = $interval->h;
$minutes = $interval->i;
$dd = $days > 0 ? $days." days " : '';
$hh = $hours>0 ? $hours." hours " : '';
$mm = $minutes>0 ? $minutes." minutes " : '';
$qty_typec = $event_meta['qty_box_type'][0];
$cart_product_id = get_post_meta($post_id,'link_wc_product',true) ? esc_attr(get_post_meta($post_id,'link_wc_product',true)) : esc_attr($post_id);
/**
* First Checking If the registration status enable or disable
*/
if($reg_status!='off'){
/**
* Then Checking If the event date already gone or not
*/
if(strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)){
/**
* If The event expired then it fire below Hook, The event expire texts arein the inc/template-parts/event_labels.php file
*/
do_action('mep_event_expire_text');
/**
* If the event is not expired then Its checking the available seat status
*/
}elseif($seat_left<=0){
/**
* If All the seats are booked then it fire the below hooks, The event no seat texts are in the inc/template-parts/event_labels.php file
*/
do_action('mep_event_no_seat_text');
do_action('mep_after_no_seat_notice');
}else{
/**
* If everything is fine then its go on ....
*/
?>
<!-- Register Now Title -->
<h4 class="mep-cart-table-title">
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec') ? mep_get_option('mep_register_now_text', 'label_setting_sec') : _e('Register Now:','mage-eventpress'); ?>
</h4>
<!--The event add to cart main form start here-->
<form action="" method='post' id="mage_event_submit">
<?php
/**
* Here is a magic hook which fire just before of the Add to Cart Button, And the Ticket type & Extra service list are hooked up into this, You can find them into inc/template-parts/event_ticket_type_extra_service.php
*/
do_action('mep_event_ticket_type_extra_service',$post_id);
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id,"_price",true); ?>"/>
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
<td align="left" class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec') ? mep_get_option('mep_quantity_text', 'label_setting_sec') : _e('Quantity:','mage-eventpress');
if($mep_event_ticket_type){ ?>
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box" step="1" min="1" max="<?php echo $leftt; ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
<span id="ttyttl"></span>
<?php } ?>
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec') ? mep_get_option('mep_total_text', 'label_setting_sec') : _e('Total','mage-eventpress'); ?>
<span id="usertotal"></span>
</span>
</td>
<td align="right">
<input type="hidden" name="mep_event_location_cart" value="<?php trim(mep_ev_location_ticket($post_id,$event_meta)); ?>">
<input type="hidden" name="mep_event_date_cart" value="<?php do_action('mep_event_date'); ?>">
<button type="submit" name="add-to-cart" value="<?php echo $cart_product_id; ?>" class="single_add_to_cart_button button alt btn-mep-event-cart"><?php _e(mep_get_label($post_id,'mep_cart_btn_text','Register This Event'),'mage-eventpress'); ?> </button>
</td>
</tr>
</table>
<!--The Add to cart button table start Here-->
</form>
<!--The event add to cart main form end here-->
<?php
}
} // End Of checking Registration status
}
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_add_to_cart', 'mep_get_event_reg_btn');
if (!function_exists('mep_get_event_reg_btn')) {
// Get Event Registration Button
function mep_get_event_reg_btn($event_id = '')
{
global $post, $event_meta;
$total_book = 0;
$post_id = $event_id ? $event_id : get_the_id();
$event_meta = get_post_custom($post_id);
$event_expire_on_old = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$event_expire_date = $event_meta[$event_expire_on][0];
$event_sqi = $event_meta['mep_sqi'][0];
$mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
$mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
$mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
$mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
$mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
$mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
$mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
$mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
$mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
$mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s', $time);
$datetime1 = new DateTime();
$datetime2 = new DateTime($newformat);
$interval = $datetime1->diff($datetime2);
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat($post_id, 'total'), $post_id);
$total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat($post_id, 'resv'), $post_id);
$total_sold = mep_ticket_sold($post_id);
$total_left = $total_seat - ($total_sold + $total_resv);
$reg_status = array_key_exists('mep_reg_status', $event_meta) ? $event_meta['mep_reg_status'][0] : '';
$seat_left = apply_filters('mep_event_total_seat_count', $total_left, $post_id);
$current = current_time('Y-m-d H:i:s');
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s', $time);
$recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no';
if ($recurring == 'yes') {
$event_more_dates = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array();
$md = end($event_more_dates);
$more_date = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
$newformat = empty($event_more_dates) ? $newformat : date('Y-m-d H:i:s', strtotime($more_date));
}
// $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC';
// date_default_timezone_set($default_timezone_val);
$datetime1 = new DateTime($newformat);
$datetime2 = new DateTime($current);
$interval = date_diff($datetime2, $datetime1);
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$leftt = apply_filters('mep_event_total_seat_count', $total_left, $post_id);
$days = $interval->d;
$hours = $interval->h;
$minutes = $interval->i;
$dd = $days > 0 ? $days . " days " : '';
$hh = $hours > 0 ? $hours . " hours " : '';
$mm = $minutes > 0 ? $minutes . " minutes " : '';
$qty_typec = $event_meta['qty_box_type'][0];
$cart_product_id = get_post_meta($post_id, 'link_wc_product', true) ? esc_attr(get_post_meta($post_id, 'link_wc_product', true)) : esc_attr($post_id);
add_action('mep_add_to_cart_list','mep_get_event_reg_btn_list');
// Get Event Registration Button
function mep_get_event_reg_btn_list(){
global $post,$event_meta;
$total_book = 0;
$post_id = $post->ID;
$event_meta = get_post_custom($post_id);
$event_expire_on_old = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$event_expire_date = $event_meta[$event_expire_on][0];
$event_sqi = $event_meta['mep_sqi'][0];
$mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
$mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
$mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
$mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
$mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
$mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
$mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
$mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
$mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
$mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
// $simple_rsv = array_key_exists('mep_rsv_seat', $event_meta) ? $event_meta['mep_rsv_seat'][0] : 0;
// $total_book = ($total_book + $simple_rsv);
// $seat_left = ((int)$event_meta['mep_total_seat'][0]- (int)$total_book);
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s',$time);
$datetime1 = new DateTime();
$datetime2 = new DateTime($newformat);
$interval = $datetime1->diff($datetime2);
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$total_seat = mep_event_total_seat(get_the_id(),'total');
$total_resv = mep_event_total_seat(get_the_id(),'resv');
$total_sold = mep_ticket_sold(get_the_id());
$total_left = $total_seat - ($total_sold + $total_resv);
$reg_status = array_key_exists('mep_reg_status', $event_meta) ? $event_meta['mep_reg_status'][0] : '';
$seat_left = apply_filters( 'mep_event_total_seat_count', $total_left, get_the_id() );
$current = current_time('Y-m-d H:i:s');
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s',$time);
$recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no';
if($recurring == 'yes'){
$event_more_dates = get_post_meta($post_id,'mep_event_more_date',true) ? get_post_meta($post_id,'mep_event_more_date',true) : array();
$md = end($event_more_dates);
$more_date = $md['event_more_start_date'].' '.$md['event_more_start_time'];
$newformat = empty($event_more_dates) ? $newformat : date('Y-m-d H:i:s',strtotime($more_date));
}
// $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC';
// date_default_timezone_set($default_timezone_val);
$datetime1 = new DateTime($newformat);
$datetime2 = new DateTime($current);
$interval = date_diff($datetime2, $datetime1);
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$leftt = apply_filters( 'mep_event_total_seat_count', $total_left, get_the_id() );
$days = $interval->d;
$hours = $interval->h;
$minutes = $interval->i;
$dd = $days > 0 ? $days." days " : '';
$hh = $hours>0 ? $hours." hours " : '';
$mm = $minutes>0 ? $minutes." minutes " : '';
$qty_typec = $event_meta['qty_box_type'][0];
$cart_product_id = get_post_meta($post_id,'link_wc_product',true) ? esc_attr(get_post_meta($post_id,'link_wc_product',true)) : esc_attr($post_id);
/**
* First Checking If the registration status enable or disable
*/
if($reg_status!='off'){
/**
* Then Checking If the event date already gone or not
*/
if(strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)){
/**
* If The event expired then it fire below Hook, The event expire texts arein the inc/template-parts/event_labels.php file
*/
do_action('mep_event_expire_text');
/**
* If the event is not expired then Its checking the available seat status
*/
}elseif($seat_left<=0){
/**
* If All the seats are booked then it fire the below hooks, The event no seat texts are in the inc/template-parts/event_labels.php file
*/
do_action('mep_event_no_seat_text');
do_action('mep_after_no_seat_notice');
}else{
/**
* If everything is fine then its go on ....
*/
?>
<!-- Register Now Title -->
<h4 class="mep-cart-table-title">
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec') ? mep_get_option('mep_register_now_text', 'label_setting_sec') : _e('Register Now:','mage-eventpress'); ?>
</h4>
<!--The event add to cart main form start here-->
<form action="" method='post' id="mage_event_submit">
<?php
* First Checking If the registration status enable or disable
*/
if ($reg_status != 'off') {
/**
* Here is a magic hook which fire just before of the Add to Cart Button, And the Ticket type & Extra service list are hooked up into this, You can find them into inc/template-parts/event_ticket_type_extra_service.php
*/
do_action('mep_event_ticket_types_list');
do_action('mep_event_extra_service_list');
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id,"_price",true); ?>"/>
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
<td align="left" class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec') ? mep_get_option('mep_quantity_text', 'label_setting_sec') : _e('Quantity:','mage-eventpress');
if($mep_event_ticket_type){ ?>
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box" step="1" min="1" max="<?php echo $leftt; ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
<span id="ttyttl"></span>
<?php } ?>
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec') ? mep_get_option('mep_total_text', 'label_setting_sec') : _e('Total','mage-eventpress'); ?>
<span id="usertotal"></span>
</span>
</td>
<td align="right">
<input type="hidden" name="mep_event_location_cart" value="<?php trim(mep_ev_location_ticket($post_id,$event_meta)); ?>">
<input type="hidden" name="mep_event_date_cart" value="<?php do_action('mep_event_date'); ?>">
<button type="submit" name="add-to-cart" value="<?php echo $cart_product_id; ?>" class="single_add_to_cart_button button alt btn-mep-event-cart"><?php _e(mep_get_label($post_id,'mep_cart_btn_text','Register This Event'),'mage-eventpress'); ?> </button>
</td>
</tr>
</table>
<!--The Add to cart button table start Here-->
</form>
<!--The event add to cart main form end here-->
<?php
* Then Checking If the event date already gone or not
*/
if (strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)) {
/**
* If The event expired then it fire below Hook, The event expire texts arein the inc/template-parts/event_labels.php file
*/
do_action('mep_event_expire_text');
/**
* If the event is not expired then Its checking the available seat status
*/
} elseif ($seat_left <= 0) {
/**
* If All the seats are booked then it fire the below hooks, The event no seat texts are in the inc/template-parts/event_labels.php file
*/
do_action('mep_event_no_seat_text');
do_action('mep_after_no_seat_notice');
} else {
/**
* If everything is fine then its go on ....
*/
?>
<!-- Register Now Title -->
<h4 class="mep-cart-table-title">
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec') ? mep_get_option('mep_register_now_text', 'label_setting_sec') : _e('Register Now:', 'mage-eventpress'); ?>
</h4>
<!--The event add to cart main form start here-->
<form action="" method='post' id="mage_event_submit">
<?php
/**
* Here is a magic hook which fire just before of the Add to Cart Button, And the Ticket type & Extra service list are hooked up into this, You can find them into inc/template-parts/event_ticket_type_extra_service.php
*/
do_action('mep_event_ticket_type_extra_service', $post_id);
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id, "_price", true); ?>" />
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
<td align="left" class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec') ? mep_get_option('mep_quantity_text', 'label_setting_sec') : _e('Quantity:', 'mage-eventpress');
if ($mep_event_ticket_type) { ?>
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box" step="1" min="1" max="<?php echo $leftt; ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
<span id="ttyttl"></span>
<?php } ?>
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec') ? mep_get_option('mep_total_text', 'label_setting_sec') : _e('Total', 'mage-eventpress'); ?>
<span id="usertotal"></span>
</span>
</td>
<td align="right">
<input type="hidden" name="mep_event_location_cart" value="<?php trim(mep_ev_location_ticket($post_id, $event_meta)); ?>">
<input type="hidden" name="mep_event_date_cart" value="<?php do_action('mep_event_date'); ?>">
<button type="submit" name="add-to-cart" value="<?php echo $cart_product_id; ?>" class="single_add_to_cart_button button alt btn-mep-event-cart"><?php _e(mep_get_label($post_id, 'mep_cart_btn_text', 'Register This Event'), 'mage-eventpress'); ?> </button>
</td>
</tr>
</table>
<!--The Add to cart button table start Here-->
</form>
<!--The event add to cart main form end here-->
<?php
}
} // End Of checking Registration status
}
}
} // End Of checking Registration status
add_action('mep_add_to_cart_list', 'mep_get_event_reg_btn_list');
if (!function_exists('mep_get_event_reg_btn_list')) {
// Get Event Registration Button
function mep_get_event_reg_btn_list()
{
global $post, $event_meta;
$total_book = 0;
$post_id = $post->ID;
$event_meta = get_post_custom($post_id);
$event_expire_on_old = mep_get_option('mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$event_expire_date = $event_meta[$event_expire_on][0];
$event_sqi = $event_meta['mep_sqi'][0];
$mep_full_name = strip_tags($event_meta['mep_full_name'][0]);
$mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]);
$mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]);
$mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]);
$mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]);
$mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]);
$mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]);
$mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]);
$mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]);
$mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]);
// $simple_rsv = array_key_exists('mep_rsv_seat', $event_meta) ? $event_meta['mep_rsv_seat'][0] : 0;
// $total_book = ($total_book + $simple_rsv);
// $seat_left = ((int)$event_meta['mep_total_seat'][0]- (int)$total_book);
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s', $time);
$datetime1 = new DateTime();
$datetime2 = new DateTime($newformat);
$interval = $datetime1->diff($datetime2);
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$total_seat = mep_event_total_seat(get_the_id(), 'total');
$total_resv = mep_event_total_seat(get_the_id(), 'resv');
$total_sold = mep_ticket_sold(get_the_id());
$total_left = $total_seat - ($total_sold + $total_resv);
$reg_status = array_key_exists('mep_reg_status', $event_meta) ? $event_meta['mep_reg_status'][0] : '';
$seat_left = apply_filters('mep_event_total_seat_count', $total_left, get_the_id());
$current = current_time('Y-m-d H:i:s');
$time = strtotime($event_expire_date);
$newformat = date('Y-m-d H:i:s', $time);
$recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no';
if ($recurring == 'yes') {
$event_more_dates = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array();
$md = end($event_more_dates);
$more_date = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
$newformat = empty($event_more_dates) ? $newformat : date('Y-m-d H:i:s', strtotime($more_date));
}
// $default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC';
// date_default_timezone_set($default_timezone_val);
$datetime1 = new DateTime($newformat);
$datetime2 = new DateTime($current);
$interval = date_diff($datetime2, $datetime1);
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$leftt = apply_filters('mep_event_total_seat_count', $total_left, get_the_id());
$days = $interval->d;
$hours = $interval->h;
$minutes = $interval->i;
$dd = $days > 0 ? $days . " days " : '';
$hh = $hours > 0 ? $hours . " hours " : '';
$mm = $minutes > 0 ? $minutes . " minutes " : '';
$qty_typec = $event_meta['qty_box_type'][0];
$cart_product_id = get_post_meta($post_id, 'link_wc_product', true) ? esc_attr(get_post_meta($post_id, 'link_wc_product', true)) : esc_attr($post_id);
/**
* First Checking If the registration status enable or disable
*/
if ($reg_status != 'off') {
/**
* Then Checking If the event date already gone or not
*/
if (strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)) {
/**
* If The event expired then it fire below Hook, The event expire texts arein the inc/template-parts/event_labels.php file
*/
do_action('mep_event_expire_text');
/**
* If the event is not expired then Its checking the available seat status
*/
} elseif ($seat_left <= 0) {
/**
* If All the seats are booked then it fire the below hooks, The event no seat texts are in the inc/template-parts/event_labels.php file
*/
do_action('mep_event_no_seat_text');
do_action('mep_after_no_seat_notice');
} else {
/**
* If everything is fine then its go on ....
*/
?>
<!-- Register Now Title -->
<h4 class="mep-cart-table-title">
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec') ? mep_get_option('mep_register_now_text', 'label_setting_sec') : _e('Register Now:', 'mage-eventpress'); ?>
</h4>
<!--The event add to cart main form start here-->
<form action="" method='post' id="mage_event_submit">
<?php
/**
* Here is a magic hook which fire just before of the Add to Cart Button, And the Ticket type & Extra service list are hooked up into this, You can find them into inc/template-parts/event_ticket_type_extra_service.php
*/
do_action('mep_event_ticket_types_list');
do_action('mep_event_extra_service_list');
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id, "_price", true); ?>" />
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
<td align="left" class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec') ? mep_get_option('mep_quantity_text', 'label_setting_sec') : _e('Quantity:', 'mage-eventpress');
if ($mep_event_ticket_type) { ?>
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box" step="1" min="1" max="<?php echo $leftt; ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
<span id="ttyttl"></span>
<?php } ?>
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec') ? mep_get_option('mep_total_text', 'label_setting_sec') : _e('Total', 'mage-eventpress'); ?>
<span id="usertotal"></span>
</span>
</td>
<td align="right">
<input type="hidden" name="mep_event_location_cart" value="<?php trim(mep_ev_location_ticket($post_id, $event_meta)); ?>">
<input type="hidden" name="mep_event_date_cart" value="<?php do_action('mep_event_date'); ?>">
<button type="submit" name="add-to-cart" value="<?php echo $cart_product_id; ?>" class="single_add_to_cart_button button alt btn-mep-event-cart"><?php _e(mep_get_label($post_id, 'mep_cart_btn_text', 'Register This Event'), 'mage-eventpress'); ?> </button>
</td>
</tr>
</table>
<!--The Add to cart button table start Here-->
</form>
<!--The event add to cart main form end here-->
<?php
}
} // End Of checking Registration status
}
}

View File

@ -1,258 +1,276 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_date', 'mep_ev_datetime');
// This Function Will be depricate soon, Please don't use this any where
function mep_ev_datetime(){
global $event_meta;
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$more_date = array_key_exists('mep_event_more_date', $event_meta) ? unserialize($event_meta['mep_event_more_date'][0]) : array();
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
$cn = 1;
if (!function_exists('mep_ev_datetime')) {
// This Function Will be depricate soon, Please don't use this any where
function mep_ev_datetime()
{
global $event_meta;
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$more_date = array_key_exists('mep_event_more_date', $event_meta) ? unserialize($event_meta['mep_event_more_date'][0]) : array();
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
$cn = 1;
if ($recurring == 'yes') {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($start_datetime)) {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>,
<?php
}
foreach ($more_date as $_more_date) {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'])) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<p><?php echo get_mep_datetime($_more_date['event_more_start_date'], 'date-text') . ' ' . get_mep_datetime($_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_time'], 'time'); ?></p>
<?php
$cn++;
}
}
}
} elseif (is_array($more_date) && sizeof($more_date) > 0) {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>
<?php foreach ($more_date as $_more_date) {
?>
<p><?php echo get_mep_datetime($_more_date['event_more_start_date'], 'date-text') . ' ' . get_mep_datetime($_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_time'], 'time'); ?></p>
<?php
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>
<?php
}
}
add_action('mep_event_date_default_theme', 'mep_date_in_default_theme');
function mep_date_in_default_theme($event_id){
$event_meta = get_post_custom($event_id);
$start_datetime = $event_meta['event_start_datetime'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_datetime'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta($event_id, 'mep_show_upcoming_event', true) ? get_post_meta($event_id, 'mep_show_upcoming_event', true) : 'no';
$cn = 1;
$more_date = array_key_exists('mep_event_more_date', $event_meta) ? unserialize($event_meta['mep_event_more_date'][0]) : array();
?>
<h3><i class="fa fa-calendar"></i> <?php echo mep_get_option('mep_event_schedule_text', 'label_setting_sec',__('Event Schedule Details','mage-eventpress')); ?></h3>
<?php
if(sizeof($more_date) > 2){ echo '<ul id="mep_event_date_sch">'; }else{ echo '<ul>'; }
if ($recurring == 'yes') {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($start_datetime)) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></li>
<?php
}
foreach ($more_date as $_more_date) {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'])) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'time'); ?></li>
<?php
$cn++;
}
}
}
} else {
if (is_array($more_date) && sizeof($more_date) > 0) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?><br>
<i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> <?php if($start_date != $end_date) {
echo ' - '.get_mep_datetime($end_datetime, 'date-text');
}
echo ' - '.get_mep_datetime($end_datetime, 'time'); ?></li>
<?php
foreach ($more_date as $_more_date) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'time'); ?></li>
if ($recurring == 'yes') {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($start_datetime)) {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>,
<?php
}
foreach ($more_date as $_more_date) {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'])) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
} else {
if ($cn == $cnt) {
?>
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
<p><?php echo get_mep_datetime($_more_date['event_more_start_date'], 'date-text') . ' ' . get_mep_datetime($_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_time'], 'time'); ?></p>
<?php
$cn++;
}
}
echo get_mep_datetime($end_datetime, 'time'); ?></li>
}
} elseif (is_array($more_date) && sizeof($more_date) > 0) {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>
<?php foreach ($more_date as $_more_date) {
?>
<p><?php echo get_mep_datetime($_more_date['event_more_start_date'], 'date-text') . ' ' . get_mep_datetime($_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_time'], 'time'); ?></p>
<?php
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text') . ' ' . get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></p>
<?php
}
}
}
add_action('mep_event_date_default_theme', 'mep_date_in_default_theme');
if (!function_exists('mep_date_in_default_theme')) {
function mep_date_in_default_theme($event_id)
{
$event_meta = get_post_custom($event_id);
$start_datetime = $event_meta['event_start_datetime'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_datetime'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta($event_id, 'mep_show_upcoming_event', true) ? get_post_meta($event_id, 'mep_show_upcoming_event', true) : 'no';
$cn = 1;
$more_date = array_key_exists('mep_event_more_date', $event_meta) ? unserialize($event_meta['mep_event_more_date'][0]) : array();
?>
<h3><i class="fa fa-calendar"></i> <?php echo mep_get_option('mep_event_schedule_text', 'label_setting_sec', __('Event Schedule Details', 'mage-eventpress')); ?></h3>
<?php
if (sizeof($more_date) > 2) {
echo '<ul id="mep_event_date_sch">';
} else {
echo '<ul>';
}
if ($recurring == 'yes') {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($start_datetime)) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></li>
<?php
}
foreach ($more_date as $_more_date) {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'])) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'time'); ?></li>
<?php
$cn++;
}
}
}
} else {
if (is_array($more_date) && sizeof($more_date) > 0) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?><br>
<i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> <?php if ($start_date != $end_date) {
echo ' - ' . get_mep_datetime($end_datetime, 'date-text');
}
echo ' - ' . get_mep_datetime($end_datetime, 'time'); ?></li>
<?php
foreach ($more_date as $_more_date) {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($_more_date['event_more_start_date'] . ' ' . $_more_date['event_more_start_time'], 'time'); ?> - <?php if ($_more_date['event_more_start_date'] != $_more_date['event_more_end_date']) {
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'date-text') . ' - ';
}
echo get_mep_datetime($_more_date['event_more_end_date'] . ' ' . $_more_date['event_more_end_time'], 'time'); ?></li>
<?php
}
} else {
?>
<li><i class="fa fa-calendar"></i> <?php echo get_mep_datetime($start_datetime, 'date-text'); ?> <br><i class="fa fa-clock-o"></i> <?php echo get_mep_datetime($start_datetime, 'time'); ?> - <?php if ($start_date != $end_date) {
echo get_mep_datetime($end_datetime, 'date-text') . ' - ';
}
echo get_mep_datetime($end_datetime, 'time'); ?></li>
<?php
}
}
echo '</ul>';
if (sizeof($more_date) > 2) {
?>
<p id="mep_single_view_all_date" class="mep-tem3-title-sec mep_single_date_btn"><?php _e('View All Date', 'mage-eventpress'); ?></p>
<p id="mep_single_hide_all_date" class="mep-tem3-title-sec mep_single_date_btn"><?php _e('Hide All Date', 'mage-eventpress'); ?></p>
<?php
}
}
echo '</ul>';
if(sizeof($more_date) > 2){
?>
<p id="mep_single_view_all_date" class="mep-tem3-title-sec mep_single_date_btn"><?php _e('View All Date','mage-eventpress'); ?></p>
<p id="mep_single_hide_all_date" class="mep-tem3-title-sec mep_single_date_btn"><?php _e('Hide All Date','mage-eventpress'); ?></p>
<?php
}
}
add_action('mep_event_date_only', 'mep_ev_date');
function mep_ev_date()
{
global $event_meta;
$start_datetime = $event_meta['event_start_datetime'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
if (!function_exists('mep_ev_date')) {
function mep_ev_date()
{
global $event_meta;
$start_datetime = $event_meta['event_start_datetime'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_datetime'][0];
$end_datetime = $event_meta['event_end_datetime'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
if ($recurring == 'yes') {
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
foreach ($event_more_dates as $md) {
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
}
if ($recurring == 'yes') {
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
foreach ($event_more_dates as $md) {
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
}
foreach ($more_date as $ev_date) {
if (strtotime(current_time('Y-m-d H:i:s')) < strtotime($ev_date)) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<p><?php echo get_mep_datetime($ev_date, 'date-text'); ?></p>
<?php
$cn++;
foreach ($more_date as $ev_date) {
if (strtotime(current_time('Y-m-d H:i:s')) < strtotime($ev_date)) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<p><?php echo get_mep_datetime($ev_date, 'date-text'); ?></p>
<?php
$cn++;
}
}
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text'); ?></p>
<?php
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'date-text'); ?></p>
<?php
}
}
add_action('mep_event_time_only', 'mep_ev_time');
function mep_ev_time()
{
global $event_meta;
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
if (!function_exists('mep_ev_time')) {
function mep_ev_time()
{
global $event_meta;
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
if ($recurring == 'yes') {
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
foreach ($event_more_dates as $md) {
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
}
if ($recurring == 'yes') {
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
foreach ($event_more_dates as $md) {
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
}
foreach ($more_date as $ev_date) {
if (strtotime(current_time('Y-m-d H:i:s')) < strtotime($ev_date)) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<p><?php echo get_mep_datetime($ev_date, 'time'); ?> </p>
<?php
$cn++;
foreach ($more_date as $ev_date) {
if (strtotime(current_time('Y-m-d H:i:s')) < strtotime($ev_date)) {
if ($mep_show_upcoming_event == 'yes') {
$cnt = 1;
} else {
$cnt = $cn;
}
if ($cn == $cnt) {
?>
<p><?php echo get_mep_datetime($ev_date, 'time'); ?> </p>
<?php
$cn++;
}
}
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'time'); ?></p>
<?php
}
} else {
?>
<p><?php echo get_mep_datetime($start_datetime, 'time'); ?></p>
<?php
}
}
function mep_ev_time_ticket($event_meta){
$start_datetime = $event_meta['event_start_datetime'][0];
echo get_mep_datetime($start_datetime, 'time');
if (!function_exists('mep_ev_time_ticket')) {
function mep_ev_time_ticket($event_meta)
{
$start_datetime = $event_meta['event_start_datetime'][0];
echo get_mep_datetime($start_datetime, 'time');
}
}
function mep_ev_date_ticket($event_meta){
$start_datetime = $event_meta['event_start_datetime'][0];
echo get_mep_datetime($start_datetime, 'date-text');
}
if (!function_exists('mep_ev_date_ticket')) {
function mep_ev_date_ticket($event_meta)
{
$start_datetime = $event_meta['event_start_datetime'][0];
echo get_mep_datetime($start_datetime, 'date-text');
}
}

View File

@ -1,34 +1,43 @@
<?php
add_action('mep_event_details','mep_ev_details');
function mep_ev_details(){
global $post, $event_meta;
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_details', 'mep_ev_details');
if (!function_exists('mep_ev_details')) {
function mep_ev_details()
{
global $post, $event_meta;
$content_event = get_post($post->ID);
$content = $content_event->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
echo apply_filters( 'mep_event_details_content', $content, get_the_id() );
echo apply_filters('mep_event_details_content', $content, get_the_id());
do_action('mep_after_event_details');
}
}
add_action('mep_after_event_details','mep_display_event_daywise_details');
function mep_display_event_daywise_details(){
global $post, $event_meta;
add_action('mep_after_event_details', 'mep_display_event_daywise_details');
if (!function_exists('mep_display_event_daywise_details')) {
function mep_display_event_daywise_details()
{
global $post, $event_meta;
$mep_event_day = get_post_meta($post->ID, 'mep_event_day', true) ? get_post_meta($post->ID, 'mep_event_day', true) : array();
if ( sizeof($mep_event_day) > 0 ){
echo '<div class="mep-day-details-section">';
if (sizeof($mep_event_day) > 0) {
echo '<div class="mep-day-details-section">';
?>
<h4><?php _e('Event Days','mage-eventpress'); ?></h4>
<?php
foreach ( $mep_event_day as $field ) {
?>
<div class="mep-day-title"><?php echo $field['mep_day_title']; ?></div>
<div class="mep-day-details">
<p><?php echo $field['mep_day_content']; ?></p>
</div>
<?php
<h4><?php _e('Event Days', 'mage-eventpress'); ?></h4>
<?php
foreach ($mep_event_day as $field) {
?>
<div class="mep-day-title"><?php echo $field['mep_day_title']; ?></div>
<div class="mep-day-details">
<p><?php echo $field['mep_day_content']; ?></p>
</div>
<?php
}
echo '</div>';
echo '</div>';
}
}
}

View File

@ -1,74 +1,80 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_extra_service', 'mep_ev_extra_serv');
function mep_ev_extra_serv($post_id){
global $post, $product;
$post_id = $post_id;
$count = 1;
$mep_events_extra_prices = get_post_meta($post_id, 'mep_events_extra_prices', true) ? get_post_meta($post_id, 'mep_events_extra_prices', true) : array();
ob_start();
if (sizeof($mep_events_extra_prices) > 0) {
echo "<h3 class='ex-sec-title'>" . mep_get_label($post_id, 'mep_event_extra_service_text', 'Extra Service:') . "</h3>";
?>
<table>
<tr>
<td align="left"><?php echo mep_get_option('mep_name_text', 'label_setting_sec',__('Name:','mage-eventpress')); ?></td>
<td class="mage_text_center"><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec',__('Quantity:','mage-eventpress')); ?></td>
<td class="mage_text_center"><?php echo mep_get_option('mep_price_text', 'label_setting_sec',__('Price:','mage-eventpress')); ?></td>
</tr>
<?php
foreach ($mep_events_extra_prices as $field) {
$event_date = get_post_meta($post_id, 'event_start_date', true).' '.get_post_meta($post_id, 'event_start_time', true);
$total_extra_service = (int)$field['option_qty'];
$qty_type = $field['option_qty_type'];
$total_sold = (int) mep_extra_service_sold($post_id,$field['option_name'],$event_date);
$ext_left = ($total_extra_service - $total_sold);
?>
if (!function_exists('mep_ev_extra_serv')) {
function mep_ev_extra_serv($post_id)
{
global $post, $product;
$post_id = $post_id;
$count = 1;
$mep_events_extra_prices = get_post_meta($post_id, 'mep_events_extra_prices', true) ? get_post_meta($post_id, 'mep_events_extra_prices', true) : array();
ob_start();
if (sizeof($mep_events_extra_prices) > 0) {
echo "<h3 class='ex-sec-title'>" . mep_get_label($post_id, 'mep_event_extra_service_text', 'Extra Service:') . "</h3>";
?>
<table>
<tr>
<td align="Left"><?php echo $field['option_name']; ?>
<div class="xtra-item-left"><?php echo $ext_left; ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:','mage-eventpress'); ?>
</div>
<input type="hidden" name='mep_event_start_date_es[]' value='<?php echo $event_date; ?>'>
</td>
<td class="mage_text_center">
<?php
<td align="left"><?php echo mep_get_option('mep_name_text', 'label_setting_sec', __('Name:', 'mage-eventpress')); ?></td>
<td class="mage_text_center"><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec', __('Quantity:', 'mage-eventpress')); ?></td>
<td class="mage_text_center"><?php echo mep_get_option('mep_price_text', 'label_setting_sec', __('Price:', 'mage-eventpress')); ?></td>
</tr>
<?php
foreach ($mep_events_extra_prices as $field) {
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$total_extra_service = (int) $field['option_qty'];
$qty_type = $field['option_qty_type'];
$total_sold = (int) mep_extra_service_sold($post_id, $field['option_name'], $event_date);
$ext_left = ($total_extra_service - $total_sold);
?>
<tr>
<td align="Left"><?php echo $field['option_name']; ?>
<div class="xtra-item-left"><?php echo $ext_left; ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:', 'mage-eventpress'); ?>
</div>
<input type="hidden" name='mep_event_start_date_es[]' value='<?php echo $event_date; ?>'>
</td>
<td class="mage_text_center">
<?php
if ($ext_left > 0) {
if ($qty_type == 'dropdown') { ?>
<select name="event_extra_service_qty[]" id="eventpxtp_<?php //echo $count;
?>" class='extra-qty-box'>
<?php for ($i = 0; $i <= $ext_left; $i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?> <?php echo $field['option_name']; ?></option>
<?php } ?>
</select>
<?php } else { ?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<input id="eventpx" <?php //if($ext_left<=0){ echo "disabled"; }
?> size="4" inputmode="numeric" type="text" class='extra-qty-box' name='event_extra_service_qty[]' data-price='<?php echo $field['option_price']; ?>' value='0' min="0" max="<?php echo $ext_left; ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php }
} else {
echo mep_get_option('mep_not_available_text', 'label_setting_sec') ? mep_get_option('mep_not_available_text', 'label_setting_sec') : _e('Not Available', 'mage-eventpress');
} ?>
</td>
<td class="mage_text_center"><?php echo wc_price($field['option_price']);
if ($ext_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $field['option_price']; ?></p>
<input type="hidden" name='event_extra_service_name[]' value='<?php echo $field['option_name']; ?>'>
<input type="hidden" name='event_extra_service_price[]' value='<?php echo $field['option_price']; ?>'>
<?php } ?>
</td>
</tr>
?>" class='extra-qty-box'>
<?php for ($i = 0; $i <= $ext_left; $i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?> <?php echo $field['option_name']; ?></option>
<?php } ?>
</select>
<?php } else { ?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<input id="eventpx" <?php //if($ext_left<=0){ echo "disabled"; }
?> size="4" inputmode="numeric" type="text" class='extra-qty-box' name='event_extra_service_qty[]' data-price='<?php echo $field['option_price']; ?>' value='0' min="0" max="<?php echo $ext_left; ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php }
} else {
echo mep_get_option('mep_not_available_text', 'label_setting_sec') ? mep_get_option('mep_not_available_text', 'label_setting_sec') : _e('Not Available', 'mage-eventpress');
} ?>
</td>
<td class="mage_text_center"><?php echo wc_price($field['option_price']);
if ($ext_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $field['option_price']; ?></p>
<input type="hidden" name='event_extra_service_name[]' value='<?php echo $field['option_name']; ?>'>
<input type="hidden" name='event_extra_service_price[]' value='<?php echo $field['option_price']; ?>'>
<?php } ?>
</td>
</tr>
<?php
$count++;
}
?>
</table>
<?php
$count++;
}
?>
</table>
<?php
}
$content = ob_get_clean();
$event_meta = get_post_custom($post_id);
echo apply_filters('mage_event_extra_service_list', $content, $post_id, $event_meta);
}
$content = ob_get_clean();
$event_meta = get_post_custom($post_id);
echo apply_filters('mage_event_extra_service_list', $content,$post_id,$event_meta);
}
}

View File

@ -1,24 +1,32 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_expire_text','mep_event_display_expire_text');
function mep_event_display_expire_text(){
add_action('mep_event_expire_text', 'mep_event_display_expire_text');
if (!function_exists('mep_event_display_expire_text')) {
function mep_event_display_expire_text()
{
ob_start();
?>
?>
<span class=event-expire-btn>
<?php echo mep_get_option('mep_event_expired_text', 'label_setting_sec') ? mep_get_option('mep_event_expired_text', 'label_setting_sec') : _e('Sorry, Event Expired','mage-eventpress'); ?>
<?php echo mep_get_option('mep_event_expired_text', 'label_setting_sec') ? mep_get_option('mep_event_expired_text', 'label_setting_sec') : _e('Sorry, Event Expired', 'mage-eventpress'); ?>
</span>
<?php
<?php
echo ob_get_clean();
}
}
add_action('mep_event_no_seat_text','mep_event_display_no_seat_text');
function mep_event_display_no_seat_text(){
add_action('mep_event_no_seat_text', 'mep_event_display_no_seat_text');
if (!function_exists('mep_event_display_no_seat_text')) {
function mep_event_display_no_seat_text()
{
ob_start();
?>
<span class=event-expire-btn>
<?php echo mep_get_option('mep_no_seat_available_text', 'label_setting_sec') ? mep_get_option('mep_no_seat_available_text', 'label_setting_sec') : _e('No Seat Availables','mage-eventpress'); ?>
</span>
<?php
?>
<span class=event-expire-btn>
<?php echo mep_get_option('mep_no_seat_available_text', 'label_setting_sec') ? mep_get_option('mep_no_seat_available_text', 'label_setting_sec') : _e('No Seat Availables', 'mage-eventpress'); ?>
</span>
<?php
echo ob_get_clean();
}
}
}

View File

@ -1,50 +1,53 @@
<?php
add_action('mep_event_list_cat_names','mep_display_event_cat_name_in_list');
function mep_display_event_cat_name_in_list(){
ob_start();
?>
<div class="mep-events-cats-list">
<?php
$terms = get_terms(array(
'taxonomy' => 'mep_cat'
));
?>
<div class="mep-event-cat-controls">
<button type="button" class="mep-cat-control" data-filter="all"><?php _e('All', 'mage-eventpress'); ?></button><?php
foreach ($terms as $_terms) {
?>
<button type="button" class="mep-cat-control" data-filter=".<?php echo 'mage-' . $_terms->slug; ?>"><?php echo $_terms->name; ?></button><?php
}
?>
</div>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_category_name_filter_list', $content);
}
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_list_org_names','mep_display_event_org_name_in_list');
function mep_display_event_org_name_in_list(){
ob_start();
?>
<div class="mep-events-cats-list">
<?php
$terms = get_terms(
array(
'taxonomy' => 'mep_org'
)
);
?>
<div class="mep-event-cat-controls">
<button type="button" class="mep-cat-control" data-filter="all"><?php _e('All', 'mage-eventpress'); ?></button><?php
foreach ($terms as $_terms) {
?>
<button type="button" class="mep-cat-control" data-filter=".<?php echo 'mage-' . $_terms->slug; ?>"><?php echo $_terms->name; ?></button><?php
}
?>
</div>
</div>
add_action('mep_event_list_cat_names', 'mep_display_event_cat_name_in_list');
if (!function_exists('mep_display_event_cat_name_in_list')) {
function mep_display_event_cat_name_in_list()
{
ob_start();
?>
<div class="mep-events-cats-list">
<?php
$terms = get_terms(array(
'taxonomy' => 'mep_cat'
));
?>
<div class="mep-event-cat-controls">
<button type="button" class="mep-cat-control" data-filter="all"><?php _e('All', 'mage-eventpress'); ?></button>
<?php foreach ($terms as $_terms) { ?>
<button type="button" class="mep-cat-control" data-filter=".<?php echo 'mage-' . $_terms->slug; ?>"><?php echo $_terms->name; ?></button>
<?php } ?>
</div>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_organization_name_filter_list', $content);
$content = ob_get_clean();
echo apply_filters('mage_event_category_name_filter_list', $content);
}
}
add_action('mep_event_list_org_names', 'mep_display_event_org_name_in_list');
if (!function_exists('mep_display_event_org_name_in_list')) {
function mep_display_event_org_name_in_list()
{
ob_start();
?>
<div class="mep-events-cats-list">
<?php
$terms = get_terms(
array(
'taxonomy' => 'mep_org'
)
);
?>
<div class="mep-event-cat-controls">
<button type="button" class="mep-cat-control" data-filter="all"><?php _e('All', 'mage-eventpress'); ?></button><?php foreach ($terms as $_terms) { ?>
<button type="button" class="mep-cat-control" data-filter=".<?php echo 'mage-' . $_terms->slug; ?>"><?php echo $_terms->name; ?></button><?php } ?>
</div>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_organization_name_filter_list', $content);
}
}

View File

@ -1,8 +1,12 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_location','mep_ev_location');
add_action('mep_event_location_ticket','mep_ev_location_ticket');
if (!function_exists('mep_ev_location_cart')) {
function mep_ev_location_cart($event_id,$event_meta){
$location_sts = get_post_meta($event_id,'mep_org_address',true) ? get_post_meta($event_id,'mep_org_address',true) : '';
ob_start();
@ -29,10 +33,10 @@ if($location_sts){
$content = ob_get_clean();
echo apply_filters('mage_event_location_in_cart', $content,$event_id,$event_meta);
}
}
if (!function_exists('mep_ev_location_ticket')) {
function mep_ev_location_ticket($event_id,$event_meta){
$location_sts = get_post_meta($event_id,'mep_org_address',true) ? get_post_meta($event_id,'mep_org_address',true) : '';
ob_start();
@ -63,8 +67,9 @@ $org_id = $org_arr[0]->term_id;
$content = ob_get_clean();
echo apply_filters('mage_event_location_in_ticket', $content,$event_id,$event_meta);
}
}
if (!function_exists('mep_ev_location')) {
function mep_ev_location(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true) ? get_post_meta($post->ID,'mep_org_address',true) : '';
@ -97,29 +102,35 @@ $org_id = $org_arr[0]->term_id;
$content = ob_get_clean();
echo apply_filters('mage_event_location_content', $content,$post->ID,$event_meta);
}
}
add_action('mep_event_location_venue','mep_ev_venue');
function mep_ev_venue(){
if (!function_exists('mep_ev_venue')) {
function mep_ev_venue($event_id=''){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($event_id){
$event = $event_id;
}else{
$event = $post->ID;
}
$location_sts = get_post_meta($event,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_arr = get_the_terms( $event, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_location', true )."</span>";
}else{
?>
<span><?php echo $event_meta['mep_location_venue'][0]; ?></span>
<span><?php echo get_post_meta($event,'mep_location_venue',true); ?></span>
<?php
}
}
}
/**
* Event Location Get Functions
*/
if (!function_exists('mep_get_event_location')) {
function mep_get_event_location($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -130,7 +141,9 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_location_venue',true);
}
}
}
if (!function_exists('mep_get_event_location_street')) {
function mep_get_event_location_street($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -141,8 +154,9 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_street',true);
}
}
}
if (!function_exists('mep_get_event_location_city')) {
function mep_get_event_location_city($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -153,8 +167,9 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_city',true);
}
}
}
if (!function_exists('mep_get_event_location_state')) {
function mep_get_event_location_state($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -165,8 +180,13 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_state',true);
}
}
}
function mep_get_location_name_for_list($event_id){
}
if (!function_exists('mep_get_event_location_postcode')) {
function mep_get_event_location_postcode($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -177,8 +197,9 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_postcode',true);
}
}
}
if (!function_exists('mep_get_event_location_country')) {
function mep_get_event_location_country($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
@ -189,7 +210,7 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
return get_post_meta($event_id,'mep_country',true);
}
}
}
@ -197,6 +218,7 @@ $location_sts = get_post_meta($event_id,'mep_org_address',true);
add_action('mep_event_location_street','mep_ev_street');
if (!function_exists('mep_ev_street')) {
function mep_ev_street(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
@ -210,9 +232,11 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
}
add_action('mep_event_location_city','mep_ev_city');
if (!function_exists('mep_ev_city')) {
function mep_ev_city(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
@ -226,9 +250,12 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
}
add_action('mep_event_location_state','mep_ev_state');
if (!function_exists('mep_ev_state')) {
function mep_ev_state(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
@ -242,9 +269,12 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
}
add_action('mep_event_location_postcode','mep_ev_postcode');
if (!function_exists('mep_ev_postcode')) {
function mep_ev_postcode(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
@ -258,9 +288,11 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
}
add_action('mep_event_location_country','mep_ev_country');
if (!function_exists('mep_ev_country')) {
function mep_ev_country(){
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
@ -274,8 +306,10 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
}
add_action('mep_event_address_list_sidebar','mep_event_address_list_sidebar_html');
if (!function_exists('mep_event_address_list_sidebar_html')) {
function mep_event_address_list_sidebar_html($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
$org_arr = get_the_terms( $event_id, 'mep_org' ) ? get_the_terms( $event_id, 'mep_org' ) : '';
@ -303,4 +337,5 @@ function mep_event_address_list_sidebar_html($event_id){
</ul>
<?php
echo ob_get_clean();
}
}

View File

@ -1,122 +1,137 @@
<?php
add_action('mep_event_list_shortcode','mep_display_event_loop_list',10,3);
function mep_display_event_loop_list($event_id,$columnNumber,$style){
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$newformat = date_i18n('Y-m-d H:i:s', $time);
$tt = get_the_terms($event_id, 'mep_cat');
$torg = get_the_terms($event_id, 'mep_org');
$org_class = mep_get_term_as_class($event_id, 'mep_org');
$cat_class = mep_get_term_as_class($event_id, 'mep_cat');
$event_multidate = array_key_exists('mep_event_more_date', $event_meta) ? maybe_unserialize($event_meta['mep_event_more_date'][0]) : array();
$available_seat = mep_get_total_available_seat($event_id, $event_meta);
$hide_org_list = mep_get_option('mep_event_hide_organizer_list', 'general_setting_sec', 'no');
$hide_location_list = mep_get_option('mep_event_hide_location_list', 'general_setting_sec', 'no');
$hide_time_list = mep_get_option('mep_event_hide_time_list', 'general_setting_sec', 'no');
$hide_only_end_time_list = mep_get_option('mep_event_hide_end_time_list', 'general_setting_sec', 'no');
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$event_type = get_post_meta(get_the_id(),'mep_event_type',true) ? get_post_meta(get_the_id(),'mep_event_type',true) : 'offline';
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
ob_start();
?>
<div class='mep-event-list-loop <?php echo $columnNumber; ?> mep_event_<?php echo $style; ?>_item mix <?php if ($tt) { echo $org_class; } ?> <?php if ($torg) { echo $cat_class; } ?>'>
<?php do_action('mep_event_list_loop_header',$event_id); ?>
<div class="mep_list_thumb">
<a href="<?php echo get_the_permalink($event_id); ?>"><?php echo get_the_post_thumbnail($event_id,'full'); ?></a>
<?php if(sizeof($event_multidate) == 0){ ?>
<div class="mep-ev-start-date">
<div class="mep-day"><?php echo get_mep_datetime($event_meta['event_start_datetime'][0],'day'); ?></div>
<div class="mep-month"><?php echo get_mep_datetime($event_meta['event_start_datetime'][0],'month'); ?></div>
</div>
<?php } if(is_array($event_multidate) && sizeof($event_multidate) >0){ ?>
<div class='mep-multidate-ribbon mep-tem3-title-sec'>
<span><?php _e('Multi Date Event','mage-eventpress'); ?></span>
</div>
<?php } if($event_type == 'online'){ ?>
<div class='mep-eventtype-ribbon mep-tem3-title-sec'>
<span><?php echo mep_get_option('mep_event_virtual_label', 'label_setting_sec') ? mep_get_option('mep_event_virtual_label', 'label_setting_sec') : _e('Virtual Event','mage-eventpress'); ?></span>
</div>
<?php } ?>
add_action('mep_event_list_shortcode', 'mep_display_event_loop_list', 10, 3);
if (!function_exists('mep_display_event_loop_list')) {
function mep_display_event_loop_list($event_id, $columnNumber, $style)
{
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org') ? get_the_terms($event_id, 'mep_org') : [];
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$newformat = date_i18n('Y-m-d H:i:s', $time);
$tt = get_the_terms($event_id, 'mep_cat');
$torg = get_the_terms($event_id, 'mep_org');
$org_class = mep_get_term_as_class($event_id, 'mep_org');
$cat_class = mep_get_term_as_class($event_id, 'mep_cat');
$event_multidate = array_key_exists('mep_event_more_date', $event_meta) ? maybe_unserialize($event_meta['mep_event_more_date'][0]) : array();
$available_seat = mep_get_total_available_seat($event_id, $event_meta);
$hide_org_list = mep_get_option('mep_event_hide_organizer_list', 'general_setting_sec', 'no');
$hide_location_list = mep_get_option('mep_event_hide_location_list', 'general_setting_sec', 'no');
$hide_time_list = mep_get_option('mep_event_hide_time_list', 'general_setting_sec', 'no');
$hide_only_end_time_list = mep_get_option('mep_event_hide_end_time_list', 'general_setting_sec', 'no');
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$event_type = get_post_meta(get_the_id(), 'mep_event_type', true) ? get_post_meta(get_the_id(), 'mep_event_type', true) : 'offline';
ob_start();
?>
<div class='mep-event-list-loop <?php echo $columnNumber; ?> mep_event_<?php echo $style; ?>_item mix <?php if ($tt) { echo $org_class; } ?> <?php if ($torg) { echo $cat_class; } ?>'>
<?php do_action('mep_event_list_loop_header', $event_id); ?>
<div class="mep_list_thumb">
<a href="<?php echo get_the_permalink($event_id); ?>"><?php echo get_the_post_thumbnail($event_id, 'full'); ?></a>
<?php if (sizeof($event_multidate) == 0) { ?>
<div class="mep-ev-start-date">
<div class="mep-day"><?php echo get_mep_datetime($event_meta['event_start_datetime'][0], 'day'); ?></div>
<div class="mep-month"><?php echo get_mep_datetime($event_meta['event_start_datetime'][0], 'month'); ?></div>
</div>
<div class="mep_list_event_details">
<a href="<?php the_permalink(); ?>">
<div class="mep-list-header">
<h2 class='mep_list_title'><?php the_title(); ?></h2>
<?php if ($available_seat == 0) {
do_action('mep_show_waitlist_label');
} ?>
<h3 class='mep_list_date'> <?php if ($show_price == 'yes') {
echo $show_price_label . " " . mep_event_list_price($event_id);
} ?></h3>
</div>
<?php }
if (is_array($event_multidate) && sizeof($event_multidate) > 0) { ?>
<div class='mep-multidate-ribbon mep-tem3-title-sec'>
<span><?php _e('Multi Date Event', 'mage-eventpress'); ?></span>
</div>
<?php }
if ($event_type == 'online') { ?>
<div class='mep-eventtype-ribbon mep-tem3-title-sec'>
<span><?php echo mep_get_option('mep_event_virtual_label', 'label_setting_sec') ? mep_get_option('mep_event_virtual_label', 'label_setting_sec') : _e('Virtual Event', 'mage-eventpress'); ?></span>
</div>
<?php } ?>
</div>
<div class="mep_list_event_details">
<a href="<?php the_permalink(); ?>">
<div class="mep-list-header">
<h2 class='mep_list_title'><?php the_title(); ?></h2>
<?php if ($available_seat == 0) {
do_action('mep_show_waitlist_label');
} ?>
<h3 class='mep_list_date'>
<?php if ($show_price == 'yes') {
echo $show_price_label . " " . mep_event_list_price($event_id);
} ?>
</h3>
</div>
<?php
if ($style == 'list') {
?>
<div class="mep-event-excerpt">
<?php the_excerpt(); ?>
</div>
<?php } ?>
<?php
if ($style == 'list') {
<div class="mep-list-footer">
<ul>
<?php
if ($hide_org_list == 'no') {
if(sizeof($author_terms) > 0) {
?>
<li>
<div class="evl-ico"><i class="fa fa-university"></i></div>
<div class="evl-cc">
<h5>
<?php echo mep_get_option('mep_organized_by_text', 'label_setting_sec') ? mep_get_option('mep_organized_by_text', 'label_setting_sec') : _e('Organized By:', 'mage-eventpress'); ?>
</h5>
<h6><?php
echo $author_terms[0]->name;
?></h6>
</div>
</li>
<?php } }
if ($event_type != 'online') {
if ($hide_location_list == 'no') { ?>
<li>
<div class="evl-ico"><i class="fa fa-location-arrow"></i></div>
<div class="evl-cc">
<h5>
<?php echo mep_get_option('mep_location_text', 'label_setting_sec') ? mep_get_option('mep_location_text', 'label_setting_sec') : _e('Location:', 'mage-eventpress'); ?>
</h5>
<h6><?php mep_get_event_city($event_id); ?></h6>
</div>
</li>
<?php }
}
if ($hide_time_list == 'no') {
if (strtotime(current_time('Y-m-d H:i')) < strtotime($event_meta['event_start_datetime'][0])) {
?>
<div class="mep-event-excerpt">
<?php the_excerpt(); ?>
</div>
<?php } ?>
<div class="mep-list-footer">
<ul>
<?php if ($hide_org_list == 'no') { ?>
<li>
<div class="evl-ico"><i class="fa fa-university"></i></div>
<div class="evl-cc">
<h5>
<?php echo mep_get_option('mep_organized_by_text', 'label_setting_sec') ? mep_get_option('mep_organized_by_text', 'label_setting_sec') : _e('Organized By:', 'mage-eventpress'); ?>
</h5>
<h6><?php if ($author_terms) {
echo $author_terms[0]->name;
} ?></h6>
</div>
</li>
<?php }
if($event_type != 'online'){
if ($hide_location_list == 'no') { ?>
<li>
<div class="evl-ico"><i class="fa fa-location-arrow"></i></div>
<div class="evl-cc">
<h5>
<?php echo mep_get_option('mep_location_text', 'label_setting_sec') ? mep_get_option('mep_location_text', 'label_setting_sec') : _e('Location:', 'mage-eventpress'); ?>
</h5>
<h6><?php mep_get_event_city($event_id); ?></h6>
</div>
</li>
<?php } }
if ($hide_time_list == 'no') { ?>
<li>
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
<div class="evl-cc">
<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>
<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 } ?>
</ul>
</a>
<?php do_action('mep_event_list_loop_footer',$event_id); ?>
</div>
</div>
<?php do_action('mep_event_list_loop_end',$event_id); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_loop_list_shortcode', $content, $event_id,$style);
}
<li>
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
<div class="evl-cc">
<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>
<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 } } ?>
</ul>
</a>
<?php do_action('mep_event_list_loop_footer', $event_id); ?>
</div>
</div>
<?php do_action('mep_event_list_loop_end', $event_id); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_loop_list_shortcode', $content, $event_id, $style);
}
}

View File

@ -1,10 +1,13 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This is the templates of the event minimal list shortcode
*/
add_filter('mage_event_loop_list_shortcode','mep_event_loop_minimal_style',10,3);
if (!function_exists('mep_event_loop_minimal_style')) {
function mep_event_loop_minimal_style($content, $event_id,$style){
if($style == 'minimal'){
@ -66,4 +69,5 @@ $content = ob_get_clean();
}else{
return $content;
}
}
}

View File

@ -1,9 +1,14 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This is the templates of the event native list shortcode
*/
add_filter('mage_event_loop_list_shortcode','mep_event_loop_native_style',10,3);
if (!function_exists('mep_event_loop_native_style')) {
function mep_event_loop_native_style($content, $event_id,$style){
if($style == 'native'){
@ -62,4 +67,5 @@ $content = ob_get_clean();
}else{
return $content;
}
}
}

View File

@ -1,9 +1,14 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This is the templates of the event timeline view shortcode
*/
add_filter('mage_event_loop_list_shortcode','mep_event_loop_timeline_style',10,3);
if (!function_exists('mep_event_loop_timeline_style')) {
function mep_event_loop_timeline_style($content, $event_id,$style){
if($style == 'timeline'){
@ -63,9 +68,10 @@ $content = ob_get_clean();
return $content;
}
}
}
add_action('mep_event_shortcode_js_script','mep_shortcode_timeline_js_script');
if (!function_exists('mep_shortcode_timeline_js_script')) {
function mep_shortcode_timeline_js_script($params){
$cat = $params['cat'];
$org = $params['org'];
@ -95,4 +101,5 @@ function mep_shortcode_timeline_js_script($params){
<?php
}
echo ob_get_clean();
}
}

View File

@ -1,9 +1,14 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This is the templates of the event timeline view shortcode
*/
add_filter('mage_event_loop_list_shortcode','mep_event_loop_title_style',10,3);
if (!function_exists('mep_event_loop_title_style')) {
function mep_event_loop_title_style($content, $event_id,$style){
if($style == 'title'){
@ -37,4 +42,5 @@ $content = ob_get_clean();
}else{
return $content;
}
}
}

View File

@ -1,10 +1,14 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
/**
* This Function will hooked up with the speaker action hook mep_event_speakers_list to display the Event Speaker List
*/
add_action('mep_event_speakers_list','mep_display_speaker_list');
if (!function_exists('mep_display_speaker_list')) {
function mep_display_speaker_list($event_id){
$speakers_id = get_post_meta($event_id,'mep_event_speakers_list',true) ? maybe_unserialize(get_post_meta($event_id,'mep_event_speakers_list',true)) : array();
$speaker_icon = get_post_meta($event_id,'mep_event_speaker_icon',true) ? get_post_meta($event_id,'mep_event_speaker_icon',true) : 'fa fa-microphone';
@ -25,4 +29,5 @@
}
echo '</ul>';
}
}
}
}

View File

@ -1,81 +1,90 @@
<?php
add_action('mep_event_ticket_types','mep_ev_ticket_type');
function mep_ev_ticket_type($post_id){
global $post, $product,$event_meta;
$count=1;
ob_start();
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
if($mep_event_ticket_type){
?>
<?php echo "<h3 class='ex-sec-title'>".mep_get_label($post_id,'mep_event_ticket_type_text','Ticket Type:')."</h3>"; ?>
<table>
<?php do_action('mep_event_ticket_type_loop_list',$post_id); ?>
</table>
add_action('mep_event_ticket_types', 'mep_ev_ticket_type');
if (!function_exists('mep_ev_ticket_type')) {
function mep_ev_ticket_type($post_id)
{
global $post, $product, $event_meta;
$count = 1;
ob_start();
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
if ($mep_event_ticket_type) {
?>
<?php echo "<h3 class='ex-sec-title'>" . mep_get_label($post_id, 'mep_event_ticket_type_text', 'Ticket Type:') . "</h3>"; ?>
<table>
<?php do_action('mep_event_ticket_type_loop_list', $post_id); ?>
</table>
<?php
}
}
$content = ob_get_clean();
echo apply_filters('mage_event_ticket_type_list', $content,$post_id,$event_meta);
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('.qty_dec').on('click', function () {
let target = $(this).siblings('input');
let value = parseInt(target.val()) - 1;
qtyPlace(target, value);
});
$('.qty_inc').on('click', function () {
let target = $(this).siblings('input');
let value = parseInt(target.val()) + 1;
qtyPlace(target, value);
});
$('.mage_input_group input').on('keyup', function () {
let target = $(this);
let value = parseInt(target.val());
if(target.val().length>0){
$content = ob_get_clean();
echo apply_filters('mage_event_ticket_type_list', $content, $post_id, $event_meta);
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.qty_dec').on('click', function() {
let target = $(this).siblings('input');
let value = parseInt(target.val()) - 1;
qtyPlace(target, value);
}
});
$('#mage_event_submit').on('submit', function () {
if(mageErrorQty()){
return true;
}
return false;
});
$("select[name='option_qty[]']").on('blur', function () {
mageErrorQty();
});
function qtyPlace(target, value) {
let minSeat = parseInt(target.attr('min'));
let maxSeat = parseInt(target.attr('max'));
if (value < minSeat || isNaN(value)) {
value = minSeat;
}
if (value > maxSeat) {
value = maxSeat
}
target.val(value).change();
mageErrorQty();
}
function mageErrorQty(){
let total_ticket = 0;
let target=$("[name='option_qty[]']");
target.each(function (index) {
total_ticket = total_ticket + parseInt($(this).val());
});
if(total_ticket>0){
target.removeClass('mage_error');
return true;
}
target.addClass('mage_error');
return false;
}
$('.qty_inc').on('click', function() {
let target = $(this).siblings('input');
let value = parseInt(target.val()) + 1;
qtyPlace(target, value);
});
$('.mage_input_group input').on('keyup', function() {
let target = $(this);
let value = parseInt(target.val());
if (target.val().length > 0) {
qtyPlace(target, value);
}
});
</script>
<?php
}
});
$('#mage_event_submit').on('submit', function() {
if (mageErrorQty()) {
return true;
}
return false;
});
$("select[name='option_qty[]']").on('blur', function() {
mageErrorQty();
});
function qtyPlace(target, value) {
let minSeat = parseInt(target.attr('min'));
let maxSeat = parseInt(target.attr('max'));
if (value < minSeat || isNaN(value)) {
value = minSeat;
}
if (value > maxSeat) {
value = maxSeat
}
target.val(value).change();
mageErrorQty();
}
function mageErrorQty() {
let total_ticket = 0;
let target = $("[name='option_qty[]']");
target.each(function(index) {
total_ticket = total_ticket + parseInt($(this).val());
});
if (total_ticket > 0) {
target.removeClass('mage_error');
return true;
}
target.addClass('mage_error');
return false;
}
});
</script>
<?php
}
}

View File

@ -1,23 +1,30 @@
<?php
function mep_output_add_to_cart_custom_fields($post_id)
{
global $post, $event_meta, $total_book;
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
$total_seat = mep_event_total_seat($post_id, 'total');
$total_resv = mep_event_total_seat($post_id, 'resv');
$total_sold = mep_ticket_sold($post_id);
$total_left = $total_seat - ($total_sold + $total_resv);
$total_left = apply_filters('mep_event_total_seat_count', $total_left, $post_id);
if ($total_left > 0) {
do_action('mep_event_ticket_types',$post_id);
do_action('mep_event_extra_service',$post_id);
} else {
add_action('mep_event_ticket_type_extra_service', 'mep_output_add_to_cart_custom_fields', 10);
if (!function_exists('mep_output_add_to_cart_custom_fields')) {
function mep_output_add_to_cart_custom_fields($post_id)
{
global $post, $event_meta, $total_book;
$total_seat = mep_event_total_seat($post_id, 'total');
$total_resv = mep_event_total_seat($post_id, 'resv');
$total_sold = mep_ticket_sold($post_id);
$total_left = $total_seat - ($total_sold + $total_resv);
$total_left = apply_filters('mep_event_total_seat_count', $total_left, $post_id);
if ($total_left > 0) {
do_action('mep_event_ticket_types', $post_id);
do_action('mep_event_extra_service', $post_id);
} else {
?>
<span class=event-expire-btn>
<?php echo mep_get_option('mep_no_seat_available_text', 'label_setting_sec') ? mep_get_option('mep_no_seat_available_text', 'label_setting_sec') : _e('No Seat Available', 'mage-eventpress'); ?>
</span>
<span class=event-expire-btn>
<?php echo mep_get_option('mep_no_seat_available_text', 'label_setting_sec') ? mep_get_option('mep_no_seat_available_text', 'label_setting_sec') : _e('No Seat Available', 'mage-eventpress'); ?>
</span>
<?php
do_action('mep_after_no_seat_notice');
do_action('mep_after_no_seat_notice');
}
}
}
add_action('mep_event_ticket_type_extra_service', 'mep_output_add_to_cart_custom_fields', 10);

View File

@ -1,96 +1,102 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_ticket_type_loop_list', 'mep_event_ticket_type_loop_list_html');
function mep_event_ticket_type_loop_list_html($post_id)
{
$mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
ob_start();
if (!function_exists('mep_event_ticket_type_loop_list_html')) {
function mep_event_ticket_type_loop_list_html($post_id)
{
$mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
ob_start();
?>
<?php
$count = 1;
foreach ($mep_event_ticket_type as $field) {
$qty_t_type = $field['option_qty_t_type'];
$total_quantity = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
$default_qty = isset($field['option_default_qty_t']) && $field['option_default_qty_t'] > 0 ? $field['option_default_qty_t'] : 0;
$total_resv_quantity = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$total_sold = (int) mep_ticket_type_sold($post_id, $field['option_name_t'], $event_date);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field);
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);
$total_left = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$ticket_price = apply_filters('mep_ticket_type_price', $field['option_price_t'], $field['option_name_t'], $post_id, $field);
$passed = apply_filters('mep_ticket_type_validation', true);
?>
<tr>
<td align="Left"><?php echo $field['option_name_t']; ?>
<input type="hidden" name='mep_event_start_date[]' value="<?php echo get_post_meta($post_id, 'event_start_datetime', true); ?>">
<?php if ($mep_available_seat == 'on') { ?><div class="xtra-item-left"><?php echo max($total_left, 0); ?>
<?php
$count = 1;
foreach ($mep_event_ticket_type as $field) {
$qty_t_type = $field['option_qty_t_type'];
$total_quantity = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
$default_qty = isset($field['option_default_qty_t']) && $field['option_default_qty_t'] > 0 ? $field['option_default_qty_t'] : 0;
$total_resv_quantity = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$total_sold = (int) mep_ticket_type_sold($post_id, $field['option_name_t'], $event_date);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field);
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);
$total_left = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$ticket_price = apply_filters('mep_ticket_type_price', $field['option_price_t'], $field['option_name_t'], $post_id, $field);
$passed = apply_filters('mep_ticket_type_validation', true);
?>
<tr>
<td align="Left"><?php echo $field['option_name_t']; ?>
<input type="hidden" name='mep_event_start_date[]' value="<?php echo get_post_meta($post_id, 'event_start_datetime', true); ?>">
<?php if ($mep_available_seat == 'on') { ?><div class="xtra-item-left"><?php echo max($total_left, 0); ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:', 'mage-eventpress'); ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:', 'mage-eventpress'); ?>
</div> <?php } ?>
</td>
<td class="ticket-qty">
<span class="tkt-qty">
<?php echo mep_get_option('mep_ticket_qty_text', 'label_setting_sec') ? mep_get_option('mep_ticket_qty_text', 'label_setting_sec') : _e('Ticket Qty:', 'mage-eventpress'); ?>
</span>
<?php
if ($total_left > 0) {
if ($qty_t_type == 'dropdown') { ?>
<select name="option_qty[]" id="eventpxtp_<?php echo $count; ?>" <?php if ($total_left <= 0) { ?> style='display: none!important;' <?php } ?> class='extra-qty-box etp'>
<?php
for ($i = $total_min_seat; $i <= $total_left; $i++) { ?>
<option value="<?php echo $i; ?>" <?php if ($i == $default_quantity) {
echo 'Selected';
} ?>><?php echo $i; ?>
<?php echo mep_get_option('mep_ticket_text', 'label_setting_sec') ? mep_get_option('mep_ticket_text', 'label_setting_sec') : _e('Ticket:', 'mage-eventpress'); ?>
</option>
<?php } ?>
</select>
<?php } else { ?>
</div> <?php } ?>
</td>
<td class="ticket-qty">
<span class="tkt-qty">
<?php echo mep_get_option('mep_ticket_qty_text', 'label_setting_sec') ? mep_get_option('mep_ticket_qty_text', 'label_setting_sec') : _e('Ticket Qty:', 'mage-eventpress'); ?>
</span>
<?php
if ($total_left > 0) {
if ($qty_t_type == 'dropdown') { ?>
<select name="option_qty[]" id="eventpxtp_<?php echo $count; ?>" <?php if ($total_left <= 0) { ?> style='display: none!important;' <?php } ?> class='extra-qty-box etp'>
<?php
for ($i = $total_min_seat; $i <= $total_left; $i++) { ?>
<option value="<?php echo $i; ?>" <?php if ($i == $default_quantity) {
echo 'Selected';
} ?>><?php echo $i; ?>
<?php echo mep_get_option('mep_ticket_text', 'label_setting_sec') ? mep_get_option('mep_ticket_text', 'label_setting_sec') : _e('Ticket:', 'mage-eventpress'); ?>
</option>
<?php } ?>
</select>
<?php } else { ?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<input id="eventpxtp_<?php echo $count; ?>" type="text" class='extra-qty-box etp' name='option_qty[]' data-price='<?php echo $ticket_price; ?>' value='<?php echo $default_quantity; ?>' min="<?php echo $total_min_seat; ?>" max="<?php echo max($total_seats, 0); ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php }
} else {
_e('No Seat Available', 'mage-eventpress');
}
$ticket_name = $field['option_name_t'];
do_action('mep_after_ticket_type_qty', $post_id, $ticket_name, $field, $default_quantity);
?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<input id="eventpxtp_<?php echo $count; ?>" type="text" class='extra-qty-box etp' name='option_qty[]' data-price='<?php echo $ticket_price; ?>' value='<?php echo $default_quantity; ?>' min="<?php echo $total_min_seat; ?>" max="<?php echo max($total_seats, 0); ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php }
} else {
_e('No Seat Available', 'mage-eventpress');
}
$ticket_name = $field['option_name_t'];
do_action('mep_after_ticket_type_qty', $post_id, $ticket_name, $field, $default_quantity);
?>
</td>
<td class="ticket-price"><span class="tkt-pric">
</td>
<td class="ticket-price"><span class="tkt-pric">
<?php echo mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') ? mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') : _e('Per Ticket Price:', 'mage-eventpress'); ?>
</span> <strong><?php echo wc_price($ticket_price); ?></strong>
<?php echo mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') ? mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') : _e('Per Ticket Price:', 'mage-eventpress'); ?>
</span> <strong><?php echo wc_price($ticket_price); ?></strong>
<?php if ($total_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $ticket_price; ?></p>
<input type="hidden" name='option_name[]' value='<?php echo $field['option_name_t']; ?>'>
<input type="hidden" name='option_price[]' value='<?php echo $ticket_price; ?>'>
<input type="hidden" name='max_qty[]' value='<?php echo $field['option_max_qty']; ?>'>
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" class='user-innnf'>
<div class="user-info-sec">
<div id="dadainfo_<?php echo $count; ?>" class="dada-info"></div>
</div>
</td>
</tr>
<?php $count++;
} ?>
<?php if ($total_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $ticket_price; ?></p>
<input type="hidden" name='option_name[]' value='<?php echo $field['option_name_t']; ?>'>
<input type="hidden" name='option_price[]' value='<?php echo $ticket_price; ?>'>
<input type="hidden" name='max_qty[]' value='<?php echo $field['option_max_qty']; ?>'>
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" class='user-innnf'>
<div class="user-info-sec">
<div id="dadainfo_<?php echo $count; ?>" class="dada-info"></div>
</div>
</td>
</tr>
<?php $count++;
} ?>
<?php
$loop_list = ob_get_clean();
echo apply_filters('mep_event_ticket_type_loop', $loop_list, $post_id);
$loop_list = ob_get_clean();
echo apply_filters('mep_event_ticket_type_loop', $loop_list, $post_id);
}
}

View File

@ -1,25 +1,32 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_faq', 'mep_faq_part');
function mep_faq_part($event_id){
ob_start();
$mep_event_faq = get_post_meta($event_id, 'mep_event_faq', true) ? get_post_meta($event_id, 'mep_event_faq', true) : '';
if ($mep_event_faq) {
?>
<div class="mep-event-faq-part">
<h3 class="ex-sec-title"><?php _e('Event F.A.Q', 'mage-eventpress'); ?></h3>
<div id='mep-event-accordion' class="">
<?php
foreach ($mep_event_faq as $field) {
?>
<h3><?php if ($field['mep_faq_title'] != '') echo esc_attr($field['mep_faq_title']); ?></h3>
<p><?php if ($field['mep_faq_content'] != '') echo esc_attr($field['mep_faq_content']); ?></p>
if (!function_exists('mep_faq_part')) {
function mep_faq_part($event_id)
{
ob_start();
$mep_event_faq = get_post_meta($event_id, 'mep_event_faq', true) ? get_post_meta($event_id, 'mep_event_faq', true) : '';
if ($mep_event_faq) {
?>
<div class="mep-event-faq-part">
<h3 class="ex-sec-title"><?php _e('Event F.A.Q', 'mage-eventpress'); ?></h3>
<div id='mep-event-accordion' class="">
<?php
}
?>
foreach ($mep_event_faq as $field) {
?>
<h3><?php if ($field['mep_faq_title'] != '') echo esc_attr($field['mep_faq_title']); ?></h3>
<p><?php if ($field['mep_faq_content'] != '') echo esc_attr($field['mep_faq_content']); ?></p>
<?php
}
?>
</div>
</div>
</div>
<?php
}
$content = ob_get_clean();
echo apply_filters('mage_event_faq_list', $content,$event_id);
<?php
}
$content = ob_get_clean();
echo apply_filters('mage_event_faq_list', $content, $event_id);
}
}

View File

@ -1,64 +1,80 @@
<?php
add_action('mep_event_map','mep_event_google_map');
function mep_event_google_map($event_id){
global $post,$event_meta,$user_api;
$map_type = mep_get_option( 'mep_google_map_type', 'general_setting_sec', 'iframe');
$location_sts = get_post_meta($event_id,'mep_org_address',true) ? get_post_meta($event_id,'mep_org_address',true) : '';
ob_start();
do_action('mep_event_before_google_map');
if($location_sts){
$org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
$lat = get_term_meta( $org_id, 'latitude', true );
$lon = get_term_meta( $org_id, 'longitude', true );
}else{
$lat = $event_meta['latitude'][0];
$lon = $event_meta['longitude'][0];
}
if($event_meta['mep_sgm'][0]){
if($map_type=='iframe'){
?>
<div class="mep-gmap-sec">
<iframe id="gmap_canvas" src="https://maps.google.com/maps?q=<?php echo mep_get_event_locaion_item($event_id,'mep_location_venue'); ?>&t=&z=19&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style='width: 100%;min-height: 250px;'></iframe>
</div>
<?php
}else{
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
if($user_api){
?>
<div class="mep-gmap-sec">
<div id="map" class='mep_google_map'></div>
</div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: <?php echo $lat; ?>, lng: <?php echo $lon; ?>},
zoom: 17
});
marker = new google.maps.Marker({
map: map,
draggable: false,
animation: google.maps.Animation.DROP,
position: {lat: <?php echo $lat; ?>, lng: <?php echo $lon; ?>}
});
marker.addListener('click', toggleBounce);
}
function toggleBounce() {
if (marker.getAnimation() !== null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $user_api; ?>&callback=initMap"
async defer></script>
<?php } } }
do_action('mep_event_after_google_map');
$content = ob_get_clean();
echo apply_filters('mage_event_google_map', $content,$event_id);
}?>
add_action('mep_event_map', 'mep_event_google_map');
if (!function_exists('mep_event_google_map')) {
function mep_event_google_map($event_id)
{
global $post, $event_meta, $user_api;
$map_type = mep_get_option('mep_google_map_type', 'general_setting_sec', 'iframe');
$location_sts = get_post_meta($event_id, 'mep_org_address', true) ? get_post_meta($event_id, 'mep_org_address', true) : '';
ob_start();
do_action('mep_event_before_google_map');
if ($location_sts) {
$org_arr = get_the_terms($event_id, 'mep_org');
$org_id = $org_arr[0]->term_id;
$lat = get_term_meta($org_id, 'latitude', true);
$lon = get_term_meta($org_id, 'longitude', true);
} else {
$lat = $event_meta['latitude'][0];
$lon = $event_meta['longitude'][0];
}
if ($event_meta['mep_sgm'][0]) {
if ($map_type == 'iframe') {
?>
<div class="mep-gmap-sec">
<iframe id="gmap_canvas" src="https://maps.google.com/maps?q=<?php echo mep_get_event_locaion_item($event_id, 'mep_location_venue'); ?>&t=&z=19&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style='width: 100%;min-height: 250px;'></iframe>
</div>
<?php
} else {
if ($user_api) {
?>
<div class="mep-gmap-sec">
<div id="map" class='mep_google_map'></div>
</div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {
lat: <?php echo $lat; ?>,
lng: <?php echo $lon; ?>
},
zoom: 17
});
marker = new google.maps.Marker({
map: map,
draggable: false,
animation: google.maps.Animation.DROP,
position: {
lat: <?php echo $lat; ?>,
lng: <?php echo $lon; ?>
}
});
marker.addListener('click', toggleBounce);
}
function toggleBounce() {
if (marker.getAnimation() !== null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $user_api; ?>&callback=initMap" async defer></script>
<?php }
}
}
do_action('mep_event_after_google_map');
$content = ob_get_clean();
echo apply_filters('mage_event_google_map', $content, $event_id);
}
}

View File

@ -1,9 +1,15 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_organizer','mep_ev_org');
if (!function_exists('mep_ev_org')) {
function mep_ev_org(){
global $post,$author_terms;
ob_start();
if($author_terms){ ?><p> <?php echo mep_get_option('mep_by_text', 'label_setting_sec') ? mep_get_option('mep_by_text', 'label_setting_sec') : _e('By:','mage-eventpress'); ?> <a href="<?php echo get_term_link( $author_terms[0]->term_id, 'mep_org' ); ?>"><?php echo $author_terms[0]->name; ?></a></p><?php }
$content = ob_get_clean();
echo apply_filters('mage_event_single_org_name', $content,$post->ID);
}
}

View File

@ -1,5 +1,10 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_price','mep_ev_price');
if (!function_exists('mep_ev_price')) {
function mep_ev_price(){
global $post,$event_meta;
ob_start();
@ -11,4 +16,5 @@ global $post,$event_meta;
}
$content = ob_get_clean();
echo apply_filters('mage_event_single_price', $content,$post->ID);
}
}

View File

@ -1,21 +1,22 @@
<?php
// mep_shortcode_add_cart_section
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_shortcode_add_cart_section','mep_shortcode_add_cart_section_html');
function mep_shortcode_add_cart_section_html($event){
add_action('mep_shortcode_add_cart_section', 'mep_shortcode_add_cart_section_html');
if (!function_exists('mep_shortcode_add_cart_section_html')) {
function mep_shortcode_add_cart_section_html($event)
{
?>
<div class='mep-events-shortcode-cart-section'>
<div class='mep-events-wrapper'>
<div class='mep-default-feature-cart-sec'>
<?php mep_get_event_reg_btn($event); ?>
<?php mep_single_page_js_script($event); //do_action('mep_add_to_cart_shortcode_js',$event); ?>
<div class='mep-events-shortcode-cart-section'>
<div class='mep-events-wrapper'>
<div class='mep-default-feature-cart-sec'>
<?php mep_get_event_reg_btn($event); ?>
<?php mep_single_page_js_script($event); //do_action('mep_add_to_cart_shortcode_js',$event);
?>
</div>
</div>
</div>
</div>
</div>
<?php
}
}

View File

@ -1,9 +1,16 @@
<?php
add_action('mep_event_speakers_list_shortcode_template','mep_shortcode_speaker_list_html');
function mep_shortcode_speaker_list_html($event_id){
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_speakers_list_shortcode_template', 'mep_shortcode_speaker_list_html');
if (!function_exists('mep_shortcode_speaker_list_html')) {
function mep_shortcode_speaker_list_html($event_id)
{
?>
<div class="mep-default-sidebar-speaker-list">
<?php echo mep_display_speaker_list($event_id); ?>
</div>
<div class="mep-default-sidebar-speaker-list">
<?php echo mep_display_speaker_list($event_id); ?>
</div>
<?php
}
}
}

View File

@ -1,14 +1,21 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_social_share', 'mep_ev_social_share');
function mep_ev_social_share(){
global $post;
ob_start();
$post_id = $post->ID;
?>
<div class="mep-event-meta">
<?php _e(mep_get_label($post_id, 'mep_share_text', 'Share This Event:'), 'mage-eventpress'); ?><?php mep_social_share(); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_single_social_share', $content,$post->ID);
if (!function_exists('mep_ev_social_share')) {
function mep_ev_social_share()
{
global $post;
ob_start();
$post_id = $post->ID;
?>
<div class="mep-event-meta">
<?php _e(mep_get_label($post_id, 'mep_share_text', 'Share This Event:'), 'mage-eventpress'); ?><?php mep_social_share(); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_single_social_share', $content, $post->ID);
}
}

View File

@ -1,4 +1,8 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
require_once(dirname(__FILE__) . "/thumbnail.php");
require_once(dirname(__FILE__) . "/title.php");
require_once(dirname(__FILE__) . "/organizer.php");

View File

@ -1,13 +1,20 @@
<?php
add_action('mep_event_thumbnail','mep_thumbnail');
function mep_thumbnail(){
global $post;
ob_start();
?>
<div class="mep-event-thumbnail">
<?php the_post_thumbnail('full'); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_single_thumbnail', $content,$post->ID);
}
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_thumbnail', 'mep_thumbnail');
if (!function_exists('mep_thumbnail')) {
function mep_thumbnail()
{
global $post;
ob_start();
?>
<div class="mep-event-thumbnail">
<?php the_post_thumbnail('full'); ?>
</div>
<?php
$content = ob_get_clean();
echo apply_filters('mage_event_single_thumbnail', $content, $post->ID);
}
}

View File

@ -1,5 +1,10 @@
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_title','mep_ev_title');
if (!function_exists('mep_ev_title')) {
function mep_ev_title(){
global $post;
ob_start();
@ -9,3 +14,4 @@ function mep_ev_title(){
$content = ob_get_clean();
echo apply_filters('mage_event_single_title', $content,$post->ID);
}
}

View File

@ -1,25 +1,33 @@
<?php
add_action('mep_event_seat','mep_ev_seat');
function mep_ev_seat(){
global $post,$event_meta;
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
ob_start();
if($recurring == 'no'){
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true) ? get_post_meta($post->ID, 'mep_event_ticket_type', true) : array();
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
if(is_array($mep_event_ticket_type) && sizeof($mep_event_ticket_type) > 0){
$total_seat = mep_event_total_seat(get_the_id(),'total');
$total_resv = mep_event_total_seat(get_the_id(),'resv');
$total_sold = mep_ticket_sold(get_the_id());
$total_left = $total_seat - ($total_sold + $total_resv);
?>
<h5><strong><?php echo mep_get_option('mep_total_seat_text', 'label_setting_sec') ? mep_get_option('mep_total_seat_text', 'label_setting_sec') : _e('Total Seat:','mage-eventpress'); ?></strong> <?php echo $total_seat; if($mep_available_seat=='on'){ ?> (<strong><?php echo max($total_left,0); ?></strong> <?php _e('Left','mage-eventpress'); ?>)<?php } ?></h5>
<?php
}
}
$content = ob_get_clean();
echo apply_filters('mage_event_single_title', $content,$post->ID);
<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
add_action('mep_event_seat', 'mep_ev_seat');
if (!function_exists('mep_ev_seat')) {
function mep_ev_seat()
{
global $post, $event_meta;
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
ob_start();
if ($recurring == 'no') {
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true) ? get_post_meta($post->ID, 'mep_event_ticket_type', true) : array();
$mep_available_seat = array_key_exists('mep_available_seat', $event_meta) ? $event_meta['mep_available_seat'][0] : 'on';
if (is_array($mep_event_ticket_type) && sizeof($mep_event_ticket_type) > 0) {
$total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat(get_the_id(), 'total'), get_the_id());
$total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat(get_the_id(), 'resv'), get_the_id());
$total_sold = mep_ticket_sold(get_the_id());
$total_left = $total_seat - ($total_sold + $total_resv);
?>
<h5><strong><?php echo mep_get_option('mep_total_seat_text', 'label_setting_sec') ? mep_get_option('mep_total_seat_text', 'label_setting_sec') : _e('Total Seat:', 'mage-eventpress'); ?></strong> <?php echo $total_seat;
if ($mep_available_seat == 'on') { ?> (<strong><?php echo max($total_left, 0); ?></strong> <?php _e('Left', 'mage-eventpress'); ?>)<?php } ?></h5>
<?php
}
}
$content = ob_get_clean();
echo apply_filters('mage_event_single_title', $content, $post->ID);
}
}

View File

@ -546,4 +546,14 @@ Fix Event Start Date Time Wrong Display issue
New Feature: You can hide Event Date & location from the cart section display
New Filter & Action hooks added
08 May 2020*
08 May 2020*
= 3.2.6 =
* Update Release:
Code Optimized & Improved
Fix Event Date issue in Event List For Multidate
Event Location modified in event list
WooCommerce Hidden Product issue fixed
New Filter hooked added in Total Seat value
24 May 2020*

View File

@ -1,28 +1,30 @@
<?php
/**
* Plugin Name: Woocommerce Events Manager
* Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 3.2.5
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress
* Domain Path: /languages/
*/
* Plugin Name: Woocommerce Events Manager
* Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 3.2.6
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress
* Domain Path: /languages/
*/
if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
if (is_plugin_active('woocommerce/woocommerce.php')) {
require_once(dirname(__FILE__) . "/inc/mep_file_include.php");
}else{
function mep_admin_notice_wc_not_active() {
$class = 'notice notice-error';
} else {
function mep_admin_notice_wc_not_active()
{
$class = 'notice notice-error';
printf(
'<div class="error" style="background:red; color:#fff;"><p>%s</p></div>',
__('You Must Install WooCommerce Plugin before activating WooCommerce Event Manager, Becuase It is dependent on Woocommerce Plugin')
);
}
add_action('admin_notices', 'mep_admin_notice_wc_not_active');
}
add_action( 'admin_notices', 'mep_admin_notice_wc_not_active' );
}