} } else { if ($action == 'calendar') { } } } } } } } } else { exit; } } get_header(); $options = wpestate_page_details($post->ID); /////////////////////////////////////////////////////////////////////////////////////////// /////// Html Form Code below /////////////////////////////////////////////////////////////////////////////////////////// ?> <div id="cover"></div> <div class="row is_dashboard"> <?php if (wpestate_check_if_admin_page($post->ID)) { if (is_user_logged_in()) { get_template_part('templates/user_menu'); } } ?>
function wpestate_ajax_filter_listings_search_onthemap() { global $post; global $current_user; global $options; global $show_compare_only; global $currency; global $where_currency; global $listing_type; $listing_type = get_option('wp_estate_listing_unit_type', ''); $show_compare_only = 'no'; get_currentuserinfo(); $userID = $current_user->ID; $user_option = 'favorites' . $userID; $curent_fav = get_option($user_option); $currency = esc_html(get_option('wp_estate_currency_symbol', '')); $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', '')); $area_array = ''; $city_array = ''; $action_array = ''; $categ_array = ''; $options = wpestate_page_details(intval($_POST['postid'])); $allowed_html = array(); ////////////////////////////////////////////////////////////////////////////////////// ///// category filters ////////////////////////////////////////////////////////////////////////////////////// if (isset($_POST['category_values']) && trim($_POST['category_values']) != 'all') { $taxcateg_include = sanitize_title(wp_kses($_POST['category_values'], $allowed_html)); $categ_array = array('taxonomy' => 'property_category', 'field' => 'slug', 'terms' => $taxcateg_include); } ////////////////////////////////////////////////////////////////////////////////////// ///// action filters ////////////////////////////////////////////////////////////////////////////////////// if (isset($_POST['action_values']) && trim($_POST['action_values']) != 'all') { $taxaction_include = sanitize_title(wp_kses($_POST['action_values'], $allowed_html)); $action_array = array('taxonomy' => 'property_action_category', 'field' => 'slug', 'terms' => $taxaction_include); } ////////////////////////////////////////////////////////////////////////////////////// ///// city filters ////////////////////////////////////////////////////////////////////////////////////// if (isset($_POST['city']) && trim($_POST['city']) != 'all' && $_POST['city'] != '') { $taxcity[] = sanitize_title(wp_kses($_POST['city'], $allowed_html)); $city_array = array('taxonomy' => 'property_city', 'field' => 'slug', 'terms' => $taxcity); } if (isset($_POST['area']) && trim($_POST['area']) != 'all' && $_POST['area'] != '') { $taxarea[] = sanitize_title(wp_kses($_POST['area'], $allowed_html)); $area_array = array('taxonomy' => 'property_area', 'field' => 'slug', 'terms' => $taxarea); } $meta_query = $rooms = $baths = $price = array(); if (isset($_POST['advanced_rooms']) && is_numeric($_POST['advanced_rooms']) && intval($_POST['advanced_rooms'] != 0)) { $rooms['key'] = 'property_rooms'; $rooms['value'] = floatval($_POST['advanced_rooms']); $meta_query[] = $rooms; } if (isset($_POST['advanced_bath']) && is_numeric($_POST['advanced_bath']) && intval($_POST['advanced_bath'] != 0)) { $baths['key'] = 'property_bathrooms'; $baths['value'] = floatval($_POST['advanced_bath']); $meta_query[] = $baths; } if (isset($_POST['advanced_beds']) && is_numeric($_POST['advanced_beds']) && intval($_POST['advanced_beds'] != 0)) { $beds['key'] = 'property_bedrooms'; $beds['value'] = floatval($_POST['advanced_beds']); $meta_query[] = $beds; } if (isset($_POST['guest_no']) && is_numeric($_POST['guest_no']) && intval($_POST['guest_no']) != 0) { $guest['key'] = 'guest_no'; $guest['value'] = floatval($_POST['guest_no']); $guest['type'] = 'numeric'; $guest['compare'] = '>='; $meta_query[] = $guest; } $country_array = array(); if (isset($_POST['country']) && $_POST['country'] != '') { $country = wp_kses($_POST['country'], $allowed_html); $country = str_replace('-', ' ', $country); $country_array['key'] = 'property_country'; $country_array['value'] = $country; $country_array['type'] = 'CHAR'; $country_array['compare'] = 'LIKE'; $meta_query[] = $country_array; } ////////////////////////////////////////////////////////////////////////////////////// ///// chekcers ////////////////////////////////////////////////////////////////////////////////////// $all_checkers = explode(",", $_POST['all_checkers']); foreach ($all_checkers as $cheker) { if ($cheker != '') { $check_array = array(); $check_array['key'] = $cheker; $check_array['value'] = 1; $check_array['compare'] = 'CHAR'; $meta_query[] = $check_array; } } ////////////////////////////////////////////////////////////////////////////////////// ///// price filters ////////////////////////////////////////////////////////////////////////////////////// $price_low = ''; if (isset($_POST['price_low'])) { $price_low = intval($_POST['price_low']); } $price_max = ''; if (isset($_POST['price_max']) && is_numeric($_POST['price_max'])) { $price_max = intval($_POST['price_max']); $price['key'] = 'property_price'; $custom_fields = get_option('wp_estate_multi_curr', true); if (!empty($custom_fields) && isset($_COOKIE['my_custom_curr']) && isset($_COOKIE['my_custom_curr_pos']) && isset($_COOKIE['my_custom_curr_symbol']) && $_COOKIE['my_custom_curr_pos'] != -1) { $i = intval($_COOKIE['my_custom_curr_pos']); if ($price_low != 0) { $price_low = $price_low / $custom_fields[$i][2]; } if ($price_max != 0) { $price_max = $price_max / $custom_fields[$i][2]; } } $price['value'] = array($price_low, $price_max); $price['type'] = 'numeric'; $price['compare'] = 'BETWEEN'; $meta_query[] = $price; } ////////////////////////////////////////////////////////////////////////////////////// ///// calendar filters ////////////////////////////////////////////////////////////////////////////////////// $allowed_html = array(); $book_from = ''; $book_to = ''; if (isset($_POST['check_in'])) { $book_from = wp_kses($_POST['check_in'], $allowed_html); } if (isset($_POST['check_out'])) { $book_to = wp_kses($_POST['check_out'], $allowed_html); } ////////////////////////////////////////////////////////////////////////////////////// ///// order details ////////////////////////////////////////////////////////////////////////////////////// $meta_order = 'prop_featured'; $meta_directions = 'DESC'; if (isset($_POST['order'])) { $order = wp_kses($_POST['order'], $allowed_html); switch ($order) { case 1: $meta_order = 'property_price'; $meta_directions = 'DESC'; break; case 2: $meta_order = 'property_price'; $meta_directions = 'ASC'; break; case 3: $meta_order = 'property_size'; $meta_directions = 'DESC'; break; case 4: $meta_order = 'property_size'; $meta_directions = 'ASC'; break; case 5: $meta_order = 'property_bedrooms'; $meta_directions = 'DESC'; break; case 6: $meta_order = 'property_bedrooms'; $meta_directions = 'ASC'; break; } } $paged = intval($_POST['newpage']); $prop_no = intval(get_option('wp_estate_prop_no', '')); //////////////////////////////////////////////////////////////////////////// // if we have check in and check out dates we need to double loop //////////////////////////////////////////////////////////////////////////// if ($book_from != '' && $book_from != '') { $args = array('cache_results' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'post_type' => 'estate_property', 'post_status' => 'publish', 'posts_per_page' => '-1', 'meta_key' => 'prop_featured', 'orderby' => 'meta_value', 'meta_query' => $meta_query, 'tax_query' => array('relation' => 'AND', $categ_array, $action_array, $city_array, $area_array)); $prop_selection = new WP_Query($args); $right_array = array(); $right_array[] = 0; while ($prop_selection->have_posts()) { $prop_selection->the_post(); // print '</br>we check '.$post->ID.'</br>'; if (wpestate_check_booking_valability($book_from, $book_to, $post->ID)) { $right_array[] = $post->ID; } } wp_reset_postdata(); $args = array('cache_results' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'post_type' => 'estate_property', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => $prop_no, 'post__in' => $right_array); //print_r($args); $prop_selection = new WP_Query($args); } else { $args = array('cache_results' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'post_type' => 'estate_property', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => $prop_no, 'meta_key' => 'prop_featured', 'orderby' => 'meta_value', 'meta_query' => $meta_query, 'tax_query' => array('relation' => 'AND', $categ_array, $action_array, $city_array, $area_array)); $prop_selection = new WP_Query($args); } $counter = 0; $compare_submit = wpestate_get_compare_link(); $markers = array(); $return_string = ''; ob_start(); print '<span id="scrollhere"></span>'; /* if( !is_tax() ){ print '<div class="compare_ajax_wrapper">'; get_template_part('templates/compare_list'); print'</div>'; }*/ $listing_unit_style_half = get_option('wp_estate_listing_unit_style_half', ''); if ($prop_selection->have_posts()) { while ($prop_selection->have_posts()) { $prop_selection->the_post(); if ($listing_unit_style_half == 1) { get_template_part('templates/property_unit_wide'); } else { get_template_part('templates/property_unit'); } $markers[] = wpestate_pin_unit_creation(get_the_ID(), $currency, $where_currency, $counter); } kriesi_pagination_ajax($prop_selection->max_num_pages, $range = 2, $paged, 'pagination_ajax_search_home'); } else { print '<span class="no_results">' . esc_html__("We didn't find any results", "wpestate") . '</>'; } // print '</div>'; $templates = ob_get_contents(); ob_end_clean(); $return_string .= '<div class="half_map_results">' . $prop_selection->found_posts . ' ' . esc_html__(' Results found!', 'wpestate') . '</div>'; $return_string .= $templates; echo json_encode(array('added' => true, 'arguments' => json_encode($args), 'markers' => json_encode($markers), 'response' => $return_string)); die; }
<?php // Archive // Wp Estate Pack global $row_number_col; get_header(); $options = wpestate_page_details(''); $unit_class = "col-md-6"; $row_number_col = 6; if ($options['content_class'] == "col-md-12") { $unit_class = "col-md-4"; $row_number_col = 4; } if ('wpestate_message' == get_post_type() || 'wpestate_invoice' == get_post_type() || 'wpestate_booking' == get_post_type()) { exit; } ?> <div class="row content-fixed"> <?php get_template_part('templates/breadcrumbs'); ?> <div class=" <?php print $options['content_class']; ?> "> <h1 class="entry-title"> <?php
function wpestate_recent_posts_pictures($attributes, $content = null) { global $options; global $align; global $align_class; global $post; global $currency; global $where_currency; global $is_shortcode; global $show_compare_only; global $row_number_col; global $row_number; global $curent_fav; global $current_user; global $listing_type; $listing_type = get_option('wp_estate_listing_unit_type', ''); get_currentuserinfo(); $userID = $current_user->ID; $user_option = 'favorites' . $userID; $curent_fav = get_option($user_option); $options = wpestate_page_details($post->ID); $return_string = ''; $pictures = ''; $button = ''; $class = ''; $category = $action = $city = $area = ''; $title = ''; $currency = esc_html(get_option('wp_estate_currency_symbol', '')); $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', '')); $is_shortcode = 1; $show_compare_only = 'no'; $row_number_col = ''; $row_number = ''; $show_featured_only = ''; $full_row = ''; $extra_class_name = ''; $random_pick = ''; $orderby = 'meta_value'; if (isset($attributes['title'])) { $title = $attributes['title']; } $attributes = shortcode_atts(array('full_row' => 'yes', 'title' => '', 'type' => 'properties', 'category_ids' => '', 'action_ids' => '', 'city_ids' => '', 'area_ids' => '', 'number' => 4, 'rownumber' => 4, 'align' => 'vertical', 'link' => '', 'show_featured_only' => 'no', 'random_pick' => 'no', 'extra_class_name' => ''), $attributes); if (isset($attributes['category_ids'])) { $category = $attributes['category_ids']; } if (isset($attributes['category_ids'])) { $category = $attributes['category_ids']; } if (isset($attributes['action_ids'])) { $action = $attributes['action_ids']; } if (isset($attributes['city_ids'])) { $city = $attributes['city_ids']; } if (isset($attributes['area_ids'])) { $area = $attributes['area_ids']; } if (isset($attributes['show_featured_only'])) { $show_featured_only = $attributes['show_featured_only']; } if (isset($attributes['full_row'])) { $full_row = $attributes['full_row']; } if (isset($attributes['random_pick'])) { $random_pick = $attributes['random_pick']; if ($random_pick === 'yes') { $orderby = 'rand'; } } if (isset($attributes['extra_class_name'])) { $extra_class_name = $attributes['extra_class_name']; } $post_number_total = $attributes['number']; if (isset($attributes['rownumber'])) { $row_number = $attributes['rownumber']; } // max 4 per row if ($row_number > 5) { $row_number = 5; } if ($row_number == 4 || $row_number == 5) { $row_number_col = 3; // col value is 3 } else { if ($row_number == 3) { $row_number_col = 4; // col value is 4 } else { if ($row_number == 2) { $row_number_col = 6; // col value is 6 } else { if ($row_number == 1) { $row_number_col = 12; // col value is 12 } } } } $align = ''; $align_class = ''; if (isset($attributes['align']) && $attributes['align'] == 'horizontal') { $align = "col-md-12"; $align_class = 'the_list_view'; $row_number_col = '12'; } if ($attributes['type'] == 'properties') { $type = 'estate_property'; $category_array = ''; $action_array = ''; $city_array = ''; $area_array = ''; // build category array if ($category != '') { $category_of_tax = array(); $category_of_tax = explode(',', $category); $category_array = array('taxonomy' => 'property_category', 'field' => 'term_id', 'terms' => $category_of_tax); } // build action array if ($action != '') { $action_of_tax = array(); $action_of_tax = explode(',', $action); $action_array = array('taxonomy' => 'property_action_category', 'field' => 'term_id', 'terms' => $action_of_tax); } // build city array if ($city != '') { $city_of_tax = array(); $city_of_tax = explode(',', $city); $city_array = array('taxonomy' => 'property_city', 'field' => 'term_id', 'terms' => $city_of_tax); } // build city array if ($area != '') { $area_of_tax = array(); $area_of_tax = explode(',', $area); $area_array = array('taxonomy' => 'property_area', 'field' => 'term_id', 'terms' => $area_of_tax); } $meta_query = array(); if ($show_featured_only == 'yes') { $compare_array = array(); $compare_array['key'] = 'prop_featured'; $compare_array['value'] = 1; $compare_array['type'] = 'numeric'; $compare_array['compare'] = '='; $meta_query[] = $compare_array; } $args = array('post_type' => $type, 'post_status' => 'publish', 'paged' => 0, 'posts_per_page' => $post_number_total, 'meta_key' => 'prop_featured', 'orderby' => $orderby, 'order' => 'DESC', 'meta_query' => $meta_query, 'tax_query' => array($category_array, $action_array, $city_array, $area_array)); } else { $type = 'post'; $args = array('post_type' => 'post', 'status' => 'published', 'paged' => 0, 'posts_per_page' => $post_number_total, 'cat' => $category); } if (isset($attributes['link']) && $attributes['link'] != '') { if ($attributes['type'] == 'properties') { $button .= '<div class="listinglink-wrapper"> <a href="' . $attributes['link'] . '"> <span class="wpb_btn-info wpb_btn-small wpestate_vc_button vc_button more_list">' . esc_html__('More Listings', 'wpestate') . ' </span></a> </div>'; } else { $button .= '<div class="listinglink-wrapper"> <a href="' . $attributes['link'] . '"> <span class="wpb_btn-info wpb_btn-small wpestate_vc_button vc_button more_list"> ' . esc_html__('More Articles', 'wpestate') . ' </span></a> </div>'; } } else { $class = "nobutton"; } if ($attributes['type'] == 'properties') { if ($random_pick !== 'yes') { add_filter('posts_orderby', 'wpestate_my_order'); $recent_posts = new WP_Query($args); $count = 1; remove_filter('posts_orderby', 'wpestate_my_order'); } else { $recent_posts = new WP_Query($args); $count = 1; } } else { $recent_posts = new WP_Query($args); $count = 1; } if ($full_row === 'yes') { $return_string .= '<div class=" ' . $extra_class_name . ' " >'; } else { $return_string .= '<div class=" bottom-' . $type . ' ' . $class . ' ' . $extra_class_name . '" >'; if ($title != '') { $return_string .= '<h1 class="shortcode_title">' . $title . '</h1>'; } } ob_start(); print '<div class="items_shortcode_wrapper'; if ($full_row === 'yes') { print ' items_shortcode_wrapper_full '; } print ' ">'; while ($recent_posts->have_posts()) { $recent_posts->the_post(); if ($type == 'estate_property') { if ($full_row === 'yes') { get_template_part('templates/property_unit_full_row'); } else { get_template_part('templates/property_unit'); } } else { if ($full_row === 'yes') { get_template_part('templates/blog_unit_full_row'); } else { get_template_part('templates/blog_unit'); } } } print '</div>'; $templates = ob_get_contents(); ob_end_clean(); $return_string .= $templates; if ($full_row != 'yes') { $return_string .= $button; } $return_string .= '</div>'; wp_reset_query(); $is_shortcode = 0; return $return_string; }
<?php global $agent_id; global $prop_selection; global $comments_data; global $post; $options = wpestate_page_details($agent_id); if (isset($comments_data['coments_no']) && $comments_data['coments_no'] > 0) { ?> <div class=" <?php print $options['content_class']; ?> "> <div class="listing-reviews-wrapper"> <h3 id="listing_reviews" class="panel-title"> <?php print esc_html_e('Reviews', 'wpestate') . '<span class="owner_total_reviews"> (' . $comments_data['coments_no'] . ')</span>'; ?> </h3> <?php print $comments_data['templates']; print '</div>'; print '</div>'; print '<div class=" ' . $options['sidebar_class'] . ' widget-area-sidebar" id="primary" > <ul class="xoxo">'; dynamic_sidebar('owner-page-widget-area'); print '