Ejemplo n.º 1
0
                    echo esc_attr_e('View all ', 'framework');
                    echo esc_attr($additional_specs_all[$this_key]['imic_plugin_specification_values']);
                    ?>
" class="vehicle-body-type"><img src="<?php 
                    echo esc_attr($additional_specs_all[$this_key]['imic_plugin_spec_image']);
                    ?>
" alt=""></a><?php 
                }
                ?>
                                                <span class="vehicle-cost"><?php 
                echo esc_attr($unique_value);
                ?>
</span>
                                                <?php 
                if ($category_rail == "1" && is_plugin_active("imi-classifieds/imi-classified.php")) {
                    echo imic_get_cats_list(get_the_ID(), "list");
                }
                ?>
                                            </div>
                                        </div>
                                    </li>
                                    <?php 
            }
            ?>
                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        
                            </section>
                                    <?php 
Ejemplo n.º 2
0
        _e('View details', 'framework');
        ?>
</a>
                             	</div>
                       		</div>
                       		<div class="result-item-in">
                           		<h4 class="result-item-title"><a href="<?php 
        echo esc_url(get_permalink());
        ?>
"><?php 
        echo esc_attr($highlight_value);
        ?>
</a>
                           		<?php 
        if ($category_rail == "1" && is_plugin_active("imi-classifieds/imi-classified.php")) {
            echo imic_get_cats_list(get_the_ID(), "dropdown");
        }
        ?>
                                </h4>               
                         	<div class="result-item-cont">
                          		<div class="result-item-block col1">
                              	<?php 
        echo imic_excerpt(20);
        ?>
                           		</div>
                          		<div class="result-item-block col2">
                                	<div class="result-item-pricing">
                                   		<div class="price"><?php 
        echo esc_attr($unique_value);
        ?>
