From c93f1c0035012143d050aed8c584a47e2379499e Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Thu, 19 Mar 2020 12:34:31 +0000 Subject: [PATCH] some file modified --- css/style.css | 2 +- inc/mep_extra_price.php | 184 ++-- inc/mep_file_include.php | 1 + inc/mep_functions.php | 4 +- inc/mep_query.php | 104 +++ inc/mep_shortcode.php | 807 ++++-------------- inc/template-prts/add_calender.php | 10 +- inc/template-prts/event_add_cart.php | 726 ++++++---------- inc/template-prts/event_date.php | 64 +- inc/template-prts/event_details.php | 59 +- inc/template-prts/event_extra_service.php | 32 +- inc/template-prts/event_labels.php | 24 + .../event_list_tax_name_list.php | 50 ++ inc/template-prts/event_location.php | 44 +- inc/template-prts/event_loop_list.php | 108 +++ inc/template-prts/faq.php | 9 +- inc/template-prts/google_map.php | 21 +- inc/template-prts/organizer.php | 12 +- inc/template-prts/price.php | 22 +- inc/template-prts/social_share.php | 10 +- inc/template-prts/templating.php | 5 +- inc/template-prts/thumbnail.php | 8 +- inc/template-prts/title.php | 7 +- inc/template-prts/total_seat.php | 38 +- 24 files changed, 918 insertions(+), 1433 deletions(-) create mode 100644 inc/mep_query.php create mode 100644 inc/template-prts/event_labels.php create mode 100644 inc/template-prts/event_list_tax_name_list.php create mode 100644 inc/template-prts/event_loop_list.php diff --git a/css/style.css b/css/style.css index fd33970..eea629a 100644 --- a/css/style.css +++ b/css/style.css @@ -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;} diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index bc2e0fd..11fac52 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -1,131 +1,79 @@ 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'){ diff --git a/inc/mep_file_include.php b/inc/mep_file_include.php index 24db329..4fa3758 100755 --- a/inc/mep_file_include.php +++ b/inc/mep_file_include.php @@ -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"); \ No newline at end of file diff --git a/inc/mep_functions.php b/inc/mep_functions.php index ea66a3d..3890d97 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.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 ); diff --git a/inc/mep_query.php b/inc/mep_query.php new file mode 100644 index 0000000..255a462 --- /dev/null +++ b/inc/mep_query.php @@ -0,0 +1,104 @@ +'; + + 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; + ?> +
+
$paged, + "total" => $total_page + ); + echo "
" . paginate_links($pargs) . "
"; + ?> +
+
+ +?>
- \ No newline at end of file +ID); + + +}?> \ No newline at end of file diff --git a/inc/template-prts/organizer.php b/inc/template-prts/organizer.php index 377ef11..ccc99a8 100755 --- a/inc/template-prts/organizer.php +++ b/inc/template-prts/organizer.php @@ -1,9 +1,9 @@

name; ?>

name; ?>

ID); +} \ No newline at end of file diff --git a/inc/template-prts/price.php b/inc/template-prts/price.php index 042628a..6e6a9b8 100755 --- a/inc/template-prts/price.php +++ b/inc/template-prts/price.php @@ -1,16 +1,14 @@ 0){ - if($event_meta['mep_price_label'][0]){ - ?> -

:

- - 0){ + if($event_meta['mep_price_label'][0]){ ?> +

:

+ ID); } \ No newline at end of file diff --git a/inc/template-prts/social_share.php b/inc/template-prts/social_share.php index ee35b6e..b1bd745 100755 --- a/inc/template-prts/social_share.php +++ b/inc/template-prts/social_share.php @@ -1,14 +1,14 @@ ID; ?>
ID); } diff --git a/inc/template-prts/templating.php b/inc/template-prts/templating.php index f2e9760..f530353 100755 --- a/inc/template-prts/templating.php +++ b/inc/template-prts/templating.php @@ -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"); \ No newline at end of file +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"); \ No newline at end of file diff --git a/inc/template-prts/thumbnail.php b/inc/template-prts/thumbnail.php index 77c84b6..218bb6e 100755 --- a/inc/template-prts/thumbnail.php +++ b/inc/template-prts/thumbnail.php @@ -1,11 +1,13 @@
ID); +} \ No newline at end of file diff --git a/inc/template-prts/title.php b/inc/template-prts/title.php index 944d72d..a1b2f9f 100755 --- a/inc/template-prts/title.php +++ b/inc/template-prts/title.php @@ -1,8 +1,11 @@ -

+

ID); } diff --git a/inc/template-prts/total_seat.php b/inc/template-prts/total_seat.php index b43a76f..5011307 100755 --- a/inc/template-prts/total_seat.php +++ b/inc/template-prts/total_seat.php @@ -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); - ?> -
( )
- 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); + ?> +
( )
+ ID); } \ No newline at end of file