some file modified
This commit is contained in:
parent
61c0c36829
commit
c93f1c0035
|
@ -308,7 +308,7 @@ h3.mep_list_date {font-size: 16px; font-style: italic;font-weight: bold;color: #
|
|||
.mage_grid_box{margin: 0 0 20px 0;}
|
||||
.mage_grid_box .blank_div{margin: 0 20px 0 0;}
|
||||
.mage_grid_box .mep_event_grid_item:last-child,
|
||||
.mage_grid_box .blank_div:last-child{margin: 0;}
|
||||
.mage_grid_box .blank_div:last-child{margin: 0 0 15px 0;}
|
||||
.mep_event_grid_item .mep_list_event_details,
|
||||
.mep_event_grid_item .mep_list_thumb{width: 100%}
|
||||
.mep_event_grid_item .mep_list_thumb img{height: 160px;}
|
||||
|
|
|
@ -1,131 +1,79 @@
|
|||
<?php
|
||||
function mep_add_custom_fields_text_to_cart_item( $cart_item_data, $product_id, $variation_id ){
|
||||
|
||||
$product_id = get_post_meta($product_id,'link_mep_event',true) ? get_post_meta($product_id,'link_mep_event',true) : $product_id;
|
||||
$recurring = get_post_meta($product_id, 'mep_enable_recurring', true) ? get_post_meta($product_id, 'mep_enable_recurring', true) : 'no';
|
||||
if (get_post_type($product_id) == 'mep_events') {
|
||||
$tp = get_post_meta($product_id,'_price',true);
|
||||
$product_id = get_post_meta($product_id,'link_mep_event',true) ? get_post_meta($product_id,'link_mep_event',true) : $product_id;
|
||||
$recurring = get_post_meta($product_id, 'mep_enable_recurring', true) ? get_post_meta($product_id, 'mep_enable_recurring', true) : 'no';
|
||||
if (get_post_type($product_id) == 'mep_events') {
|
||||
$tp = get_post_meta($product_id,'_price',true);
|
||||
$new = array();
|
||||
|
||||
$new = array();
|
||||
$event_cart_location = isset($_POST['mep_event_location_cart']) ? $_POST['mep_event_location_cart'] : array();
|
||||
$event_cart_date = isset($_POST['mep_event_date_cart']) ? $_POST['mep_event_date_cart'] : array();
|
||||
$mep_event_start_date = isset($_POST['mep_event_start_date']) ? $_POST['mep_event_start_date'] : array();
|
||||
$checked = isset($_POST['event_addt_price']) ? $_POST['event_addt_price'] : array();
|
||||
$names = isset($_POST['option_name']) ? $_POST['option_name'] : array();
|
||||
$qty = isset($_POST['option_qty']) ? $_POST['option_qty'] : array();
|
||||
$max_qty = isset($_POST['max_qty']) ? $_POST['max_qty'] : array();
|
||||
$price = isset($_POST['option_price']) ? $_POST['option_price'] : array();
|
||||
$recurring_event_date = $recurring == 'yes' ? isset($_POST['recurring_event_date']) ? $_POST['recurring_event_date'] : array() : array();
|
||||
$count = count( $names );
|
||||
|
||||
if(isset($_POST['mep_event_location_cart'])){
|
||||
$event_cart_location = $_POST['mep_event_location_cart'];
|
||||
}else{ $event_cart_location = ""; }
|
||||
|
||||
if(isset($_POST['mep_event_date_cart'])){
|
||||
$event_cart_date = $_POST['mep_event_date_cart'];
|
||||
}else{ $event_cart_date = ""; }
|
||||
|
||||
if(isset($_POST['mep_event_start_date'])){
|
||||
$mep_event_start_date = $_POST['mep_event_start_date'];
|
||||
}else{ $mep_event_start_date = ""; }
|
||||
|
||||
if(isset($_POST['event_addt_price'])){
|
||||
$checked = $_POST['event_addt_price'];
|
||||
}else{ $checked=""; }
|
||||
|
||||
if(isset($_POST['option_name'])){
|
||||
$names = $_POST['option_name'];
|
||||
}else{ $names=array(); }
|
||||
|
||||
if(isset($_POST['option_qty'])){
|
||||
$qty = $_POST['option_qty'];
|
||||
}else{ $qty=""; }
|
||||
|
||||
if(isset($_POST['max_qty'])){
|
||||
$max_qty = $_POST['max_qty'];
|
||||
}else{ $max_qty=""; }
|
||||
|
||||
if(isset($_POST['option_price'])){
|
||||
$price = $_POST['option_price'];
|
||||
}else{ $price=""; }
|
||||
|
||||
if($recurring == 'yes'){
|
||||
$recurring_event_date = isset($_POST['recurring_event_date']) ? $_POST['recurring_event_date'] : array();
|
||||
}else{
|
||||
$recurring_event_date = array();
|
||||
if(isset($_POST['option_name'])){
|
||||
for ( $i = 0; $i < $count; $i++ ) {
|
||||
if($qty[$i] > 0){
|
||||
if ( $names[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_name'] = stripslashes( strip_tags( $names[$i] ) );
|
||||
endif;
|
||||
if ( $price[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_price'] = stripslashes( strip_tags( $price[$i] ) );
|
||||
endif;
|
||||
if ( $qty[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_qty'] = stripslashes( strip_tags( $qty[$i] ) );
|
||||
endif;
|
||||
if ( $max_qty[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['max_qty'] = stripslashes( strip_tags( $max_qty[$i] ) );
|
||||
endif;
|
||||
if ( $mep_event_start_date[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['event_date'] = stripslashes( strip_tags( $mep_event_start_date[$i] ) );
|
||||
endif;
|
||||
$opttprice = ($price[$i]*$qty[$i]);
|
||||
$tp = ($tp+$opttprice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$extra_service_name = isset($_POST['event_extra_service_name']) ? mage_array_strip($_POST['event_extra_service_name']) : array();
|
||||
$extra_service_qty = isset($_POST['event_extra_service_qty'])? mage_array_strip($_POST['event_extra_service_qty']):array();
|
||||
$extra_service_price = isset($_POST['event_extra_service_price'])? mage_array_strip($_POST['event_extra_service_price']):array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$count = count( $names );
|
||||
|
||||
if(isset($_POST['option_name'])){
|
||||
for ( $i = 0; $i < $count; $i++ ) {
|
||||
if($qty[$i] > 0){
|
||||
if ( $names[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_name'] = stripslashes( strip_tags( $names[$i] ) );
|
||||
endif;
|
||||
if ( $price[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_price'] = stripslashes( strip_tags( $price[$i] ) );
|
||||
endif;
|
||||
if ( $qty[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['ticket_qty'] = stripslashes( strip_tags( $qty[$i] ) );
|
||||
endif;
|
||||
if ( $max_qty[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['max_qty'] = stripslashes( strip_tags( $max_qty[$i] ) );
|
||||
endif;
|
||||
|
||||
if ( $mep_event_start_date[$i] != '' ) :
|
||||
$ticket_type_arr[$i]['event_date'] = stripslashes( strip_tags( $mep_event_start_date[$i] ) );
|
||||
endif;
|
||||
|
||||
$opttprice = ($price[$i]*$qty[$i]);
|
||||
$tp = ($tp+$opttprice);
|
||||
|
||||
if($extra_service_name){
|
||||
for ( $i = 0; $i < count($extra_service_name); $i++ ) {
|
||||
if($extra_service_qty[$i] > 0){
|
||||
if ( $extra_service_name[$i] != '' ) :
|
||||
$event_extra[$i]['service_name'] = stripslashes( strip_tags( $extra_service_name[$i] ) );
|
||||
endif;
|
||||
if ( $extra_service_price[$i] != '' ) :
|
||||
$event_extra[$i]['service_price'] = stripslashes( strip_tags( $extra_service_price[$i] ) );
|
||||
endif;
|
||||
if ( $extra_service_qty[$i] != '' ) :
|
||||
$event_extra[$i]['service_qty'] = stripslashes( strip_tags( $extra_service_qty[$i] ) );
|
||||
endif;
|
||||
}
|
||||
$extprice = ($extra_service_price[$i]*$extra_service_qty[$i]);
|
||||
$tp = ($tp+$extprice);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$extra_service_name = isset($_POST['event_extra_service_name']) ? mage_array_strip($_POST['event_extra_service_name']) : array();
|
||||
$extra_service_qty = isset($_POST['event_extra_service_qty'])? mage_array_strip($_POST['event_extra_service_qty']):array();
|
||||
$extra_service_price = isset($_POST['event_extra_service_price'])? mage_array_strip($_POST['event_extra_service_price']):array();
|
||||
|
||||
|
||||
|
||||
if($extra_service_name){
|
||||
for ( $i = 0; $i < count($extra_service_name); $i++ ) {
|
||||
if($extra_service_qty[$i] > 0){
|
||||
if ( $extra_service_name[$i] != '' ) :
|
||||
$event_extra[$i]['service_name'] = stripslashes( strip_tags( $extra_service_name[$i] ) );
|
||||
endif;
|
||||
if ( $extra_service_price[$i] != '' ) :
|
||||
$event_extra[$i]['service_price'] = stripslashes( strip_tags( $extra_service_price[$i] ) );
|
||||
endif;
|
||||
if ( $extra_service_qty[$i] != '' ) :
|
||||
$event_extra[$i]['service_qty'] = stripslashes( strip_tags( $extra_service_qty[$i] ) );
|
||||
endif;
|
||||
}
|
||||
|
||||
$extprice = ($extra_service_price[$i]*$extra_service_qty[$i]);
|
||||
$tp = ($tp+$extprice);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_POST['mep_event_ticket_type'])){
|
||||
$ttp = $_POST['mep_event_ticket_type'];
|
||||
$ttpqt = $_POST['tcp_qty'];
|
||||
$ticket_type = mep_get_order_info($ttp,1);
|
||||
$ticket_type_price = (mep_get_order_info($ttp,0)*$ttpqt);
|
||||
$cart_item_data['event_ticket_type'] = $ticket_type;
|
||||
$cart_item_data['event_ticket_price'] = $ticket_type_price;
|
||||
$cart_item_data['event_ticket_qty'] = $ttpqt;
|
||||
$tp = $tp+$ticket_type_price;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['mep_event_ticket_type'])){
|
||||
$ttp = $_POST['mep_event_ticket_type'];
|
||||
$ttpqt = $_POST['tcp_qty'];
|
||||
$ticket_type = mep_get_order_info($ttp,1);
|
||||
$ticket_type_price = (mep_get_order_info($ttp,0)*$ttpqt);
|
||||
$cart_item_data['event_ticket_type'] = $ticket_type;
|
||||
$cart_item_data['event_ticket_price'] = $ticket_type_price;
|
||||
$cart_item_data['event_ticket_qty'] = $ttpqt;
|
||||
$tp = $tp+$ticket_type_price;
|
||||
}
|
||||
|
||||
$form_position = mep_get_option( 'mep_user_form_position', 'general_attendee_sec', 'details_page' );
|
||||
if($form_position=='details_page'){
|
||||
|
|
|
@ -14,3 +14,4 @@ require_once(dirname(__DIR__) . "/inc/mep_tax_meta.php");
|
|||
require_once(dirname(__DIR__) . "/inc/mep_addon_list.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_upgrade.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_functions.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_query.php");
|
|
@ -2025,8 +2025,8 @@ function mep_get_all_tax_list($current_tax=null){
|
|||
$date_format = get_option( 'date_format' );
|
||||
$time_format = get_option( 'time_format' );
|
||||
$wpdatesettings = $date_format.' '.$time_format;
|
||||
$timezone = wp_timezone_string();
|
||||
$timestamp = strtotime( $date . ' '. $timezone);
|
||||
$timezone = wp_timezone_string();
|
||||
$timestamp = strtotime( $date . ' '. $timezone);
|
||||
|
||||
if($type == 'date'){
|
||||
return wp_date( $date_format, $timestamp );
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
function mep_event_query($type,$show,$sort='',$cat='',$org='',$evnt_type = 'upcoming'){
|
||||
$event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
|
||||
$now = current_time('Y-m-d H:i:s');
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
$etype = $evnt_type == 'expired' ? '<' : '>';
|
||||
|
||||
if($type='all'){
|
||||
$args = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => $etype
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = new WP_Query($args);
|
||||
}elseif($type == 'cat'){
|
||||
|
||||
$args = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => $etype
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_cat',
|
||||
'field' => 'term_id',
|
||||
'terms' => $cat
|
||||
)
|
||||
)
|
||||
);
|
||||
$loop = new WP_Query($args);
|
||||
}elseif($type == 'org'){
|
||||
$args = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $paged,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => $etype
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_org',
|
||||
'field' => 'term_id',
|
||||
'terms' => $org
|
||||
)
|
||||
)
|
||||
);
|
||||
$loop = new WP_Query($args);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $loop;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function mep_event_pagination($total_page){
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12"><?php
|
||||
$pargs = array(
|
||||
"current" => $paged,
|
||||
"total" => $total_page
|
||||
);
|
||||
echo "<div class='pagination-sec'>" . paginate_links($pargs) . "</div>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
|
@ -3,43 +3,23 @@ if (!defined('ABSPATH')) {
|
|||
die;
|
||||
} // Cannot access pages directly.
|
||||
|
||||
|
||||
add_shortcode('event-calendar', 'mep_cal_func');
|
||||
|
||||
|
||||
function mep_cal_func($atts, $content = null){
|
||||
ob_start();
|
||||
echo mep_event_calender();
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
|
||||
function mep_event_calender(){
|
||||
$event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
|
||||
?>
|
||||
?>
|
||||
<div class="event-calendar"></div>
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
const myEvents = [
|
||||
<?php
|
||||
$now = current_time('Y-m-d H:i:s');
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'posts_per_page' => -1,
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
$loop = new WP_Query($args_search_qqq);
|
||||
$i = 1;
|
||||
$count = $loop->post_count - 1;
|
||||
|
||||
$loop = mep_event_query('all',-1);
|
||||
$i = 1;
|
||||
$count = $loop->post_count - 1;
|
||||
while ($loop->have_posts()) {
|
||||
$loop->the_post();
|
||||
$event_meta = get_post_custom(get_the_id());
|
||||
|
@ -97,7 +77,6 @@ function mep_event_list($atts, $content = null){
|
|||
"pagination" => "no",
|
||||
'sort' => 'ASC'
|
||||
);
|
||||
|
||||
$params = shortcode_atts($defaults, $atts);
|
||||
$cat = $params['cat'];
|
||||
$org = $params['org'];
|
||||
|
@ -114,142 +93,35 @@ function mep_event_list($atts, $content = null){
|
|||
ob_start();
|
||||
?>
|
||||
<div class='mep_event_list'>
|
||||
|
||||
|
||||
<?php if ($cat_f == 'yes') { ?>
|
||||
<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 }
|
||||
if ($org_f == 'yes') { ?>
|
||||
<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 } ?>
|
||||
<?php if ($cat_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_cat_names');
|
||||
}
|
||||
if ($org_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_org_names');
|
||||
} ?>
|
||||
|
||||
<div class="mep_event_list_sec">
|
||||
<?php
|
||||
$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:');
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
|
||||
|
||||
/**
|
||||
* The Main Query function mep_event_query is locet in inc/mep_query.php File
|
||||
*/
|
||||
if ($cat > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_cat',
|
||||
'field' => 'term_id',
|
||||
'terms' => $cat
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('cat',$show,$sort,$cat,0,'upcoming');
|
||||
} elseif ($org > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $paged,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_org',
|
||||
'field' => 'term_id',
|
||||
'terms' => $org
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('org',$show,$sort,0,$org,'upcoming');
|
||||
} else {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('all',$show,$sort,0,0,'upcoming');
|
||||
}
|
||||
|
||||
$loop = new WP_Query($args_search_qqq);
|
||||
$total_post=$loop->post_count;
|
||||
echo '<div class="mage_grid_box">';
|
||||
while ($loop->have_posts()) {
|
||||
|
||||
$loop->the_post();
|
||||
$event_meta = get_post_custom(get_the_id());
|
||||
$author_terms = get_the_terms(get_the_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(get_the_id(), 'mep_cat');
|
||||
$torg = get_the_terms(get_the_id(), 'mep_org');
|
||||
|
||||
$org_class = mep_get_term_as_class(get_the_id(), 'mep_org');
|
||||
$cat_class = mep_get_term_as_class(get_the_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(get_the_id(), $event_meta);
|
||||
|
||||
$loop->the_post();
|
||||
if ($style == 'grid') {
|
||||
if ($column == 2) {
|
||||
$columnNumber = 'two_column';
|
||||
|
@ -263,125 +135,19 @@ function mep_event_list($atts, $content = null){
|
|||
} else {
|
||||
$columnNumber = 'one_column';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class='<?php echo $columnNumber; ?> mep_event_<?php echo $style; ?>_item mix <?php if ($tt) {
|
||||
echo $org_class;
|
||||
} ?> <?php if ($torg) {
|
||||
echo $cat_class;
|
||||
} ?>'>
|
||||
<div class="mep_list_thumb">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('full'); ?></a>
|
||||
<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 } ?>
|
||||
|
||||
</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(get_the_id());
|
||||
} ?></h3>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($style == 'list') {
|
||||
?>
|
||||
<div class="mep-event-excerpt">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
|
||||
// List Settings Values::::::::::::::::::::::::
|
||||
$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');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<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 ($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(get_the_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 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 mep_get_only_time($event_meta['event_start_time'][0]);
|
||||
if ($hide_only_end_time_list == 'no') { ?> - <?php mep_get_only_time($event_meta['event_end_time'][0]);
|
||||
} ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <p>--><?php //echo count($args_search_qqq);?><!--</p>-->
|
||||
<?php
|
||||
/**
|
||||
* This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_shortcode',get_the_id(),$columnNumber,$style);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
echo '</div>';
|
||||
//}
|
||||
if ($pagination == 'yes') {
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12"><?php
|
||||
$pargs = array(
|
||||
"current" => $paged,
|
||||
"total" => $loop->max_num_pages
|
||||
);
|
||||
echo "<div class='pagination-sec'>" . paginate_links($pargs) . "</div>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
echo '</div>';
|
||||
if ($pagination == 'yes') {
|
||||
/**
|
||||
* The Pagination function mep_event_pagination is locet in inc/mep_query.php File
|
||||
*/
|
||||
mep_event_pagination($loop->max_num_pages);
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -396,6 +162,10 @@ function mep_event_list($atts, $content = null){
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_shortcode('expire-event-list', 'mep_expire_event_list');
|
||||
function mep_expire_event_list($atts, $content = null)
|
||||
{
|
||||
|
@ -423,204 +193,60 @@ function mep_expire_event_list($atts, $content = null)
|
|||
ob_start();
|
||||
?>
|
||||
<div class='mep_event_list'>
|
||||
<?php if ($cat_f == 'yes') { ?>
|
||||
<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">All</button><?php
|
||||
foreach ($terms as $_terms) {
|
||||
?>
|
||||
<button type="button" class="mep-cat-control" data-filter=".<?php echo $_terms->slug; ?>"><?php echo $_terms->name; ?></button><?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
if ($org_f == 'yes') { ?>
|
||||
<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">All</button><?php
|
||||
foreach ($terms as $_terms) {
|
||||
?>
|
||||
<button type="button" class="mep-cat-control" data-filter=".<?php echo $_terms->slug; ?>"><?php echo $_terms->name; ?></button><?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mep_event_list_sec">
|
||||
<?php if ($cat_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_cat_names');
|
||||
}
|
||||
if ($org_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_org_names');
|
||||
} ?>
|
||||
<div class="mep_event_list_sec">
|
||||
<?php
|
||||
$now = current_time('Y-m-d H:i:s');
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
/**
|
||||
* The Main Query function mep_event_query is locet in inc/mep_query.php File
|
||||
*/
|
||||
if ($cat > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '<'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_cat',
|
||||
'field' => 'term_id',
|
||||
'terms' => $cat
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('cat',$show,$sort,$cat,0,'expired');
|
||||
} elseif ($org > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $paged,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '<'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_org',
|
||||
'field' => 'term_id',
|
||||
'terms' => $org
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('org',$show,$sort,0,$org,'expired');
|
||||
} else {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '<'
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('all',$show,$sort,0,0,'expired');
|
||||
}
|
||||
|
||||
$loop = new WP_Query($args_search_qqq);
|
||||
$total_post=$loop->post_count;
|
||||
echo '<div class="mage_grid_box">';
|
||||
while ($loop->have_posts()) {
|
||||
$loop->the_post();
|
||||
$event_meta = get_post_custom(get_the_id());
|
||||
$author_terms = get_the_terms(get_the_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);
|
||||
|
||||
|
||||
//if(time() > strtotime($newformat)){
|
||||
$tt = get_the_terms(get_the_id(), 'mep_cat');
|
||||
$torg = get_the_terms(get_the_id(), 'mep_org');
|
||||
// print_r($tt);
|
||||
|
||||
|
||||
?>
|
||||
<div class='mep_event_list_item mix <?php echo $tt[0]->slug; ?> <?php echo $torg[0]->slug; ?>'>
|
||||
<div class="mep_list_thumb">
|
||||
<?php the_post_thumbnail('full'); ?>
|
||||
<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>
|
||||
<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>
|
||||
<h3 class='mep_list_date'> Price Start from: <?php echo mep_event_list_price(get_the_id()); ?></h3>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($style == 'list') {
|
||||
?>
|
||||
<div class="mep-event-excerpt">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mep-list-footer">
|
||||
<ul>
|
||||
<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>
|
||||
<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 echo $event_meta['mep_city'][0]; ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
|
||||
<div class="evl-cc">
|
||||
<h5>
|
||||
<?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 mep_get_only_time($event_meta['event_start_time'][0]); ?> - <?php mep_get_only_time($event_meta['event_end_time'][0]); ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
//}
|
||||
$loop->the_post();
|
||||
if ($style == 'grid') {
|
||||
if ($column == 2) {
|
||||
$columnNumber = 'two_column';
|
||||
} elseif ($column == 3) {
|
||||
$columnNumber = 'three_column';
|
||||
} elseif ($column == 4) {
|
||||
$columnNumber = 'four_column';
|
||||
} else {
|
||||
$columnNumber = 'two_column';
|
||||
}
|
||||
} else {
|
||||
$columnNumber = 'one_column';
|
||||
}
|
||||
/**
|
||||
* This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_shortcode',get_the_id(),$columnNumber,$style);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
if ($pagination == 'yes') {
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12"><?php
|
||||
$pargs = array(
|
||||
"current" => $paged,
|
||||
"total" => $loop->max_num_pages
|
||||
);
|
||||
echo "<div class='pagination-sec'>" . paginate_links($pargs) . "</div>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
echo '</div>';
|
||||
if ($pagination == 'yes') {
|
||||
/**
|
||||
* The Pagination function mep_event_pagination is locet in inc/mep_query.php File
|
||||
*/
|
||||
mep_event_pagination($loop->max_num_pages);
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -663,196 +289,82 @@ function mep_event_onepage_list($atts, $content = null)
|
|||
do_action('woocommerce_before_single_product');
|
||||
?>
|
||||
<div class='mep_event_list'>
|
||||
<?php if ($cat_f == 'yes') { ?>
|
||||
<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 }
|
||||
if ($org_f == 'yes') { ?>
|
||||
<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 } ?>
|
||||
<?php if ($cat_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where category filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_cat_names');
|
||||
}
|
||||
if ($org_f == 'yes') {
|
||||
/**
|
||||
* This is the hook where Organization filter lists are fired from inc/template-parts/event_list_tax_name_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_org_names');
|
||||
} ?>
|
||||
|
||||
<div class="mep_event_list_sec">
|
||||
<?php
|
||||
$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:');
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
$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:');
|
||||
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
|
||||
|
||||
/**
|
||||
* The Main Query function mep_event_query is locet in inc/mep_query.php File
|
||||
*/
|
||||
if ($cat > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_cat',
|
||||
'field' => 'term_id',
|
||||
'terms' => $cat
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('cat',$show,$sort,$cat,0,'upcoming');
|
||||
} elseif ($org > 0) {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $paged,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'mep_org',
|
||||
'field' => 'term_id',
|
||||
'terms' => $org
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('org',$show,$sort,0,$org,'upcoming');
|
||||
} else {
|
||||
$args_search_qqq = array(
|
||||
'post_type' => array('mep_events'),
|
||||
'paged' => $paged,
|
||||
'posts_per_page' => $show,
|
||||
'order' => $sort,
|
||||
'orderby' => 'meta_value',
|
||||
'meta_key' => 'event_start_datetime',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $event_expire_on,
|
||||
'value' => $now,
|
||||
'compare' => '>'
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
$loop = mep_event_query('all',$show,$sort,0,0,'upcoming');
|
||||
}
|
||||
?>
|
||||
<div class="mep_event_list_sec">
|
||||
<?php
|
||||
/**
|
||||
* The Main Query function mep_event_query is locet in inc/mep_query.php File
|
||||
*/
|
||||
if ($cat > 0) {
|
||||
$loop = mep_event_query('cat',$show,$sort,$cat,0,'upcoming');
|
||||
} elseif ($org > 0) {
|
||||
$loop = mep_event_query('org',$show,$sort,0,$org,'upcoming');
|
||||
} else {
|
||||
$loop = mep_event_query('all',$show,$sort,0,0,'upcoming');
|
||||
}
|
||||
|
||||
$loop = new WP_Query($args_search_qqq);
|
||||
while ($loop->have_posts()) {
|
||||
$loop->the_post();
|
||||
$event_meta = get_post_custom(get_the_id());
|
||||
$author_terms = get_the_terms(get_the_id(), 'mep_org');
|
||||
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
||||
$event_meta = get_post_custom(get_the_id());
|
||||
$author_terms = get_the_terms(get_the_id(), 'mep_org');
|
||||
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
||||
$time = strtotime($start_datetime);
|
||||
$newformat = date_i18n('Y-m-d H:i:s', $time);
|
||||
|
||||
$tt = get_the_terms(get_the_id(), 'mep_cat');
|
||||
$torg = get_the_terms(get_the_id(), 'mep_org');
|
||||
|
||||
|
||||
$org_class = mep_get_term_as_class(get_the_id(), 'mep_org');
|
||||
$cat_class = mep_get_term_as_class(get_the_id(), 'mep_cat');
|
||||
|
||||
|
||||
$available_seat = mep_get_total_available_seat(get_the_id(), $event_meta);
|
||||
?>
|
||||
<div class='mep_event_<?php echo $style; ?>_item mix <?php if ($tt) {
|
||||
echo 'mage-' . $org_class;
|
||||
} ?> <?php if ($torg) {
|
||||
echo 'mage-' . $cat_class;
|
||||
} ?>'>
|
||||
<div class="mep_list_thumb">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('full'); ?></a>
|
||||
<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>
|
||||
<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(get_the_id());
|
||||
} ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="mep-list-footer">
|
||||
<ul>
|
||||
<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>
|
||||
<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(get_the_id()); ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="evl-ico"><i class="fa fa-calendar"></i></div>
|
||||
<div class="evl-cc">
|
||||
<h5>
|
||||
<?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 mep_get_only_time($event_meta['event_start_time'][0]); ?> - <?php mep_get_only_time($event_meta['event_end_time'][0]); ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
$available_seat = mep_get_total_available_seat(get_the_id(), $event_meta);
|
||||
echo '<div class="mage_grid_box">';
|
||||
while ($loop->have_posts()) {
|
||||
$loop->the_post();
|
||||
if ($style == 'grid') {
|
||||
if ($column == 2) {
|
||||
$columnNumber = 'two_column';
|
||||
} elseif ($column == 3) {
|
||||
$columnNumber = 'three_column';
|
||||
} elseif ($column == 4) {
|
||||
$columnNumber = 'four_column';
|
||||
} else {
|
||||
$columnNumber = 'two_column';
|
||||
}
|
||||
} else {
|
||||
$columnNumber = 'one_column';
|
||||
}
|
||||
/**
|
||||
* This is the hook where Event Loop List fired from inc/template-parts/event_loop_list.php File
|
||||
*/
|
||||
do_action('mep_event_list_shortcode',get_the_id(),$columnNumber,$style);
|
||||
|
||||
$currency_pos = get_option('woocommerce_currency_pos');
|
||||
|
||||
$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]);
|
||||
|
@ -866,30 +378,17 @@ function mep_event_onepage_list($atts, $content = null)
|
|||
echo '<div class=event-cart-section-list>';
|
||||
do_action('mep_add_to_cart_list');
|
||||
echo '</div>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_event_list_js(get_the_id(), $event_meta, $currency_pos);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
//}
|
||||
if ($pagination == 'yes') {
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12"><?php
|
||||
$pargs = array(
|
||||
"current" => $paged,
|
||||
"total" => $loop->max_num_pages
|
||||
);
|
||||
echo "<div class='pagination-sec'>" . paginate_links($pargs) . "</div>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
?>
|
||||
echo '</div>';
|
||||
if ($pagination == 'yes') {
|
||||
/**
|
||||
* The Pagination function mep_event_pagination is locet in inc/mep_query.php File
|
||||
*/
|
||||
mep_event_pagination($loop->max_num_pages);
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,8 +4,16 @@ add_action('mep_event_add_calender','mep_ev_calender');
|
|||
function mep_ev_calender(){
|
||||
?>
|
||||
<div class="calender-url">
|
||||
<?php mep_add_to_google_calender_link(get_the_id()); ?>
|
||||
<?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(get_the_id());
|
||||
do_action('mep_after_add_calendar_button');
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,216 +4,135 @@ add_action('mep_add_to_cart','mep_get_event_reg_btn');
|
|||
// Get Event Registration Button
|
||||
function mep_get_event_reg_btn(){
|
||||
global $post,$event_meta;
|
||||
$post_id = $post->ID;
|
||||
$event_meta = get_post_custom($post_id);
|
||||
|
||||
$post_id = $post->ID;
|
||||
$event_meta = get_post_custom($post_id);
|
||||
$event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
|
||||
$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]);
|
||||
$event_ecternal_link = '';
|
||||
$book_count = get_post_meta($post_id,'total_booking', true);
|
||||
$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($book_count){ $total_book = $book_count; }else{ $total_book = 0; }
|
||||
|
||||
if(array_key_exists('mep_rsv_seat', $event_meta)){
|
||||
$simple_rsv = $event_meta['mep_rsv_seat'][0];
|
||||
}else{
|
||||
$simple_rsv = '';
|
||||
}
|
||||
if($simple_rsv){
|
||||
$simple_rsv = $simple_rsv;
|
||||
}else{
|
||||
$simple_rsv = 0;
|
||||
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));
|
||||
}
|
||||
$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);
|
||||
|
||||
$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);
|
||||
$default_timezone_val = get_option('timezone_string') ? get_option('timezone_string') : 'UTC';
|
||||
date_default_timezone_set($default_timezone_val);
|
||||
|
||||
if(array_key_exists('mep_reg_status', $event_meta)){
|
||||
$reg_status = $event_meta['mep_reg_status'][0];
|
||||
}else{
|
||||
$reg_status = '';
|
||||
}
|
||||
$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'){
|
||||
|
||||
if (is_array($mep_event_ticket_type) || is_object($mep_event_ticket_type)){
|
||||
foreach ($mep_event_ticket_type as $field ) {
|
||||
$qm = $field['option_name_t'];
|
||||
}
|
||||
}else{$qm='';}
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
|
||||
if(strtotime(current_time('Y-m-d H:i:s')) > strtotime($newformat)){
|
||||
?>
|
||||
<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'); ?>
|
||||
</span>
|
||||
<?php
|
||||
} elseif($seat_left<=0){
|
||||
?>
|
||||
<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
|
||||
do_action('mep_after_no_seat_notice');
|
||||
|
||||
}else{
|
||||
|
||||
if(array_key_exists('mep_rsv_seat', $event_meta)){
|
||||
$simple_rsv = $event_meta['mep_rsv_seat'][0];
|
||||
}else{
|
||||
$simple_rsv = '';
|
||||
}
|
||||
if($simple_rsv){
|
||||
$simple_rsv = $simple_rsv;
|
||||
}else{
|
||||
$simple_rsv = 0;
|
||||
}
|
||||
$total_book = ($total_book + $simple_rsv);
|
||||
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
|
||||
|
||||
if(array_key_exists('mep_available_seat', $event_meta)){
|
||||
$mep_available_seat = $event_meta['mep_available_seat'][0];
|
||||
}else{
|
||||
$mep_available_seat = 'on';
|
||||
}
|
||||
|
||||
$leftt = apply_filters( 'mep_event_total_seat_count', $total_left, get_the_id() );
|
||||
$days = $interval->d;
|
||||
$hours = $interval->h;
|
||||
$minutes = $interval->i;
|
||||
if($days>0){ $dd = $days." days "; }else{ $dd=""; }
|
||||
if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; }
|
||||
if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; }
|
||||
|
||||
|
||||
$qty_typec = $event_meta['qty_box_type'][0];
|
||||
|
||||
?>
|
||||
<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>
|
||||
<form action="" method='post' id="mage_event_submit">
|
||||
<?php
|
||||
do_action('mep_event_ticket_type_extra_service');
|
||||
|
||||
if($leftt>0){
|
||||
/**
|
||||
* 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 ....
|
||||
*/
|
||||
?>
|
||||
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id,"_price",true); ?>"/>
|
||||
<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');
|
||||
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true);
|
||||
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
|
||||
}else{
|
||||
if($event_sqi==1){
|
||||
$qmx = $leftt;
|
||||
if($qty_typec=='dropdown'){ ?>
|
||||
<select name="quantity" id="quantity_5a7abbd1bff73" class='input-text qty text extra-qty-box'>
|
||||
<?php for ($i = 1; $i <= $qmx; $i++) { ?>
|
||||
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php }else{ ?>
|
||||
<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="number">
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
echo 1;
|
||||
?>
|
||||
<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">
|
||||
<!-- 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');
|
||||
?>
|
||||
<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
|
||||
}
|
||||
?>
|
||||
<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'); ?>">
|
||||
<!-- <p class="mep_no_tickt_notice" id="mep_btn_notice">-->
|
||||
<!-- --><?php //echo mep_get_option('mep_no_ticket_selected_text', 'label_setting_sec') ? mep_get_option('mep_no_ticket_selected_text', 'label_setting_sec') : _e('No Ticket Selected!','mage-eventpress'); ?>
|
||||
<!-- </p>-->
|
||||
<?php
|
||||
$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);
|
||||
?>
|
||||
<button type="submit" name="add-to-cart" value="<?php echo $cart_product_id; //echo esc_attr($post_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>
|
||||
<?php
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
if(!$mep_event_ticket_type){
|
||||
if($qm){$qm=$qm;}else{$qm='';}
|
||||
?><?php do_action('mep_single_page_reg'); ?><?php }
|
||||
|
||||
}
|
||||
?>
|
||||
</form><?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -225,298 +144,133 @@ 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;
|
||||
$post_id = $post->ID;
|
||||
$event_meta = get_post_custom($post_id);
|
||||
$event_expire_date = $event_meta[mep_get_option( 'mep_event_expire_on_datetime', 'general_setting_sec', 'event_start_date' )][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]);
|
||||
$event_ecternal_link = '';
|
||||
$book_count = get_post_meta($post_id,'total_booking', true);
|
||||
|
||||
$post_id = $post->ID;
|
||||
$event_meta = get_post_custom($post_id);
|
||||
$event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime');
|
||||
$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($book_count){ $total_book = $book_count; }else{ $total_book = 0; }
|
||||
|
||||
if(array_key_exists('mep_rsv_seat', $event_meta)){
|
||||
$simple_rsv = $event_meta['mep_rsv_seat'][0];
|
||||
}else{
|
||||
$simple_rsv = '';
|
||||
}
|
||||
if($simple_rsv){
|
||||
$simple_rsv = $simple_rsv;
|
||||
}else{
|
||||
$simple_rsv = 0;
|
||||
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));
|
||||
}
|
||||
$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);
|
||||
|
||||
$stc = 0;
|
||||
$leftt = 0;
|
||||
if (is_array($mep_event_ticket_type) || is_object($mep_event_ticket_type)){
|
||||
foreach ($mep_event_ticket_type as $field ) {
|
||||
$qm = $field['option_name_t'];
|
||||
$opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
|
||||
// $opt_rst_qty = $field['option_rsv_t'] ? $field['option_rsv_t'] : 0;
|
||||
$tesqn = $post_id.str_replace(' ', '', $qm);
|
||||
$tesq = get_post_meta($post_id,"mep_xtra_$tesqn",true);
|
||||
$stc = $stc+$opt_qty;
|
||||
$llft = ($opt_qty - (int)$tesq);
|
||||
$leftt = $leftt+$llft;
|
||||
}
|
||||
}else{$qm='';}
|
||||
if($mep_event_ticket_type){
|
||||
$seat_left = $leftt;
|
||||
}else{
|
||||
$seat_left = $seat_left;
|
||||
}
|
||||
$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);
|
||||
|
||||
|
||||
$current = current_time('Y-m-d H:i:s');
|
||||
$time = strtotime($event_expire_date);
|
||||
$newformat = date('Y-m-d H:i:s',$time);
|
||||
|
||||
date_default_timezone_set(get_option('timezone_string'));
|
||||
|
||||
$datetime1 = new DateTime($newformat);
|
||||
$datetime2 = new DateTime($current);
|
||||
|
||||
$interval = date_diff($datetime2, $datetime1);
|
||||
|
||||
// $days = $interval->days;
|
||||
// $hours = $interval->h;
|
||||
// $minutes = $interval->i;
|
||||
// if($days>0){ $dd = $days." days "; }else{ $dd=""; }
|
||||
// if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; }
|
||||
// if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; }
|
||||
// echo "<span class='active'>$dd $hh $mm</span>";
|
||||
|
||||
|
||||
|
||||
if(time() > strtotime($newformat)){
|
||||
?>
|
||||
<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('Event Expired','mage-eventpress'); ?>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
elseif($seat_left<=0){
|
||||
?>
|
||||
<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');
|
||||
}
|
||||
else{
|
||||
|
||||
if(array_key_exists('mep_rsv_seat', $event_meta)){
|
||||
$simple_rsv = $event_meta['mep_rsv_seat'][0];
|
||||
}else{
|
||||
$simple_rsv = '';
|
||||
}
|
||||
if($simple_rsv){
|
||||
$simple_rsv = $simple_rsv;
|
||||
}else{
|
||||
$simple_rsv = 0;
|
||||
}
|
||||
$total_book = ($total_book + $simple_rsv);
|
||||
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
|
||||
|
||||
if(array_key_exists('mep_available_seat', $event_meta)){
|
||||
$mep_available_seat = $event_meta['mep_available_seat'][0];
|
||||
}else{
|
||||
$mep_available_seat = 'on';
|
||||
}
|
||||
|
||||
if($mep_event_ticket_type){
|
||||
|
||||
$stc = 0;
|
||||
$leftt = 0;
|
||||
$res = 0;
|
||||
|
||||
foreach ( $mep_event_ticket_type as $field ) {
|
||||
$qm = $field['option_name_t'];
|
||||
$opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
|
||||
$opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
|
||||
$tesqn = $post->ID.str_replace(' ', '', $qm);
|
||||
$tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true);
|
||||
$stc = $stc+$opt_qty;
|
||||
$res = $res + (int)$opt_rst_qty;
|
||||
$res = (int)$res;
|
||||
$llft = ($opt_qty - (int)$tesq);
|
||||
$leftt = ($leftt+$llft);
|
||||
}
|
||||
$leftt = $leftt-$res;
|
||||
}else{
|
||||
$leftt = $event_meta['mep_total_seat'][0]- $total_book;
|
||||
}
|
||||
|
||||
$days = $interval->d;
|
||||
$hours = $interval->h;
|
||||
$minutes = $interval->i;
|
||||
if($days>0){ $dd = $days." days "; }else{ $dd=""; }
|
||||
if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; }
|
||||
if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; }
|
||||
|
||||
|
||||
$qty_typec = $event_meta['qty_box_type'][0];
|
||||
if(array_key_exists('mep_reg_status', $event_meta)){
|
||||
$reg_status = $event_meta['mep_reg_status'][0];
|
||||
}else{
|
||||
$reg_status = '';
|
||||
}
|
||||
/**
|
||||
* First Checking If the registration status enable or disable
|
||||
*/
|
||||
if($reg_status!='off'){
|
||||
?>
|
||||
<!-- <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> -->
|
||||
<form action="" method='post'>
|
||||
<?php
|
||||
|
||||
if(array_key_exists('mep_rsv_seat', $event_meta)){
|
||||
$simple_rsv = $event_meta['mep_rsv_seat'][0];
|
||||
}else{
|
||||
$simple_rsv = '';
|
||||
}
|
||||
if($simple_rsv){
|
||||
$simple_rsv = $simple_rsv;
|
||||
}else{
|
||||
$simple_rsv = 0;
|
||||
}
|
||||
$total_book = ($total_book + $simple_rsv);
|
||||
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
|
||||
|
||||
if(array_key_exists('mep_available_seat', $event_meta)){
|
||||
$mep_available_seat = $event_meta['mep_available_seat'][0];
|
||||
}else{
|
||||
$mep_available_seat = 'on';
|
||||
}
|
||||
|
||||
if($mep_event_ticket_type){
|
||||
|
||||
$stc = 0;
|
||||
$leftt = 0;
|
||||
$res = 0;
|
||||
|
||||
|
||||
foreach ( $mep_event_ticket_type as $field ) {
|
||||
$qm = $field['option_name_t'];
|
||||
$opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
|
||||
$opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
|
||||
$tesqn = $post->ID.str_replace(' ', '', $qm);
|
||||
|
||||
$tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true);
|
||||
|
||||
$stc = $stc+$opt_qty;
|
||||
|
||||
$res = $res + (int)$opt_rst_qty;
|
||||
|
||||
$res = (int)$res;
|
||||
|
||||
|
||||
$llft = ($opt_qty - (int)$tesq);
|
||||
$leftt = ($leftt+$llft);
|
||||
}
|
||||
$leftt = $leftt-$res;
|
||||
|
||||
}else{
|
||||
$leftt = $event_meta['mep_total_seat'][0]- $total_book;
|
||||
}
|
||||
|
||||
|
||||
if($leftt>0){
|
||||
|
||||
do_action('mep_event_ticket_types_list');
|
||||
do_action('mep_event_extra_service_list');
|
||||
|
||||
}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>
|
||||
<?php
|
||||
do_action('mep_after_no_seat_notice');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($leftt>0){
|
||||
/**
|
||||
* 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 ....
|
||||
*/
|
||||
?>
|
||||
<input type='hidden' id='rowtotal_<?php echo get_the_id(); ?>' value="<?php echo get_post_meta($post_id,"_price",true); ?>"/>
|
||||
<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');
|
||||
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true);
|
||||
if($mep_event_ticket_type){ ?>
|
||||
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box_<?php echo get_the_id(); ?>" step="1" min="1" max="<?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
|
||||
<span id="ttyttl_<?php echo get_the_id(); ?>"></span>
|
||||
<?php
|
||||
}else{
|
||||
if($event_sqi==1){
|
||||
$qmx = ($event_meta['mep_total_seat'][0]- $total_book);
|
||||
if($qty_typec=='dropdown'){ ?>
|
||||
<select name="quantity" id="quantity_5a7abbd1bff73" class='input-text qty text extra-qty-box_<?php echo get_the_id(); ?>'>
|
||||
<?php for ($i = 1; $i <= $qmx; $i++) { ?>
|
||||
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php }else{ ?>
|
||||
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box_<?php echo get_the_id(); ?>" step="1" min="1" max="<?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="number">
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
echo 1;
|
||||
?>
|
||||
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box_<?php echo get_the_id(); ?>" step="1" min="1" max="<?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?>" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
|
||||
<!-- 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
|
||||
}
|
||||
}
|
||||
?>
|
||||
<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_<?php echo get_the_id(); ?>"></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'); ?>">
|
||||
<p class="mep_no_tickt_notice" id="mep_btn_notice_<?php echo get_the_id(); ?>">
|
||||
<?php echo mep_get_option('mep_no_ticket_selected_text', 'label_setting_sec') ? mep_get_option('mep_no_ticket_selected_text', 'label_setting_sec') : _e('No Ticket Selected!','mage-eventpress'); ?>
|
||||
</p>
|
||||
<button type="submit" name="add-to-cart" value="<?php echo esc_attr($post_id); ?>" class="single_add_to_cart_button button alt btn-mep-event-cart_<?php echo get_the_id(); ?>">
|
||||
<?php _e(mep_get_label($post_id,'mep_cart_btn_text','Register This Event'),'mage-eventpress'); ?>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
if(!$mep_event_ticket_type){
|
||||
if($qm){$qm=$qm;}else{$qm='';}
|
||||
?><?php do_action('mep_single_page_reg'); ?><?php } } ?>
|
||||
</form><?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // End Of checking Registration status
|
||||
}
|
|
@ -1,27 +1,20 @@
|
|||
<?php
|
||||
add_action('mep_event_date', 'mep_ev_datetime');
|
||||
function 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];
|
||||
|
||||
if (array_key_exists('mep_event_more_date', $event_meta)) {
|
||||
$more_date = unserialize($event_meta['mep_event_more_date'][0]);
|
||||
} else {
|
||||
$more_date = array();
|
||||
}
|
||||
|
||||
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
|
||||
$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;
|
||||
$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) {
|
||||
|
@ -67,7 +60,6 @@ function mep_ev_datetime()
|
|||
}
|
||||
|
||||
} 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') . ' - ';
|
||||
|
@ -75,48 +67,36 @@ function mep_ev_datetime()
|
|||
echo get_mep_datetime($end_datetime, 'time'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
add_action('mep_event_date_default_theme', 'mep_date_in_default_theme');
|
||||
|
||||
add_action('mep_event_date_default_theme', 'mep_date_in_default_theme');
|
||||
function mep_date_in_default_theme(){
|
||||
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_date = $event_meta['event_end_date'][0];
|
||||
$end_time = $event_meta['event_end_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';
|
||||
$cn = 1;
|
||||
|
||||
if (array_key_exists('mep_event_more_date', $event_meta)) {
|
||||
$more_date = unserialize($event_meta['mep_event_more_date'][0]);
|
||||
} else {
|
||||
$more_date = array();
|
||||
}
|
||||
$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(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;
|
||||
$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 _e('Event Schedule Details', 'mage-eventpress'); ?></h3>
|
||||
<?php
|
||||
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) {
|
||||
|
|
|
@ -1,37 +1,34 @@
|
|||
<?php
|
||||
add_action('mep_event_details','mep_ev_details');
|
||||
|
||||
|
||||
function mep_ev_details(){
|
||||
global $post, $event_meta;
|
||||
// the_content();
|
||||
|
||||
$content_event = get_post($post->ID);
|
||||
$content = $content_event->post_content;
|
||||
$content = apply_filters('the_content', $content);
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
echo $content;
|
||||
|
||||
$mep_event_day = get_post_meta($post->ID, 'mep_event_day', true);
|
||||
|
||||
if ( $mep_event_day ){
|
||||
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
|
||||
|
||||
}
|
||||
echo '</div>';
|
||||
global $post, $event_meta;
|
||||
$content_event = get_post($post->ID);
|
||||
$content = $content_event->post_content;
|
||||
$content = apply_filters('the_content', $content);
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
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;
|
||||
$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">';
|
||||
?>
|
||||
<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>';
|
||||
}
|
||||
}
|
|
@ -1,15 +1,13 @@
|
|||
<?php
|
||||
|
||||
add_action('mep_event_extra_service', 'mep_ev_extra_serv');
|
||||
|
||||
function mep_ev_extra_serv()
|
||||
{
|
||||
function mep_ev_extra_serv(){
|
||||
global $post, $product;
|
||||
$pid = $post->ID;
|
||||
$count = 1;
|
||||
|
||||
$mep_events_extra_prices = get_post_meta($post->ID, 'mep_events_extra_prices', true);
|
||||
if ($mep_events_extra_prices) {
|
||||
$pid = $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($pid, 'mep_event_extra_service_text', 'Extra Service:') . "</h3>";
|
||||
?>
|
||||
<table>
|
||||
|
@ -29,18 +27,14 @@ function mep_ev_extra_serv()
|
|||
<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'); ?>
|
||||
|
||||
<?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>
|
||||
</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;
|
||||
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>
|
||||
|
@ -52,8 +46,7 @@ function mep_ev_extra_serv()
|
|||
<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>
|
||||
|
||||
</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');
|
||||
|
@ -70,10 +63,11 @@ function mep_ev_extra_serv()
|
|||
<?php
|
||||
$count++;
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_extra_service_list', $content,$pid,$event_meta);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
add_action('mep_event_expire_text','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'); ?>
|
||||
</span>
|
||||
<?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(){
|
||||
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
|
||||
echo ob_get_clean();
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?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);
|
||||
}
|
||||
|
||||
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>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_organization_name_filter_list', $content);
|
||||
}
|
|
@ -3,35 +3,33 @@ add_action('mep_event_location','mep_ev_location');
|
|||
add_action('mep_event_location_ticket','mep_ev_location_ticket');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function mep_ev_location_cart($event_id,$event_meta){
|
||||
$location_sts = get_post_meta($event_id,'mep_org_address',true);
|
||||
$location_sts = get_post_meta($event_id,'mep_org_address',true) ? get_post_meta($event_id,'mep_org_address',true) : '';
|
||||
ob_start();
|
||||
if($location_sts){
|
||||
$org_arr = get_the_terms( $event_id, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
|
||||
echo get_term_meta( $org_id, 'org_location', true ); ?>,<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_state', true )){ echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
|
||||
}else{
|
||||
?>
|
||||
<?php echo $event_meta['mep_location_venue'][0]; ?>, <?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>, <?php } if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>, <?php } if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>, <?php } if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>, <?php } if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
|
||||
|
||||
$org_arr = get_the_terms( $event_id, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
echo get_term_meta( $org_id, 'org_location', true ); ?>,<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_state', true )){ echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
|
||||
}else{
|
||||
echo $event_meta['mep_location_venue'][0]; ?>, <?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>, <?php } if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>, <?php } if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>, <?php } if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>, <?php } if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
|
||||
}
|
||||
|
||||
|
||||
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_location_in_cart', $content,$event_id,$event_meta);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function mep_ev_location_ticket($event_id,$event_meta){
|
||||
$location_sts = get_post_meta($event_id,'mep_org_address',true);
|
||||
$location_sts = get_post_meta($event_id,'mep_org_address',true) ? get_post_meta($event_id,'mep_org_address',true) : '';
|
||||
ob_start();
|
||||
if($location_sts){
|
||||
$org_arr = get_the_terms( $event_id, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
$org_arr = get_the_terms( $event_id, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
?>
|
||||
<?php echo get_term_meta( $org_id, 'org_location', true ); ?>,
|
||||
<?php echo get_term_meta( $org_id, 'org_location', true ); ?>,
|
||||
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } ?>
|
||||
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } ?>
|
||||
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <?php echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } ?>
|
||||
|
@ -47,14 +45,15 @@ $org_id = $org_arr[0]->term_id;
|
|||
<?php if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
|
||||
|
||||
}
|
||||
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_location_in_ticket', $content,$event_id,$event_meta);
|
||||
}
|
||||
|
||||
|
||||
function mep_ev_location(){
|
||||
global $post,$event_meta;
|
||||
|
||||
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
|
||||
$location_sts = get_post_meta($post->ID,'mep_org_address',true) ? get_post_meta($post->ID,'mep_org_address',true) : '';
|
||||
ob_start();
|
||||
if($location_sts){
|
||||
$org_arr = get_the_terms( $post->ID, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
|
@ -75,7 +74,8 @@ $org_id = $org_arr[0]->term_id;
|
|||
<?php if($event_meta['mep_country'][0]){ ?> <p><?php echo $event_meta['mep_country'][0]; ?></p> <?php }
|
||||
|
||||
}
|
||||
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_location_content', $content,$post->ID,$event_meta);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
<?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');
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class='<?php echo $columnNumber; ?> mep_event_<?php echo $style; ?>_item mix <?php if ($tt) { echo $org_class; } ?> <?php if ($torg) { echo $cat_class; } ?>'>
|
||||
<div class="mep_list_thumb">
|
||||
<a href="<?php echo get_the_permalink($event_id); ?>"><?php echo get_the_post_thumbnail($event_id,'full'); ?></a>
|
||||
<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 } ?>
|
||||
</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 } ?>
|
||||
|
||||
<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 ($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 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 mep_get_only_time($event_meta['event_start_time'][0]);
|
||||
if ($hide_only_end_time_list == 'no') { ?> - <?php mep_get_only_time($event_meta['event_end_time'][0]);
|
||||
} ?></h6>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_loop_list_shortcode', $content, $event_id);
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
add_action('mep_event_faq', 'mep_faq_part');
|
||||
function mep_faq_part()
|
||||
{
|
||||
function mep_faq_part(){
|
||||
global $post;
|
||||
$mep_event_faq = get_post_meta($post->ID, 'mep_event_faq', true);
|
||||
ob_start();
|
||||
$mep_event_faq = get_post_meta($post->ID, 'mep_event_faq', true) ? get_post_meta($post->ID, 'mep_event_faq', true) : '';
|
||||
if ($mep_event_faq) {
|
||||
?>
|
||||
<div class="mep-event-faq-part">
|
||||
|
@ -21,4 +21,7 @@ function mep_faq_part()
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_faq_list', $content,$post->ID);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
add_action('mep_event_map','ggmap');
|
||||
function ggmap(){
|
||||
add_action('mep_event_map','mep_event_google_map');
|
||||
function mep_event_google_map(){
|
||||
global $post,$event_meta,$user_api;
|
||||
$map_type = mep_get_option( 'mep_google_map_type', 'general_setting_sec', 'iframe');
|
||||
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
|
||||
|
||||
|
||||
$map_type = mep_get_option( 'mep_google_map_type', 'general_setting_sec', 'iframe');
|
||||
$location_sts = get_post_meta($post->ID,'mep_org_address',true) ? get_post_meta($post->ID,'mep_org_address',true) : '';
|
||||
ob_start();
|
||||
do_action('mep_event_before_google_map');
|
||||
if($location_sts){
|
||||
$org_arr = get_the_terms( $post->ID, 'mep_org' );
|
||||
$org_id = $org_arr[0]->term_id;
|
||||
|
@ -62,4 +62,11 @@ if($map_type=='iframe'){
|
|||
</script>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $user_api; ?>&callback=initMap"
|
||||
async defer></script>
|
||||
<?php } } } }?>
|
||||
<?php } } }
|
||||
|
||||
do_action('mep_event_after_google_map');
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_google_map', $content,$post->ID);
|
||||
|
||||
|
||||
}?>
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
add_action('mep_event_organizer','mep_ev_org');
|
||||
|
||||
|
||||
function mep_ev_org(){
|
||||
global $author_terms;
|
||||
|
||||
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 }
|
||||
}
|
||||
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);
|
||||
}
|
|
@ -1,16 +1,14 @@
|
|||
<?php
|
||||
add_action('mep_event_price','mep_ev_price');
|
||||
|
||||
|
||||
function mep_ev_price(){
|
||||
global $event_meta;
|
||||
if($event_meta['_price'][0]>0){
|
||||
if($event_meta['mep_price_label'][0]){
|
||||
?>
|
||||
<h3><?php echo $event_meta['mep_price_label'][0]; ?>: </h3>
|
||||
<?php }
|
||||
echo wc_price($event_meta['_price'][0]);
|
||||
|
||||
?>
|
||||
<?php } else{ echo ''; }
|
||||
global $post,$event_meta;
|
||||
ob_start();
|
||||
if($event_meta['_price'][0]>0){
|
||||
if($event_meta['mep_price_label'][0]){ ?>
|
||||
<h3><?php echo $event_meta['mep_price_label'][0]; ?>: </h3>
|
||||
<?php }
|
||||
echo wc_price($event_meta['_price'][0]);
|
||||
}
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_single_price', $content,$post->ID);
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
add_action('mep_event_social_share', 'mep_ev_social_share');
|
||||
|
||||
|
||||
function mep_ev_social_share()
|
||||
{
|
||||
global $post;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -14,4 +14,7 @@ require_once(dirname(__FILE__) . "/event_add_cart.php");
|
|||
require_once(dirname(__FILE__) . "/event_ticket_type_extra_service.php");
|
||||
require_once(dirname(__FILE__) . "/event_ticket_type.php");
|
||||
require_once(dirname(__FILE__) . "/event_extra_service.php");
|
||||
require_once(dirname(__FILE__) . "/faq.php");
|
||||
require_once(dirname(__FILE__) . "/faq.php");
|
||||
require_once(dirname(__FILE__) . "/event_labels.php");
|
||||
require_once(dirname(__FILE__) . "/event_list_tax_name_list.php");
|
||||
require_once(dirname(__FILE__) . "/event_loop_list.php");
|
|
@ -1,11 +1,13 @@
|
|||
<?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);
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
add_action('mep_event_title','mep_ev_title');
|
||||
function mep_ev_title(){
|
||||
global $post;
|
||||
ob_start();
|
||||
?>
|
||||
<h2><?php the_title(); ?></h2>
|
||||
<h2><?php the_title(); ?></h2>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
echo apply_filters('mage_event_single_title', $content,$post->ID);
|
||||
}
|
||||
|
|
|
@ -2,22 +2,24 @@
|
|||
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';
|
||||
if($recurring == 'no'){
|
||||
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
|
||||
if(array_key_exists('mep_available_seat', $event_meta)){
|
||||
$mep_available_seat = $event_meta['mep_available_seat'][0];
|
||||
}else{
|
||||
$mep_available_seat = 'on';
|
||||
}
|
||||
if($mep_event_ticket_type){
|
||||
$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
|
||||
}
|
||||
}
|
||||
$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);
|
||||
}
|
Loading…
Reference in New Issue