$listing ){ if ( !isset( $listing->TotalRecords ) && empty( $listing->TotalRecords ) ) { if ( $crea_showcase_search_theams_option == 'Map' ){ $allListingArr[$listing->ID] = $listing; } else { $allListingArr[$listing->ID] = $listing; } } } //} $total_listing_records = $listings[0]->TotalRecords; } else { $searchArray = array(); if( $default_text_search !='' && !empty( $default_text_search ) ) { $searchArray[] = array( 'key' => 'listingAddress', 'value' => $default_text_search, 'compare' => 'LIKE' ); } if( $crea_advance_search_property_type !='' && !empty( $crea_advance_search_property_type ) ) { $searchArray[] = array( 'key' => 'listingPropertyType', 'value' => $crea_advance_search_property_type, 'compare' => 'LIKE' ); } if( $crea_advance_search_structure_type !='' && !empty( $crea_advance_search_structure_type ) ) { $searchArray[] = array( 'key' => 'listingStructureType', 'value' => $crea_advance_search_structure_type, 'compare' => 'LIKE' ); } if( $crea_advance_search_status !='' && !empty( $crea_advance_search_status ) ) { $searchArray[] = array( 'key' => 'listingAgentStatus', 'value' => $crea_advance_search_status, 'compare' => 'LIKE' ); } if( $crea_advance_search_bedrooms !='' && !empty( $crea_advance_search_bedrooms ) ) { $searchArray[] = array( 'key' => 'listingBedRooms', 'value' => $crea_advance_search_bedrooms, 'compare' => '=', 'type' => 'numeric' ); } if( $crea_advance_search_bathrooms !='' && !empty( $crea_advance_search_bathrooms ) ) { $searchArray[] = array( 'key' => 'listingBathrooms', 'value' => $crea_advance_search_bathrooms, 'compare' => '=', 'type' => 'numeric' ); } if( $min_amount !='' && isset( $min_amount ) ) { $searchArray[] = array( 'key' => 'listingPrice', 'value' => $min_amount, 'compare' => '>=', 'type' => 'numeric', ); } if( $max_amount !='' && isset( $max_amount ) ) { $searchArray[] = array( 'key' => 'listingPrice', 'value' => $max_amount, 'compare' => '<=', 'type' => 'numeric', ); } $args = array( 'post_type' => 'aretk_listing', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_key' => 'listingPrice', 'orderby' => $showcase_orderby_property_listing_results, 'order' => $showcase_order_property_listing_results, 'meta_query' => array( 'relation' => 'AND', $searchArray ) ); $posts_array = (array) get_posts( $args ); $propertyDataArr = array(); foreach ($posts_array as $singlePost) { $propertyDataArr[]= $singlePost->ID; } $args_property = array( 'post_type' => 'aretk_listing', 'posts_per_page' => $itemsPerPage, 'paged' => $page_number_id, 'post_status' => 'publish', 'post__in' => $propertyDataArr, 'meta_query' => array( 'relation' => 'AND', $searchArray ) ); $property_array = (array) get_posts( $args_property ); $exclusiveArr = array(); foreach ($property_array as $singlePost) { $singlePost1 = (array) $singlePost; $singlePost2 = (object) $singlePost1; $ExculdeListinID[] = $singlePost2; } $allListingFinalArr = array(); $allListingFinalArr = $exclusiveArr; $total_listing_records = count($propertyDataArr); } } else { $ExculdeListinID = array(); $getSubscriptionListingFeed = get_option('crea_subscription_status', ''); if( isset( $getSubscriptionListingFeed ) && !empty( $getSubscriptionListingFeed ) && $getSubscriptionListingFeed === 'valid' ) { $setPropertyValue = ''; if( !empty( $default_text_search ) && $default_text_search != '' ) { $setPropertyValue .="&keyword=".rawurlencode($default_text_search); } if( !empty( $crea_advance_search_property_type ) && $crea_advance_search_property_type !='' ) { $setPropertyValue .="&property_types=".rawurlencode($crea_advance_search_property_type); } if( !empty( $crea_advance_search_structure_type ) && $crea_advance_search_structure_type !='' ) { $setPropertyValue .="&structure_types=".rawurlencode($crea_advance_search_structure_type); } if( !empty( $crea_advance_search_status ) && $crea_advance_search_status !='' ) { $crea_advance_search_status = strtolower($crea_advance_search_status); $setPropertyValue .="&transaction_type=".rawurlencode($crea_advance_search_status); } if( !empty( $crea_advance_search_bedrooms ) && $crea_advance_search_bedrooms !='' ) { $setPropertyValue .="&bed_min=$crea_advance_search_bedrooms"; } if( !empty( $crea_advance_search_bathrooms ) && $crea_advance_search_bathrooms !='' ) { $setPropertyValue .="&bath_min=$crea_advance_search_bathrooms"; } if( !empty( $crea_advance_search_city ) && $crea_advance_search_city !='' ) { $setPropertyValue .="&city=".rawurlencode($crea_advance_search_city); } if( isset( $min_amount ) && $min_amount !='' ) { $setPropertyValue .="&price_min=$min_amount"; } if( isset( $max_amount ) && $max_amount !='' ) { $setPropertyValue .="&price_max=$max_amount"; } $tableName= $wpdb->prefix.'crea_user_listing_detail'; $getListingUsernameQuery = "SELECT `username` FROM `$tableName`"; $getUserNameResults = $wpdb->get_results($getListingUsernameQuery); $userNameArray = array(); //if( !empty( $getUserNameResults ) && $getUserNameResults !='' ) { $userNameValues = ''; $userNameValues = $getUserNameResults[0]->username; $filter_by_username = ''; if ( !empty($userNameValues) && $userNameValues != '') { $filter_by_username .= '&feed='.$userNameValues; } $filter_array_results = ''; if ( !empty($itemsPerPage) ) { $filter_array_results.= '&limit=20'; } if ( !empty($offset) ) { $filter_array_results.= '&offset='.$offset; } $domainName = $_SERVER['SERVER_NAME']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.aretk.com/?key=$subscriptionKey&request=listings&exclusive=true$filter_by_username$showcase_custom_result_type$setPropertyValue$filter_array_results"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_REFERER,$domainName); $data = curl_exec($ch); curl_close($ch); $listings = json_decode($data); $allListingArr = array(); foreach ( $listings as $listing_key => $listing ){ if ( !isset( $listing->TotalRecords ) && empty( $listing->TotalRecords ) ) { $allListingArr[$listing->ID] = $listing; } } $total_listing_records = $listings[0]->TotalRecords; //} } else { $searchArray = array(); if( $default_text_search !='' && !empty( $default_text_search ) ) { $searchArray[] = array( 'key' => 'listingAddress', 'value' => $default_text_search, 'compare' => 'LIKE' ); } if( $crea_advance_search_property_type !='' && !empty( $crea_advance_search_property_type ) ) { $searchArray[] = array( 'key' => 'listingPropertyType', 'value' => $crea_advance_search_property_type, 'compare' => 'LIKE' ); } if( $crea_advance_search_structure_type !='' && !empty( $crea_advance_search_structure_type ) ) { $searchArray[] = array( 'key' => 'listingStructureType', 'value' => $crea_advance_search_structure_type, 'compare' => 'LIKE' ); } if( $crea_advance_search_status !='' && !empty( $crea_advance_search_status ) ) { $searchArray[] = array( 'key' => 'listingAgentStatus', 'value' => $crea_advance_search_status, 'compare' => 'LIKE' ); } if( $crea_advance_search_bedrooms !='' && !empty( $crea_advance_search_bedrooms ) ) { $searchArray[] = array( 'key' => 'listingBedRooms', 'value' => $crea_advance_search_bedrooms, 'compare' => '=', 'type' => 'numeric' ); } if( $crea_advance_search_bathrooms !='' && !empty( $crea_advance_search_bathrooms ) ) { $searchArray[] = array( 'key' => 'listingBathrooms', 'value' => $crea_advance_search_bathrooms, 'compare' => '=', 'type' => 'numeric' ); } if( $min_amount !='' && isset( $min_amount ) ) { $searchArray[] = array( 'key' => 'listingPrice', 'value' => $min_amount, 'compare' => '>=', 'type' => 'numeric', ); } if( $max_amount !='' && isset( $max_amount ) ) { $searchArray[] = array( 'key' => 'listingPrice', 'value' => $max_amount, 'compare' => '<=', 'type' => 'numeric', ); } $args = array( 'post_type' => 'aretk_listing', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_key' => 'listingPrice', 'orderby' => $showcase_orderby_property_listing_results, 'order' => $showcase_order_property_listing_results, 'meta_query' => array( 'relation' => 'AND', $searchArray ) ); $posts_array = (array) get_posts( $args ); $propertyDataArr = array(); foreach ($posts_array as $singlePost) { $propertyDataArr[]= $singlePost->ID; } $args_property = array( 'post_type' => 'aretk_listing', 'posts_per_page' => $itemsPerPage, 'paged' => $page_number_id, 'post_status' => 'publish', 'post__in' => $propertyDataArr, 'meta_query' => array( 'relation' => 'AND', $searchArray ) ); $property_array = (array) get_posts( $args_property ); $exclusiveArr = array(); foreach ($property_array as $singlePost) { $singlePost1 = (array) $singlePost; $singlePost2 = (object) $singlePost1; $ExculdeListinID[] = $singlePost2; } $allListingFinalArr = array(); $allListingFinalArr = $exclusiveArr; $total_listing_records = count($propertyDataArr); } } $allListingFinalArr = array_merge($allListingArr,$ExculdeListinID); $allLisgngFinalArrCount = count($allListingFinalArr); //Layout based HTML $showcaseSCID = !empty($crea_showcase_shortcode_id) ? $crea_showcase_shortcode_id :''; $site_image_path = ARETK_CREA_PLUGIN_URL.'public/images/preview_img.jpg'; $finalResultsArr = array(); $mergeSearchArray = array(); //get showcse shotcode values $showcse_crea_filter_brokerage =''; $showcse_crea_display_theams_option =''; $showcse_crea_feed_include_exclude =''; $showcse_crea_feed_ddf_type =''; $showcse_crea_filter_office =''; $showcse_crea_filter_inclue_open_house =''; $showcse_crea_filter_by_other_day =''; $showcse_crea_filter_by_map_km =''; $showcse_crea_filter_listing =''; $showcse_crea_serializable_listing_array =''; $showcse_crea_serializable_grid_array =''; $showcse_crea_serializable_carousel_array =''; $showcse_crea_serializable_map_array =''; $showcse_crea_serializable_slider_array =''; $Showcase_crea_grid_view_color_array =''; $Showcase_crea_listing_view_color_array =''; $Showcase_crea_slider_view_color_array =''; $Showcase_crea_map_view_color_array =''; $Showcase_crea_carousel_view_color_array =''; if ( !empty( $total_listing_records ) ){ $max_numbers_pagination = ($total_listing_records / $itemsPerPage); } $html =""; if( $showcaseSCID == 'Select Result layout' || $showcaseSCID =='Default - Listings Showcase' || empty($showcaseSCID) ) { //No any showcase selected //default listing view selected.
$html =''; $html.='
'; $html.='
'; $html.='
'; $html.=''; $crea_default_listing_pagiantion = get_option('crea_default_listing_pagination_color_id_yes_or_not'); $crea_default_listing_pagiantion_result = !empty($crea_default_listing_pagiantion)?$crea_default_listing_pagiantion : 'ab2567'; $crea_default_listing_pagiantion_text_color = get_option('crea_default_listing_pagination_text_color_id_yes_or_not'); $crea_default_listing_pagiantion_text_color_result = !empty($crea_default_listing_pagiantion_text_color)?$crea_default_listing_pagiantion_text_color : 'ab2567'; ?> 0 ){ $html .=''; } $getSubscriptionListingFeed = get_option('crea_subscription_status', ''); if ( !empty($userNameValues) && !empty( $userNameValues) && !empty($getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' && $allLisgngFinalArrCount > 0 ){ $html .='

MLS®, REALTOR®, and the associated logos are trademarks of The Canadian Real Estate Association.

'; } //Terms of use /*if( empty( $_COOKIE["aretk_crea_terms_of_use"] ) && !empty($userNameValues) && isset( $getSubscriptionListingFeed ) && !empty( $getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' ) { $html.='

Terms & Conditions Agreement

The listing content on this website is protected by copyright and other laws, and is intended solely for the private, non-commercial use by individuals. Any other reproduction, distribution or use of the content, in whole or in part, is specifically forbidden. The prohibited uses include commercial use, "screen scraping", "database scraping", and any other activity intended to collect, store, reorganize or manipulate data on the pages produced by or displayed on this website.

REALTOR®, REALTORS®, and the REALTOR® logo are certification marks that are owned by REALTOR® Canada Inc. and licensed exclusively to The Canadian Real Estate Association (CREA). These certification marks identify real estate professionals who are members of CREA and who must abide by CREA\'s By-Laws, Rules, and the REALTOR® Code. The MLS® trademark and the MLS® logo are owned by CREA and identify the quality of services provided by real estate professionals who are members of CREA.

The information contained on this site is based in whole or in part on information that is provided by members of The Canadian Real Estate Association, who are responsible for its accuracy. CREA reproduces and distributes this information as a service for its members and assumes no responsibility for its accuracy.

'; }*/ $html.='
'; $html.='
'; //End listing Html } else { /*slected showcase results*/ if ( isset($showcaseSCID) && !empty($showcaseSCID) ) { $showcse_crea_filter_brokerage = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_brokerage',true)); $showcse_crea_filter_brokerage = !empty( $showcse_crea_filter_brokerage ) ? $showcse_crea_filter_brokerage :''; $showcse_crea_display_theams_option = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_display_theams_option',true)); $showcse_crea_display_theams_option= !empty( $showcse_crea_display_theams_option ) ? $showcse_crea_display_theams_option:''; $showcse_crea_feed_include_exclude = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_feed_include_exclude',true)); $showcse_crea_feed_include_exclude = !empty( $showcse_crea_feed_include_exclude ) ? $showcse_crea_feed_include_exclude :''; $showcse_crea_feed_ddf_type = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_feed_ddf_type',true)); $showcse_crea_feed_ddf_type = !empty( $showcse_crea_feed_ddf_type ) ? $showcse_crea_feed_ddf_type :''; $showcse_crea_filter_office = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_office',true)); $showcse_crea_filter_agent_name = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_agent_name',true)); $showcse_crea_filter_inclue_open_house = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_inclue_open_house',true)); $showcse_crea_filter_by_other_day = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_by_other_day',true)); $showcse_crea_filter_by_map_km = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_by_map_km',true)); $showcse_crea_filter_listing = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_filter_listing',true)); $showcse_crea_serializable_listing_array = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_serializable_listing_array',true)); $showcse_crea_serializable_grid_array = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_serializable_grid_array',true)); $showcse_crea_serializable_carousel_array = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_serializable_carousel_array',true)); $showcse_crea_serializable_map_array = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_serializable_map_array',true)); $showcse_crea_serializable_slider_array = maybe_unserialize(get_post_meta($showcaseSCID,'showcse_crea_serializable_slider_array',true)); $Showcase_crea_grid_view_color_array_results = maybe_unserialize( get_post_meta($showcaseSCID,'Showcase_crea_grid_view_color_array',true)); $Showcase_crea_listing_view_color_array_reults = maybe_unserialize( get_post_meta($showcaseSCID,'Showcase_crea_listing_view_color_array',true)); $Showcase_crea_slider_view_color_array_reults = maybe_unserialize( get_post_meta($showcaseSCID,'Showcase_crea_slider_view_color_array',true)); $Showcase_crea_map_view_color_array_results = maybe_unserialize( get_post_meta($showcaseSCID,'Showcase_crea_map_view_color_array',true)); $Showcase_crea_carousel_view_color_array_reults = maybe_unserialize( get_post_meta($showcaseSCID,'Showcase_crea_carousel_view_color_array',true)); $showcse_crea_serializable_listing_array = get_post_meta($showcaseSCID,'showcse_crea_serializable_listing_array',true); if(isset( $showcse_crea_serializable_listing_array ) && !empty( $showcse_crea_serializable_listing_array)) { $showcse_crea_serializable_listing_array = maybe_unserialize($showcse_crea_serializable_listing_array); $showcse_crea_serializable_maxlistingonpage = !empty($showcse_crea_serializable_listing_array['maxlistingonpage'] ) ? $showcse_crea_serializable_listing_array['maxlistingonpage'] : ''; if(isset( $showcse_crea_serializable_maxlistingonpage ) && !empty($showcse_crea_serializable_maxlistingonpage )) { $showcse_crea_serializable_maxlistingonpage_results = $showcse_crea_serializable_maxlistingonpage; } else { $showcse_crea_serializable_maxlistingonpage_results = "20"; } } else { $showcse_crea_serializable_maxlistingonpage_results = "20"; } $showcse_crea_serializable_map_array = maybe_unserialize($showcse_crea_serializable_map_array); $mapfilterlatitude = !empty( $showcse_crea_serializable_map_array['mapfilterlatitude'] ) ? $showcse_crea_serializable_map_array['mapfilterlatitude'] : '56.1304'; $mapfilterlongitude = !empty( $showcse_crea_serializable_map_array['mapfilterlongitude'] ) ? $showcse_crea_serializable_map_array['mapfilterlongitude'] : '-106.3468'; $showcasemapimagezoom = !empty( $showcse_crea_serializable_map_array['showcasemapimagezoom'] ) ? $showcse_crea_serializable_map_array['showcasemapimagezoom'] : '6'; } if( $showcse_crea_display_theams_option == 'Listing View' ) { //Start showcase listing view html $html =''; if ( !empty($allListingFinalArr) && isset($allListingFinalArr) && $allLisgngFinalArrCount > 0 ) { $html.=''; $html.='
'; $html.=''; $html.='
'; $Showcase_crea_listing_view_color_pagination_color = "DB5C04"; $Showcase_crea_listing_view_color_pagination_text_color = "000000"; if(isset( $Showcase_crea_listing_view_color_array_reults ) && !empty( $Showcase_crea_listing_view_color_array_reults ) ){ $Showcase_crea_listing_view_color_pagination_results = $Showcase_crea_listing_view_color_array_reults['listingShowcasepaginationColor']; $Showcase_crea_listing_view_color_text_pagination_results = $Showcase_crea_listing_view_color_array_reults['listingShowcasepaginationtextColor']; if( !empty( $Showcase_crea_listing_view_color_pagination_results ) ){ $Showcase_crea_listing_view_color_pagination_color = $Showcase_crea_listing_view_color_pagination_results; } if( !empty( $Showcase_crea_listing_view_color_text_pagination_results ) ){ $Showcase_crea_listing_view_color_pagination_text_color = $Showcase_crea_listing_view_color_text_pagination_results; } } ?> 0 ){ //$html.=''; $html .=''; } if ( !empty($showcse_crea_feed_ddf_type) && !empty( $showcse_crea_feed_ddf_type) && !empty($getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' && $allLisgngFinalArrCount > 0){ $html .='

MLS®, REALTOR®, and the associated logos are trademarks of The Canadian Real Estate Association.

'; } //Terms of use /*if( empty( $_COOKIE["aretk_crea_terms_of_use"] ) && !empty($showcse_crea_feed_ddf_type) && isset( $getSubscriptionListingFeed ) && !empty( $getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' ) { $html.='

Terms & Conditions Agreement

The listing content on this website is protected by copyright and other laws, and is intended solely for the private, non-commercial use by individuals. Any other reproduction, distribution or use of the content, in whole or in part, is specifically forbidden. The prohibited uses include commercial use, "screen scraping", "database scraping", and any other activity intended to collect, store, reorganize or manipulate data on the pages produced by or displayed on this website.

REALTOR®, REALTORS®, and the REALTOR® logo are certification marks that are owned by REALTOR® Canada Inc. and licensed exclusively to The Canadian Real Estate Association (CREA). These certification marks identify real estate professionals who are members of CREA and who must abide by CREA\'s By-Laws, Rules, and the REALTOR® Code. The MLS® trademark and the MLS® logo are owned by CREA and identify the quality of services provided by real estate professionals who are members of CREA.

The information contained on this site is based in whole or in part on information that is provided by members of The Canadian Real Estate Association, who are responsible for its accuracy. CREA reproduces and distributes this information as a service for its members and assumes no responsibility for its accuracy.

'; }*/ } else { $html.='

Sorry no properties found

'; } } if( $showcse_crea_display_theams_option == 'Grid View' ) { if( isset( $allLisgngFinalArrCount ) && !empty( $allLisgngFinalArrCount ) && $allLisgngFinalArrCount > 0 ) { //Start Grid View Html $html = ''; $showcase_crea_display_grid_array = $showcse_crea_serializable_grid_array; if( isset( $showcase_crea_display_grid_array ) && !empty( $showcase_crea_display_grid_array )) { $showcase_crea_display_maxselected_column = $showcase_crea_display_grid_array['maxgridviewselectedcolumn']; $showcase_crea_display_maxselected_row = $showcase_crea_display_grid_array['maxgridviewselectedrow']; if( $showcase_crea_display_maxselected_column == '2' ) { $grid_view_listing_class = 'grid-view-box pr aret-col-6'; } else { $grid_view_listing_class = 'aret-col-3 grid-view-box pr'; } switch ($showcase_crea_display_maxselected_column) { case "1": $grid_view_listing_class = 'grid-view-box pr aret-col-12'; break; case "2": $grid_view_listing_class = 'grid-view-box pr aret-col-6'; break; case "3": $grid_view_listing_class = 'grid-view-box pr aret-col-4'; break; case "4": $grid_view_listing_class = 'grid-view-box pr aret-col-3'; break; default: $grid_view_listing_class = 'grid-view-box pr aret-col-3'; } } $showcse_crea_serializable_maxlistingonpage_results = 20; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
    '; $singleListingConter = 1; foreach ( $allListingFinalArr as $singleListing ) { if ( isset( $singleListing->post_author ) && !empty( $singleListing->post_author ) ) { $content_post = get_post($singleListing->ID); if (!empty($content_post) && $content_post != '') { $listing_post_content = $content_post->post_content; } $ListingAddress = get_post_meta($singleListing->ID,'listingAddress',true); $ListingCity = get_post_meta($singleListing->ID,'listingcity',true); $listingProvince = get_post_meta($singleListing->ID,'listingProvince',true); $ListingPrice = get_post_meta($singleListing->ID,'listingPrice',true); $ListingBedRooms = get_post_meta($singleListing->ID, 'listingBedRooms', true); $ListingBedRooms = !empty($ListingBedRooms) ? $ListingBedRooms : ''; $ListingBathrooms = get_post_meta($singleListing->ID, 'listingBathrooms', true); $ListingBathrooms = !empty($ListingBathrooms) ? $ListingBathrooms : ''; $listingopenhosedatetimeArr = get_post_meta($singleListing->ID, 'listingopenhosedatetimeArr', true); $listingopenhosedatetimeArr = json_decode($listingopenhosedatetimeArr); $listingopenhosedatetimeArr = !empty($listingopenhosedatetimeArr) ? $listingopenhosedatetimeArr : ''; $listingPropertyStatus = get_post_meta($singleListing->ID, 'listingAgentStatus', true); $listingPropertyStatus = !empty($listingPropertyStatus) ? $listingPropertyStatus : ''; $date = date('d-m-Y',strtotime($singleListing->post_date)); $crea_listing_images_detail_table_name = $wpdb->prefix . CREA_LISTING_IMAGES_HISTORY; $querySelectFirstImage = "SELECT image_url FROM $crea_listing_images_detail_table_name WHERE image_position =1 AND unique_id = $singleListing->ID"; $resultSet = $wpdb->get_results($querySelectFirstImage); if (isset($resultSet) && !empty($resultSet)) { $path = $resultSet[0]->image_url; } else { $path = $site_image_path; } $listing_full_address_path = ''; if ( !empty( $ListingAddress ) ) { $singleListingStreetAddress = trim($ListingAddress); $singleListingStreetAddress = str_replace(' ', '-', $singleListingStreetAddress); $singleListingStreetAddress = str_replace('#', '', $singleListingStreetAddress); $singleListingStreetAddress = str_replace('---','-',$singleListingStreetAddress); $listing_full_address_path.= $singleListingStreetAddress; } if ( !empty( $ListingCity ) ) { $listing_full_address_path.='-'.trim($ListingCity); } if ( !empty( $listingProvince ) ) { $listing_full_address_path.='-'.trim($listingProvince); } $listing_full_address_path_results = str_replace('-', ' ', $listing_full_address_path); //if (isset( $listing_full_address_path )&& !empty( $listing_full_address_path) && $listing_full_address_path != '') { $html .='
  • '; $html .='
    '; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_addressbar = $Showcase_crea_grid_view_color_array_results['gridShowcaseAddressBarColor']; if( isset( $Showcase_crea_grid_view_addressbar ) && !empty( $Showcase_crea_grid_view_addressbar ) ) { $Showcase_crea_grid_view_addressbar_result = $Showcase_crea_grid_view_addressbar; } else { $Showcase_crea_grid_view_addressbar_result = '8FC2FF'; } } $html .='

    '.strip_tags(substr($listing_full_address_path_results,0,15)).'...

    '; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_Status = $Showcase_crea_grid_view_color_array_results['gridShowcaseStatusBoxColor']; if( isset( $Showcase_crea_grid_view_Status ) && !empty( $Showcase_crea_grid_view_Status ) ) { $Showcase_crea_grid_view_status_result = $Showcase_crea_grid_view_Status; } else { $Showcase_crea_grid_view_status_result = '8FC2FF'; } } $html .='
    '; $html .='
    '; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_text = $Showcase_crea_grid_view_color_array_results['gridShowcaseTextColor']; if( isset( $Showcase_crea_grid_view_text ) && !empty( $Showcase_crea_grid_view_text ) ) { $Showcase_crea_grid_view_text_result = $Showcase_crea_grid_view_text; } else { $Showcase_crea_grid_view_text_result = '8FC2FF'; } } if ( !empty($ListingBedRooms) && $ListingBedRooms > 0){ $html .=''.$ListingBedRooms.' Bedrooms'; } else { $html .='0 Bedrooms'; } if ( !empty($ListingBathrooms) && $ListingBathrooms > 0){ $html .=''.$ListingBathrooms.' Bathrooms'; } else { $html .='0 Bathrooms'; } $html .='
    '; $html .=''; $html .='
  • '; $singleListingConter++; //} } else { if( !isset( $singleListing->RecordsReturned )) { $listing_full_address_path = ''; if ( !empty($singleListing->StreetAddress) && !empty( $singleListing->City ) && !empty( $singleListing->Province ) ) { if ( !empty( $singleListing->StreetAddress ) ) { $singleListingStreetAddress = trim($singleListing->StreetAddress); $singleListingStreetAddress = str_replace(' ', '-', $singleListingStreetAddress); $singleListingStreetAddress = str_replace('#', '', $singleListingStreetAddress); $singleListingStreetAddress = str_replace('--','-',$singleListingStreetAddress); $singleListingStreetAddress = str_replace('--','-',$singleListingStreetAddress); $singleListingStreetAddress = str_replace('---','-',$singleListingStreetAddress); $listing_full_address_path.= $singleListingStreetAddress; } if ( !empty( $singleListing->City ) ) { $singleListingStreetCity = trim($singleListing->City); $singleListingStreetCity = str_replace(' ', '-', $singleListingStreetCity); $singleListingStreetCity = str_replace('#','',$singleListingStreetCity); $singleListingStreetCity = str_replace('--','-',$singleListingStreetCity); $singleListingStreetCity = str_replace('---','-',$singleListingStreetCity); $listing_full_address_path.='-'.trim($singleListingStreetCity); } if ( !empty( $singleListing->Province ) ) { $singleListingStreetProvince = trim($singleListing->Province); $singleListingStreetProvince = str_replace(' ', '-', $singleListingStreetProvince); $singleListingStreetProvince = str_replace('#','',$singleListingStreetProvince); $singleListingStreetProvince = str_replace('--','-',$singleListingStreetProvince); $singleListingStreetProvince = str_replace('---','-',$singleListingStreetProvince); $listing_full_address_path.='-'.trim($singleListingStreetProvince); } } else { if ( !empty( $singleListing->generated_address ) ) { $singleListinggeneratedAddress = trim($singleListing->generated_address); $singleListinggeneratedAddress = str_replace(' ', '-', $singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('#','',$singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('--','-',$singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('---','-',$singleListinggeneratedAddress); $listing_full_address_path.= $singleListinggeneratedAddress; } } $listing_openHouses = $singleListing->listing_openHouses; $listing_full_address_path_results = str_replace('-', ' ', $listing_full_address_path); if (isset( $listing_full_address_path )&& !empty( $listing_full_address_path) && $listing_full_address_path != '') { $html .='
  • '; $html .='
    '; $html .= '
    '; $Showcase_crea_grid_view_addressbar_result =''; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_addressbar = $Showcase_crea_grid_view_color_array_results['gridShowcaseAddressBarColor']; if( isset( $Showcase_crea_grid_view_addressbar ) && !empty( $Showcase_crea_grid_view_addressbar ) ) { $Showcase_crea_grid_view_addressbar_result = $Showcase_crea_grid_view_addressbar; } else { $Showcase_crea_grid_view_addressbar_result = '8FC2FF'; } } $Showcase_crea_grid_view_status_result =''; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_Status = $Showcase_crea_grid_view_color_array_results['gridShowcaseStatusBoxColor']; if( isset( $Showcase_crea_grid_view_Status ) && !empty( $Showcase_crea_grid_view_Status ) ) { $Showcase_crea_grid_view_status_result = $Showcase_crea_grid_view_Status; } else { $Showcase_crea_grid_view_status_result = '8FC2FF'; } } if ( $singleListing->listing_photos != null ) { if ( isset( $singleListing->listing_photos) && !empty( $singleListing->listing_photos ) ) { if( !empty( $singleListing->listing_photos )) { $domain_name = $_SERVER['SERVER_NAME']; $singleListingimag_array = explode('/',$singleListing->listing_photos[0]->URL); if( !empty($singleListingimag_array )){ $single_listing_carousel = $singleListingimag_array[2]; if( $domain_name == $single_listing_carousel ){ list($width, $height, $type, $attr) = getimagesize($singleListing->listing_photos->URL); if( !empty( $width ) && $width !='0') { $singleListingImage = $singleListing->listing_photos->URL; } else { $singleListingImage = $site_image_path; } } else if( $domain_name != $single_listing_carousel && $single_listing_carousel !='static.aretk.com' ) { $singleListingImage = $site_image_path; } else { $singleListingImage = $singleListing->listing_photos[0]->URL; } } } } else { $domain_name = $_SERVER['SERVER_NAME']; $singleListingimag_array = explode('/',$singleListing->listing_photos[0]->URL); if( !empty($singleListingimag_array )){ $single_listing_carousel = $singleListingimag_array[2]; if( $domain_name == $single_listing_carousel ){ list($width, $height, $type, $attr) = getimagesize($singleListing->listing_photos->URL); if( !empty( $width ) && $width !='0') { $singleListingImage = $singleListing->listing_photos->URL; } else { $singleListingImage = $site_image_path; } } else if( $domain_name != $single_listing_carousel && $single_listing_carousel !='static.aretk.com' ) { $singleListingImage = $site_image_path; } else { $singleListingImage = $singleListing->listing_photos[0]->URL; } } /*$singleListingImage = $singleListing->listing_photos[0]->URL;*/ } } else { $singleListingImage = $site_image_path; } $is_exclusive_list = ''; $property_link_url = ''; if ( !empty( $singleListing->mlsID ) && $singleListing->mlsID == 'Exclusive'){ $is_exclusive_list = '/exclusive'; $property_link_url = site_url().'/listing-detail/'.$singleListing->ID.$is_exclusive_list.'/'.$listing_full_address_path; } else { $property_link_url = site_url().'/listing-detail/'.$singleListing->ID.'/'.$listing_full_address_path; } $Showcase_crea_listing_color_title = ''; if( !empty( $Showcase_crea_listing_color_title ) && $Showcase_crea_listing_color_title !=''){ $Showcase_crea_listing_color_title = $Showcase_crea_listing_color_title; } $html .='
    '; $html.='

    MLS®#'.$singleListing->mlsID.'

    '.strip_tags(substr($listing_full_address_path_results,0,15)).'...

    '; $html .='
    '; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results ) ) { $Showcase_crea_grid_view_text = $Showcase_crea_grid_view_color_array_results['gridShowcaseTextColor']; if( isset( $Showcase_crea_grid_view_text ) && !empty( $Showcase_crea_grid_view_text ) ) { $Showcase_crea_grid_view_text_result = $Showcase_crea_grid_view_text; } else { $Showcase_crea_grid_view_text_result = '8FC2FF'; } } if ( !empty($singleListing->BedroomsTotal) && $singleListing->BedroomsTotal > 0 ){ $html .=''.$singleListing->BedroomsTotal.' Bedrooms'; } else { $html .='0 Bedroom'; } if ( !empty($singleListing->BathroomTotal) && $singleListing->BathroomTotal > 0 ){ $html .=''.$singleListing->BathroomTotal.' Bathrooms'; } else{ $html .='0 Bathroom'; } $html .='
    '; $html .=''; $html .='
    '; $html .='
    '; $html .='
  • '; $singleListingConter++; } } } } $html .='
'; $html .= '
'; $html .= '
'; $html .= '
'; $Showcase_crea_grid_view_color_pagination = "DB5C04"; $Showcase_crea_grid_view_text_color_pagination ="00000"; if( isset( $Showcase_crea_grid_view_color_array_results ) && !empty( $Showcase_crea_grid_view_color_array_results )){ $Showcase_crea_grid_view_color_pagination = $Showcase_crea_grid_view_color_array_results['gridShowcasePaginationColor']; $Showcase_crea_grid_view_text_color_pagination = $Showcase_crea_grid_view_color_array_results['gridShowcasePaginationTextColor']; } ?> 0 ){ //$html .= ''; $html .=''; } $html .= '
'; if ( !empty($showcse_crea_feed_ddf_type) && !empty( $showcse_crea_feed_ddf_type) && !empty($getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' && $allLisgngFinalArrCount > 0){ $html .='

MLS®, REALTOR®, and the associated logos are trademarks of The Canadian Real Estate Association.

'; } //Terms of use /*if( empty( $_COOKIE["aretk_crea_terms_of_use"] ) && !empty($showcse_crea_feed_ddf_type) && isset( $getSubscriptionListingFeed ) && !empty( $getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' ) { $html.='

Terms & Conditions Agreement

The listing content on this website is protected by copyright and other laws, and is intended solely for the private, non-commercial use by individuals. Any other reproduction, distribution or use of the content, in whole or in part, is specifically forbidden. The prohibited uses include commercial use, "screen scraping", "database scraping", and any other activity intended to collect, store, reorganize or manipulate data on the pages produced by or displayed on this website.

REALTOR®, REALTORS®, and the REALTOR® logo are certification marks that are owned by REALTOR® Canada Inc. and licensed exclusively to The Canadian Real Estate Association (CREA). These certification marks identify real estate professionals who are members of CREA and who must abide by CREA\'s By-Laws, Rules, and the REALTOR® Code. The MLS® trademark and the MLS® logo are owned by CREA and identify the quality of services provided by real estate professionals who are members of CREA.

The information contained on this site is based in whole or in part on information that is provided by members of The Canadian Real Estate Association, who are responsible for its accuracy. CREA reproduces and distributes this information as a service for its members and assumes no responsibility for its accuracy.

'; }*/ } else { $html .='

Sorry no properties found

'; } //END Grid View Html } if( $showcse_crea_display_theams_option == 'Map' ) { //Start map view search $html =''; $html ='
'; $html ='
'; $html .=''; $html .=''; $html .=''; $html .='
'; $html .=''; $html .=''; $html .=''; $html .=''; $html .=''; $html .=''; $html .=''; $google_map_api_key_setting = get_option('google-map-api-name',''); if( !empty( $google_map_api_key_setting ) && isset( $google_map_api_key_setting )) { $html .='
'; $html .='
'; $html .='
'; } else { $html .='
'; $html .='
Please Enter Google Map APi Key in Plugin Setting
'; $html .='
'; } $html .='
'; $html .=''; $html .='
'; $html .='
'; if ( !empty($showcse_crea_feed_ddf_type) && !empty( $showcse_crea_feed_ddf_type) && !empty($getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' ){ $html .='

MLS®, REALTOR®, and the associated logos are trademarks of The Canadian Real Estate Association.

'; } //Terms of use /*if( empty( $_COOKIE["aretk_crea_terms_of_use"] ) && !empty($showcse_crea_feed_ddf_type) && isset( $getSubscriptionListingFeed ) && !empty( $getSubscriptionListingFeed) && $getSubscriptionListingFeed === 'valid' ) { $html.='

Terms & Conditions Agreement

The listing content on this website is protected by copyright and other laws, and is intended solely for the private, non-commercial use by individuals. Any other reproduction, distribution or use of the content, in whole or in part, is specifically forbidden. The prohibited uses include commercial use, "screen scraping", "database scraping", and any other activity intended to collect, store, reorganize or manipulate data on the pages produced by or displayed on this website.

REALTOR®, REALTORS®, and the REALTOR® logo are certification marks that are owned by REALTOR® Canada Inc. and licensed exclusively to The Canadian Real Estate Association (CREA). These certification marks identify real estate professionals who are members of CREA and who must abide by CREA\'s By-Laws, Rules, and the REALTOR® Code. The MLS® trademark and the MLS® logo are owned by CREA and identify the quality of services provided by real estate professionals who are members of CREA.

The information contained on this site is based in whole or in part on information that is provided by members of The Canadian Real Estate Association, who are responsible for its accuracy. CREA reproduces and distributes this information as a service for its members and assumes no responsibility for its accuracy.

'; }*/ $html .='
'; $html .='
'; } } echo $html; get_footer();