</div>
Ejemplo n.º 3
0
function imic_mostviewed($atts, $content = null)
{
    extract(shortcode_atts(array("title" => "", "number" => "5", "view" => '1'), $atts));
    $output = '';
    $starts = 1;
    $most_viewed = array();
    global $imic_options;
    if ($view == 1 || $view == 3) {
        $logged_user_pin = '';
        $user_id = get_current_user_id();
        $logged_user = get_user_meta($user_id, 'imic_user_info_id', true);
        $logged_user_pin = get_post_meta($logged_user, 'imic_user_zip_code', true);
        if ($imic_options['badges_type'] == "0") {
            $badge_ids = isset($imic_options['badge_specs']) ? $imic_options['badge_specs'] : array();
        } else {
            $badge_ids = array();
        }
        $args_cats = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all');
        $classifieds_data = get_option('imic_classifieds');
        $img_src = '';
        $additional_specs = isset($imic_options['additional_specs']) ? $imic_options['additional_specs'] : '';
        $additional_spec_slug = imic_the_slug($additional_specs);
        if ($imic_options['short_specifications'] == 0) {
            $detailed_specs = isset($imic_options['specification_list']) ? $imic_options['specification_list'] : array();
        } else {
            $detailed_specs = array();
        }
        $category_rail = isset($imic_options['category_rail']) ? $imic_options['category_rail'] : '0';
        $browse_listing = imic_get_template_url("template-listing.php");
        $additional_specs_all = get_post_meta($additional_specs, 'specifications_value', true);
        $highlighted_specs = isset($imic_options['highlighted_specs']) ? $imic_options['highlighted_specs'] : array();
        $unique_specs = isset($imic_options['unique_specs']) ? $imic_options['unique_specs'] : '';
        if ($view == 1) {
            $most_viewed = get_option('imic_most_viewed');
            $most_viewed = !empty($most_viewed) ? $most_viewed : array();
        } elseif ($view == 3) {
            $args_cars = array('post_type' => 'yachts', 'orderby' => 'meta_value', 'meta_query' => array('relation' => 'AND', array('key' => 'imic_plugin_ad_payment_status', 'value' => '1', 'compare' => '='), array('key' => 'imic_plugin_listing_end_dt', 'value' => date('Y-m-d'), 'compare' => '>=')), 'meta_key' => 'imic_most_visited', 'order' => 'DESC', 'posts_per_page' => $number);
            $cars_listing = new WP_Query($args_cars);
            if ($cars_listing->have_posts()) {
                while ($cars_listing->have_posts()) {
                    $cars_listing->the_post();
                    $most_viewed[] = get_the_ID();
                }
            }
            wp_reset_postdata();
        }
        if (!empty($most_viewed)) {
            $output .= '<section class="listing-block recent-vehicles">
                	<div class="listing-header">
                    	<h3>' . esc_attr($title) . '</h3>
                    </div>
                    <div class="listing-container">
                        <div class="carousel-wrapper">
                            <div class="row">
                                <ul class="owl-carousel carousel-fw" id="vehicle-slider" data-columns="4" data-autoplay="5000" data-pagination="yes" data-arrows="no" data-single-item="no" data-items-desktop="4" data-items-desktop-small="3" data-items-tablet="2" data-items-mobile="1">';
            foreach ($most_viewed as $most) {
                $listing_status = get_post_status($most);
                if ($listing_status == "publish") {
                    if (is_plugin_active("imi-classifieds/imi-classified.php")) {
                        $badge_ids = imic_classified_badge_specs($most, $badge_ids);
                        $detailed_specs = imic_classified_short_specs($most, $detailed_specs);
                    }
                    $post_author_id = get_post_field('post_author', $most);
                    $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true);
                    $author_role = get_option('blogname');
                    if (!empty($user_info_id)) {
                        $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names"));
                        if (!empty($term_list)) {
                            $author_role = $term_list[0];
                        } else {
                            $author_role = get_option('blogname');
                        }
                    }
                    $specifications = get_post_meta($most, 'feat_data', true);
                    $unique_value = imic_vehicle_price($most, $unique_specs, $specifications);
                    $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $most);
                    $highlighted_specs = $new_highlighted_specs;
                    $highlight_value = imic_vehicle_title($most, $highlighted_specs, $specifications);
                    $highlight_value = $highlight_value != '' ? $highlight_value : get_the_title(get_the_ID());
                    $details_value = imic_vehicle_all_specs($most, $detailed_specs, $specifications);
                    if (!empty($additional_specs)) {
                        $image_key = array_search($additional_specs, $specifications['sch_title']);
                        $additional_specs_value = $specifications['start_time'][$image_key];
                        $this_key = find_car_with_position($additional_specs_all, $additional_specs_value);
                        $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image'];
                    }
                    $badges = imic_vehicle_all_specs($most, $badge_ids, $specifications);
                    $output .= '<li class="item">
            	<div class="vehicle-block format-standard">';
                    if (has_post_thumbnail($most)) {
                        $output .= '<a href="' . esc_url(get_permalink($most)) . '" class="media-box">' . get_the_post_thumbnail($most) . '</a>';
                    }
                    $output .= '<div class="vehicle-block-content">';
                    $start = 1;
                    $badge_position = array('vehicle-age', 'premium-listing', 'third-listing', 'fourth-listing');
                    foreach ($badges as $badge) {
                        $badge_class = $start == 1 ? 'default' : 'success';
                        $output .= '<span class="label label-' . esc_attr($badge_class) . ' ' . esc_attr($badge_position[$start - 1]) . '">' . esc_attr($badge) . '</span>';
                        $start++;
                        if ($start == 4) {
                            break;
                        }
                    }
                    if (!empty($highlight_value)) {
                        $output .= '<h5 class="vehicle-title"><a href="' . esc_url(get_permalink($most)) . '">' . esc_attr($highlight_value) . '</a></h5>';
                    }
                    $output .= '<span class="vehicle-meta">';
                    $total = 1;
                    if (!empty($details_value)) {
                        foreach ($details_value as $value) {
                            $output .= esc_attr($value) . ', ';
                            if ($total++ == 4) {
                                break;
                            }
                        }
                    }
                    $output .= __('by', 'framework') . '
				<abbr class="user-type" title="' . __('Listed by ', 'framework') . esc_attr($author_role) . '">' . esc_attr($author_role) . '</abbr></span>';
                    if ($img_src != '') {
                        $output .= '<a href="' . esc_url(add_query_arg($additional_spec_slug, $additional_specs_all[$this_key]['imic_plugin_specification_values'], $browse_listing)) . '" title="' . __('View all', 'framework') . esc_attr($additional_specs_all[$this_key]['imic_plugin_specification_values']) . '" class="vehicle-body-type"><img src="' . esc_url($additional_specs_all[$this_key]['imic_plugin_spec_image']) . '" alt=""></a>';
                    }
                    $output .= '<span class="vehicle-cost">' . esc_attr($unique_value) . '</span>';
                    if ($category_rail == "1" && is_plugin_active("imi-classifieds/imi-classified.php")) {
                        $output .= imic_get_cats_list($most, "list");
                    }
                    $output .= '</div>
        		</div>
        		</li>';
                    if ($starts == $number) {
                        break;
                    }
                    $starts++;
                }
            }
            $output .= '</ul>
                            </div>
                        </div>
                    </div>
                </section>';
        }
    }
    return $output;
}
Ejemplo n.º 4
0
    function imic_search_result()
    {
        //echo "sai";
        $data = isset($_POST['values']) ? $_POST['values'] : '';
        $paginate = isset($_POST['paginate']) ? $_POST['paginate'] : '';
        $category = isset($_POST['category']) ? $_POST['category'] : '';
        $tags = isset($_POST['tags']) ? $_POST['tags'] : array();
        global $imic_options;
        $arrays = $term_array = $list_terms_ids = $list_terms_slug = array();
        $order = $term_slug = $have_int = '';
        $posts_page = get_option('posts_per_page');
        $paged = get_query_var('paged') ? get_query_var('paged') : '';
        $value = $pagin = $offset = $off = '';
        $count = 1;
        $filters_type = isset($imic_options['filters_type']) ? $imic_options['filters_type'] : '';
        $data_page = $filters_type == 1 ? 'yes' : '';
        //print_r($tags);
        if (!empty($data)) {
            foreach ($data as $key => $value) {
                if ($key != 'page_id' && $key != "lang") {
                    $count = count($arrays);
                    if ($value == "ASC" || $value == "DESC") {
                        $order = $value;
                    } elseif ($key == "pg") {
                        $posts_page = $value;
                        $off = $value;
                    } elseif ($key == "paged") {
                        $paged = $value;
                        $posts_page = get_option('posts_per_page');
                    } elseif ($key == "list-cat") {
                        $term_slug = $value;
                        $category_id = get_term_by('slug', $value, 'listing-category');
                        $term_id = $category_id->term_id;
                        $parents = get_ancestors($term_id, 'listing-category');
                        $list_terms = array();
                        foreach ($parents as $parent) {
                            $list_term = get_term_by('id', $parent, 'listing-category');
                            $list_terms_slug[] = $list_term->slug;
                            $list_terms_ids[] = $list_term->term_id;
                        }
                        $list_terms[] = $value;
                        $term_array[0] = array('taxonomy' => 'listing-category', 'field' => 'slug', 'terms' => $list_terms, 'operator' => 'IN');
                    } else {
                        if (strpos($key, 'int_') !== false || strpos($key, 'range_') !== false) {
                            if (strpos($key, 'range_') !== false) {
                                $new_val = explode("-", $value);
                                $value = $new_val[1];
                                $pm_value = $new_val[0];
                                $key = explode("_", $key);
                                $key = "int_" . $key[1];
                                $arrays[$count++] = array('key' => $key, 'value' => $pm_value, 'compare' => '>=', 'type' => 'numeric');
                            }
                            $arrays[$count] = array('key' => $key, 'value' => $value, 'compare' => '<=', 'type' => 'numeric');
                            $have_int = 1;
                        } elseif (strpos($key, 'char_') !== false || strpos($key, 'child_') !== false) {
                            $value = str_replace('%20', ' ', $value);
                            $arrays[$count] = array('key' => $key, 'value' => $value, 'compare' => '=');
                        } else {
                            $arrays[$count] = array('key' => 'feat_data', 'value' => serialize(strval($value)), 'compare' => 'LIKE');
                        }
                    }
                    $count++;
                }
            }
        }
        $arrays[$count++] = array('key' => 'imic_plugin_ad_payment_status', 'value' => '1', 'compare' => '=');
        $arrays[$count++] = array('key' => 'imic_plugin_listing_end_dt', 'value' => date('Y-m-d'), 'compare' => '>=');
        if ($paged == 1) {
            $offset = $off;
        } elseif ($paged > 1) {
            $offs = $paged - 1;
            $offset = $off + $posts_page * $offs;
        }
        if (!empty($tags)) {
            $term_array[1] = array('taxonomy' => 'yachts-tag', 'field' => 'slug', 'terms' => $tags, 'operator' => 'IN');
        }
        if ($data_page == "yes") {
            if ($category == 1) {
                $class_list = 12;
                $search_filter_custom = get_option('imic_classifieds');
                //print_r($search_filter_custom);
                if (!empty($search_filter_custom)) {
                    foreach ($search_filter_custom as $key => $value) {
                        if ($key == $term_id) {
                            $filters = $value['filter'];
                            if ($filters != '') {
                                $search_filters = explode(',', $filters);
                            }
                            break;
                        } else {
                            foreach ($list_terms_ids as $id) {
                                if ($key == $id) {
                                    $filters = $value['filter'];
                                    if ($filters != '') {
                                        $search_filters = explode(',', $filters);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                if (!empty($search_filters)) {
                    ?>
                    <div class="col-md-3 search-filters" id="Search-Filters">
                        <div class="filters-sidebar">
                            <h3><?php 
                    _e('Refine Search', 'framework');
                    ?>
</h3>
                            <div class="accordion" id="toggleArea">
                                <!-- Filter by Year -->
                                <?php 
                    $series = 1;
                    $numeric_specs_type = isset($imic_options['integer_specs_type']) ? $imic_options['integer_specs_type'] : 0;
                    $new_search_filters = imic_filter_lang_specs($search_filters);
                    foreach ($new_search_filters as $filter) {
                        $integer = get_post_meta($filter, 'imic_plugin_spec_char_type', true);
                        $tabs = get_post_meta($filter, 'specifications_value', true);
                        $value_label = get_post_meta($filter, 'imic_plugin_value_label', true);
                        $spec_slug = imic_the_slug($filter);
                        if ($integer == 0) {
                            $slug = $spec_slug;
                            $comparision = "";
                        } elseif ($integer == 1) {
                            if ($numeric_specs_type == 0) {
                                $slug = "int_" . $spec_slug;
                                $comparision = "<span>" . __("Less Than ", "framework") . '</span>';
                            } else {
                                $slug = "range_" . $spec_slug;
                                $comparision = '';
                            }
                        } else {
                            $slug = "char_" . $spec_slug;
                            $comparision = "";
                        }
                        $get_child_filter = imic_get_child_values_status($tabs) == 1 ? 'get-child-filter' : '';
                        $slider_range_step = isset($imic_options['range_steps']) ? $imic_options['range_steps'] : 100;
                        ?>
                                <!-- Filter by Make -->
                                <div class="accordion-group panel">
                                    <div class="accordion-heading togglize"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#" href="#collapseTwo-<?php 
                        echo esc_attr($series);
                        ?>
"><?php 
                        echo get_the_title($filter);
                        ?>
<i class="fa fa-angle-down"></i> </a> </div>
                                    <div id="collapseTwo-<?php 
                        echo esc_attr($series);
                        ?>
" class="accordion-body collapse">
                                        <div class="accordion-inner">
                                            <ul data-ids="<?php 
                        echo 'fieldfltr-' . ($filter + 2648);
                        ?>
" id="<?php 
                        echo esc_attr($slug);
                        ?>
" class="filter-options-list list-group search-fields">
                                            <?php 
                        if ($integer == 1 && $numeric_specs_type == 1) {
                            ?>
                                            <li><b><?php 
                            echo esc_attr($value_label);
                            ?>
 <span class="left">0</span> - 
<span class="right">10000</span></b> <input id="ex2" type="text" class="span2" value="" data-slider-min="0" data-slider-max="100000" data-slider-step="<?php 
                            echo esc_attr($slider_range_step);
                            ?>
" data-slider-value="[0,10000]" data-imic-start="" data-imic-end=""/>
<br />
<!--<span class="left">0</span> - 
<span class="right">10000</span>-->
<a data-range="0-10000" class="range-val btn-primary btn-sm btn"><?php 
                            _e('Filter', 'framework');
                            ?>
</a></li>
                                            <?php 
                        } else {
                            foreach ($tabs as $tab) {
                                if ($series == 1) {
                                    $prefix = '';
                                } else {
                                    $prefix = '';
                                }
                                if ($integer == 0) {
                                    $specification = "feat_data";
                                } else {
                                    $specification = $slug;
                                }
                                $total_cars = imic_count_cars_by_specification($specification, $tab['imic_plugin_specification_values'], $term_slug);
                                ?>
                                                <li class="list-group-item"><span class="badge"><?php 
                                echo esc_attr($total_cars);
                                ?>
</span><?php 
                                echo $comparision;
                                ?>
<a class="<?php 
                                echo $get_child_filter;
                                ?>
" href="#"><?php 
                                echo esc_attr($prefix . $tab['imic_plugin_specification_values']);
                                ?>
</a></li>
                                            <?php 
                            }
                        }
                        ?>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <?php 
                        if (imic_get_child_values_status($tabs) == 1) {
                            $child_label = get_post_meta($filter, 'imic_plugin_sub_field_label', true);
                            echo '<div id="fieldfltr-' . ($filter * 111 + 2648) . '">';
                            echo '<div class="accordion-group panel">
                                    <div class="accordion-heading togglize"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#" href="#collapseTwo-sub' . esc_attr($series) . '">' . $child_label . '<i class="fa fa-angle-down"></i> </a> </div>
                                    <div id="collapseTwo-sub' . esc_attr($series) . '" class="accordion-body collapse">
                                        <div class="accordion-inner">
                                            <ul id="sub-' . esc_attr($slug) . '" class="filter-options-list list-group search-fields">';
                            echo '<li>' . __('Select ', 'framework') . get_the_title($filter) . '</li>';
                            echo '</ul>
                                        </div>
                                    </div>
                                </div>';
                            echo '</div>';
                        }
                        ?>
                                <?php 
                        $series++;
                    }
                    ?>
                            </div>
                            <!-- End Toggle -->
                    <?php 
                    $class_list = 9;
                }
                if (!empty($search_filters)) {
                } else {
                    echo ' <div class="col-md-3 search-filters">
                            <div class="filters-sidebar">';
                }
                $list_tags = array();
                $tag = '';
                if ($term_slug != '') {
                    $listing_tags = get_terms('yachts-tag', array('hide_empty' => true));
                    foreach ($listing_tags as $tag) {
                        $tag_description = get_option("taxonomy_" . $tag->term_id . "_metas");
                        $tag_descriptions = explode(',', $tag_description['cats']);
                        if (in_array($term_slug, $tag_descriptions)) {
                            $list_tags[] = $tag->slug;
                        } else {
                            foreach ($list_terms_slug as $slug_c) {
                                if (in_array($slug_c, $tag_descriptions)) {
                                    $list_tags[] = $tag->slug;
                                    break;
                                }
                            }
                        }
                    }
                }
                ?>
                        
                                            <?php 
                if (!empty($list_tags)) {
                    echo '<h3>' . __('Deep Search', 'framework') . '</h3>
                                                <div class="widget_tag_cloud matched-tags-list">';
                    foreach ($list_tags as $tab) {
                        $tag_name = get_term_by('slug', $tab, 'yachts-tag');
                        echo '<a href="javascript:void(0);" class="">' . $tag_name->name . '</a>';
                    }
                    echo '</div><br/>';
                } else {
                    //echo '<a href="javascript:void(0);">'.__('Filters not found, please select category.','framework').'</li>';
                }
                ?>
                                
                                <!-- End Toggle -->
                            <a href="#" id="reset-filters-search" class="btn-default btn-sm btn"><i class="fa fa-refresh"></i> <?php 
                _e('Reset search', 'framework');
                ?>
</a>
                            <a id="saved-search" href="#" class="btn-primary btn-sm btn" data-target="#searchmodal" data-toggle="modal"><div class="vehicle-details-access" style="display:none;"><span class="vehicle-id"><?php 
                echo esc_attr(get_the_ID());
                ?>
</span></div><i class="fa fa-folder-o"></i> <?php 
                _e('Save search', 'framework');
                ?>
</a>
                    <?php 
                $class_list = 9;
                echo ' </div>
                        </div>';
                ?>
                    <!-- Listing Results -->
                    <div class="col-md-<?php 
                echo esc_attr($class_list);
                ?>
 results-container">
                        <div class="results-container-in">
                            <div class="waiting" style="display:none;">
                                <div class="spinner">
                                    <div class="rect1"></div>
                                    <div class="rect2"></div>
                                    <div class="rect3"></div>
                                    <div class="rect4"></div>
                                    <div class="rect5"></div>
                                </div>
                            </div>
                            <div id="results-holder" class="results-list-view">
    <?php 
            }
        }
        $logged_user_pin = '';
        $user_id = get_current_user_id();
        $logged_user = get_user_meta($user_id, 'imic_user_info_id', true);
        $logged_user_pin = get_post_meta($logged_user, 'imic_user_zip_code', true);
        $badges_type = isset($imic_options['badges_type']) ? $imic_options['badges_type'] : '0';
        $specification_type = isset($imic_options['short_specifications']) ? $imic_options['short_specifications'] : '0';
        if ($badges_type == "0") {
            $badge_ids = isset($imic_options['badge_specs']) ? $imic_options['badge_specs'] : array();
        } else {
            $badge_ids = array();
        }
        $args_cats = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all');
        $classifieds_data = get_option('imic_classifieds');
        $img_src = '';
        $additional_specs = isset($imic_options['additional_specs']) ? $imic_options['additional_specs'] : '';
        if ($specification_type == 0) {
            $detailed_specs = isset($imic_options['specification_list']) ? $imic_options['specification_list'] : array();
        } else {
            $detailed_specs = array();
        }
        $detailed_specs = imic_filter_lang_specs($detailed_specs);
        $category_rail = isset($imic_options['category_rail']) ? $imic_options['category_rail'] : '0';
        $additional_specs_all = get_post_meta($additional_specs, 'specifications_value', true);
        $highlighted_specs = isset($imic_options['highlighted_specs']) ? $imic_options['highlighted_specs'] : array();
        $unique_specs = isset($imic_options['unique_specs']) ? $imic_options['unique_specs'] : '';
        if ($have_int == 1) {
            $args_cars = array('post_type' => 'yachts', 'orderby' => 'meta_value_num', 'order' => $order, 'tax_query' => $term_array, 'meta_query' => $arrays, 'posts_per_page' => $posts_page, 'post_status' => 'publish', 'offset' => $offset);
        } else {
            $args_cars = array('post_type' => 'yachts', 'order' => $order, 'tax_query' => $term_array, 'meta_query' => $arrays, 'posts_per_page' => $posts_page, 'post_status' => 'publish', 'offset' => $offset);
        }
        $cars_listing = new WP_Query($args_cars);
        if ($cars_listing->have_posts()) {
            while ($cars_listing->have_posts()) {
                $cars_listing->the_post();
                if (is_plugin_active("imi-classifieds/imi-classified.php")) {
                    $badge_ids = imic_classified_badge_specs(get_the_ID(), $badge_ids);
                    $detailed_specs = imic_classified_short_specs(get_the_ID(), $detailed_specs);
                }
                $badge_ids = imic_filter_lang_specs($badge_ids);
                $post_author_id = get_post_field('post_author', get_the_ID());
                $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true);
                $car_pin = get_post_meta($user_info_id, 'imic_user_lat_long', true);
                $car_pin = explode(',', $car_pin);
                $post_author_id = get_post_field('post_author', get_the_ID());
                $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true);
                $author_role = get_option('blogname');
                if (!empty($user_info_id)) {
                    $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names"));
                    if (!empty($term_list)) {
                        $author_role = $term_list[0];
                    } else {
                        $author_role = get_option('blogname');
                    }
                }
                $save1 = isset($_SESSION['saved_vehicle_id1']) ? $_SESSION['saved_vehicle_id1'] : '';
                $save2 = isset($_SESSION['saved_vehicle_id2']) ? $_SESSION['saved_vehicle_id2'] : '';
                $save3 = isset($_SESSION['saved_vehicle_id3']) ? $_SESSION['saved_vehicle_id3'] : '';
                $specifications = get_post_meta(get_the_ID(), 'feat_data', true);
                $unique_value = imic_vehicle_price(get_the_ID(), $unique_specs, $specifications);
                $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, get_the_ID());
                $highlighted_specs = $new_highlighted_specs;
                $highlight_value = imic_vehicle_title(get_the_ID(), $highlighted_specs, $specifications);
                $highlight_value = $highlight_value == '' ? get_the_title() : $highlight_value;
                $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications);
                $badges = imic_vehicle_all_specs(get_the_ID(), $badge_ids, $specifications);
                $video = get_post_meta(get_the_ID(), 'imic_plugin_video_url', true);
                $user_id = get_current_user_id();
                $current_user_info_id = get_user_meta($user_id, 'imic_user_info_id', true);
                if ($current_user_info_id != '') {
                    $saved_car_user = get_post_meta($current_user_info_id, 'imic_user_saved_cars', true);
                }
                if (empty($saved_car_user) || $current_user_info_id == '' || $saved_car_user == '') {
                    $saved_car_user = array($save1, $save2, $save3);
                }
                $save_icon = imic_value_search_multi_array(get_the_ID(), $saved_car_user) ? 'fa-star' : 'fa-star-o';
                $save_icon_disable = imic_value_search_multi_array(get_the_ID(), $saved_car_user) ? 'disabled' : '';
                ?>
                                        <!-- Result Item -->
                                        <div class="result-item format-standard">
                                            <div class="result-item-image"><?php 
                if (has_post_thumbnail()) {
                    ?>
                                                <a href="<?php 
                    echo esc_url(get_permalink());
                    ?>
" class="media-box"><?php 
                    the_post_thumbnail('600x400');
                    ?>
</a><?php 
                }
                ?>
                                                <?php 
                $start = 0;
                $badge_position = array('vehicle-age', 'premium-listing', 'third-listing', 'fourth-listing');
                if (!empty($badges)) {
                    foreach ($badges as $badge) {
                        $badge_class = $start == 0 ? 'default' : 'success';
                        echo '<span class="label label-' . $badge_class . ' ' . $badge_position[$start] . '">' . $badge . '</span>';
                        $start++;
                        if ($start > 3) {
                            break;
                        }
                    }
                }
                ?>
                                                <div class="result-item-view-buttons">
                                                    <?php 
                if ($video != '') {
                    ?>
                                                    <a href="<?php 
                    echo esc_attr($video);
                    ?>
" data-rel="prettyPhoto"><i class="fa fa-play"></i> <?php 
                    _e('View video', 'framework');
                    ?>
</a><?php 
                }
                ?>
                                                    <a href="<?php 
                echo esc_url(get_permalink());
                ?>
"><i class="fa fa-plus"></i> <?php 
                _e('View details', 'framework');
                ?>
</a>
                                                </div>
                                            </div>
                                            <div class="result-item-in">
                                                <h4 class="result-item-title"><a href="<?php 
                echo esc_url(get_permalink());
                ?>
"><?php 
                echo esc_attr($highlight_value);
                ?>
</a>
                                                <?php 
                if ($category_rail == "1" && is_plugin_active("imi-classifieds/imi-classified.php")) {
                    echo imic_get_cats_list(get_the_ID(), "dropdown");
                }
                ?>
</h4>
                                                <div class="result-item-cont">
                                                    <div class="result-item-block col1">
                                                        <?php 
                echo imic_excerpt(20);
                ?>
                                                    </div>
                                                    <div class="result-item-block col2">
                                                        <div class="result-item-pricing">
                                                            <div class="price"><?php 
                echo esc_attr($unique_value);
                ?>
</div>
                                                        </div>
                                                        <!-- <div class="result-item-action-buttons">
                                                            <a <?php 
                echo esc_attr($save_icon_disable);
                ?>
 id="" href="#" class="btn btn-default btn-sm save-car"><div class="vehicle-details-access" style="display:none;"><span class="vehicle-id"><?php 
                echo esc_attr(get_the_ID());
                ?>
</span></div><i class="fa <?php 
                echo esc_attr($save_icon);
                ?>
"></i> <?php 
                _e('Save', 'framework');
                ?>
</a>
                                                            <a href="<?php 
                echo esc_url(get_permalink());
                ?>
" class="btn btn-default btn-sm"><?php 
                _e('Enquire', 'framework');
                ?>
</a><br>
                                                            <div class="view-distance"><div style="display:none;"><span class="car-lat"><?php 
                echo esc_attr($car_pin[0]);
                ?>
</span><span class="car-long"><?php 
                echo esc_attr($car_pin[1]);
                ?>
</span></div><a id="<?php 
                echo get_the_ID();
                ?>
" href="#" class="distance-calc"><i class="fa fa-map-marker"></i> <?php 
                _e('Distance from me?', 'framework');
                ?>
</a>
                                                            <div class="input-group">
                                                                <input type="text" value="<?php 
                echo esc_attr($logged_user_pin);
                ?>
" class="get-distance form-control input-sm" style="display:none;" placeholder="Enter Zipcode">
                                                                <span class="input-group-btn">
                                                                    <a href="#" class="btn btn-default btn-sm search-dist" style="display:none;"><?php 
                _e('Get', 'framework');
                ?>
</a>
                                                                </span>
                                                            </div></div>
                                                        </div> -->
                                                    </div>
                                                </div>
                                                <div class="result-item-features">
                                                    <ul class="inline">
                                                    <?php 
                if (!empty($details_value)) {
                    foreach ($details_value as $detail) {
                        if (!empty($detail)) {
                            echo '<li>' . $detail . '</li>';
                        }
                    }
                }
                ?>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        <?php 
            }
        } else {
            ?>
                
                    <div class="text-align-center error-404">
                        <hr class="sm">
                        <p><strong><?php 
            echo esc_attr_e('Sorry - No listing found for this criteria.', 'framework');
            ?>
</strong></p>
                        <p><?php 
            echo esc_attr_e('Please search again with different filters.', 'framework');
            ?>
</p>
                        <script> jQuery('#noresultsModal').modal('show');</script>
                    </div>
                    <div class="modal fade" id="noresultsAjaxModal" tabindex="-1" role="dialog" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                        <h4><?php 
            echo esc_attr_e('YACHT ALERTS', 'framework');
            ?>
</h4>
                                    </div>
                                    <div class="modal-body">
                                        <p><?php 
            echo esc_attr_e('Sorry we couldnt find the yacht you are looking for within this inventory. However, we are the first to know when listings hit the market, and you can be too when you subscribe to our Yacht Alert. By filling out the form below, you will receive information on specific yachts matching your criteria that are just hitting the market; that puts you ahead of other buyers. We search industry listings, bank foreclosure inventory, boat shows, web sites, trade publications, and our professional networks for yachts that may not even be listed yet to find your ideal vessel. It is easy to use, always current, and you can input as much search criteria as you like.', 'framework');
            ?>
</p>
                                        <form class="enquiry-vehicle">
                                        <input type="hidden" name="email_content" value="enquiry_form">
                                        <input type="hidden" name="Subject" id="subject" value="Yacht Alerts Request">
                                        <input type="hidden" name="Vehicle_ID" value="<?php 
            echo esc_attr(get_the_ID());
            ?>
">
                                        <p><?php 
            echo esc_attr_e('PERSONAL INFORMATION', 'framework');
            ?>
</p>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                                <?php 
            if (is_user_logged_in()) {
                ?>
                                                    <input type="text" name="Name" class="form-control" placeholder="<?php 
                echo esc_attr_e('Full Name', 'framework');
                ?>
" value="<?php 
                echo esc_attr($userName);
                ?>
">
                                                 <?php 
            } else {
                ?>
                                                    <input type="text" name="Name" class="form-control" placeholder="<?php 
                echo esc_attr_e('Full Name', 'framework');
                ?>
">
                                                <?php 
            }
            ?>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
                                                         <?php 
            if (is_user_logged_in()) {
                ?>
                                                            <input type="text" name="Email" class="form-control" placeholder="<?php 
                echo esc_attr_e('Email', 'framework');
                ?>
" value="<?php 
                echo esc_attr($userEmail);
                ?>
">
                                                         <?php 
            } else {
                ?>
                                                         <input type="email" name="Email" class="form-control" placeholder="<?php 
                echo esc_attr_e('Email', 'framework');
                ?>
">
                                                         <?php 
            }
            ?>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon"><i class="fa fa-phone"></i></span>
                                                        <?php 
            if (is_user_logged_in()) {
                ?>
                                                            <input type="text" name="Phone" class="form-control" placeholder="<?php 
                echo esc_attr_e('Phone', 'framework');
                ?>
" value="<?php 
                echo get_post_meta($user_info_id, 'imic_user_telephone', true);
                ?>
">
                                                         <?php 
            } else {
                ?>
                                                        <input type="text" name="Phone" class="form-control" placeholder="<?php 
                echo esc_attr_e('Phone', 'framework');
                ?>
">
                                                        <?php 
            }
            ?>
                                                    </div>
                                                </div>
                                            </div>
                                            <p><?php 
            echo esc_attr_e('YACHT INFORMATION', 'framework');
            ?>
</p>
                                                    <div class="row">
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Make" class="form-control" placeholder="<?php 
            echo esc_attr_e('Make', 'framework');
            ?>
" value="<?php 
            echo esc_attr($brand);
            ?>
">
                                                            </div>
                                                        </div>
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Model" class="form-control" placeholder="<?php 
            echo esc_attr_e('Model', 'framework');
            ?>
" value="<?php 
            echo esc_attr($model);
            ?>
">
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Size" class="form-control" placeholder="<?php 
            echo esc_attr_e('Size', 'framework');
            ?>
" value="<?php 
            echo esc_attr($size);
            ?>
">
                                                            </div>
                                                        </div>
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Year" class="form-control" placeholder="<?php 
            echo esc_attr_e('Year', 'framework');
            ?>
" value="<?php 
            echo esc_attr($year);
            ?>
">
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Engine" class="form-control" placeholder="<?php 
            echo esc_attr_e('Engine', 'framework');
            ?>
" value="<?php 
            echo esc_attr($enginebrand);
            ?>
">
                                                            </div>
                                                        </div>
                                                        <div class="col-md-6">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-list"></i></span>
                                                                <input type="text" name="Budget" class="form-control" placeholder="<?php 
            echo esc_attr_e('Budget', 'framework');
            ?>
">
                                                            </div>
                                                        </div>
                                                    </div>
                                            <input type="submit" class="btn btn-primary pull-right" value="<?php 
            echo esc_attr_e('Subscribe', 'framework');
            ?>
">
                                            <label class="btn-block"><?php 
            echo esc_attr_e('Preferred Contact', 'framework');
            ?>
</label>
                                            <label class="checkbox-inline"><input name="Preferred Contact Email" value="yes" type="checkbox"> <?php 
            echo esc_attr_e('Email', 'framework');
            ?>
</label>
                                            <label class="checkbox-inline"><input name="Preferred Contact Phone" value="yes" type="checkbox"> <?php 
            echo esc_attr_e('Phone', 'framework');
            ?>
</label>
                                            <div class="message"></div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                
                                        <?php 
        }
        echo '<div class="clearfix"></div>';
        $paginate = $paged == '' ? 1 : $paged;
        imic_listing_pagination("page-" . $paginate, $cars_listing->max_num_pages, $paged);
        wp_reset_postdata();
        if ($data_page == "yes") {
            echo '</div></div></div>';
        }
        die;
    }