prefix . CREA_USER_LISTING_DETAILS; $getAllUsername = $wpdb->get_results("SELECT username FROM $crea_user_name_table_name"); $getSubscriptionListingFilter = get_option('crea_subscription_status', ''); if( isset( $getSubscriptionListingFilter ) && !empty( $getSubscriptionListingFilter ) && $getSubscriptionListingFilter === 'valid' && empty($listing_type) && $listing_type != 'exclusive' ) { if ( !empty($is_exclusive) && $is_exclusive == 'exclusive' ) { $listings = Aretk_Crea_Admin::get_property_detail_page_result_for_exclusive($listing_id); $listings = json_decode(json_encode($listings)); if ( isset($listings) && !empty($listings)) { foreach ($listings as $listing_key => $listing ){ if ( !isset( $listing->TotalRecords ) && empty( $listing->TotalRecords ) ) { $allListingArr[$listing->ID] = $listing; } } } } else { $allListingArr = array(); if (isset($getAllUsername) && !empty($getAllUsername)) { foreach ($getAllUsername as $singleUsername) { $userName = $singleUsername->username; $result_type = 'full'; $listings = Aretk_Crea_Admin::get_property_detail_page_result($userName, $result_type,$listing_id); # JSON Encode data to work properly with old listing details template $listings = json_decode(json_encode($listings), false); if ( isset($listings) && !empty($listings)) { foreach ($listings as $listing_key => $listing ){ if ( !isset( $listing->TotalRecords ) && empty( $listing->TotalRecords ) ) { $allListingArr[$listing->ID] = $listing; } } } unset($singleUsername); } unset($getAllUsername); $property_record_returned = $listings[0]->RecordsReturned; } } $crea_property_detail_page = (object) $allListingArr[$listing_id]; if ( !empty( $allListingArr[$listing_id] ) && isset( $allListingArr[$listing_id] ) ) { //address link url $listing_full_address_path_url = ''; if ( !empty($crea_property_detail_page->StreetAddress) && !empty( $crea_property_detail_page->City ) && !empty( $crea_property_detail_page->Province ) ) { if ( !empty( $crea_property_detail_page->StreetAddress ) ) { $singleListingStreetAddress = trim($crea_property_detail_page->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_url.= $singleListingStreetAddress; } if ( !empty( $crea_property_detail_page->City ) ) { $singleListingStreetCity = trim($crea_property_detail_page->City); $singleListingStreetCity = str_replace(' ', '-', $singleListingStreetCity); $singleListingStreetCity = str_replace('#', '', $singleListingStreetCity); $singleListingStreetCity = str_replace('-','-',$singleListingStreetCity); $singleListingStreetCity = str_replace('--','-',$singleListingStreetCity); $singleListingStreetCity = str_replace('---','-',$singleListingStreetCity); $listing_full_address_path_url.='-'.trim($singleListingStreetCity); } if ( !empty( $crea_property_detail_page->Province ) ) { $singleListingStreetProvince = trim($crea_property_detail_page->Province); $singleListingStreetProvince = str_replace(' ', '-', $singleListingStreetProvince); $singleListingStreetProvince = str_replace('#', '', $singleListingStreetProvince); $singleListingStreetProvince = str_replace('-','-',$singleListingStreetProvince); $singleListingStreetProvince = str_replace('--','-',$singleListingStreetProvince); $singleListingStreetProvince = str_replace('---','-',$singleListingStreetProvince); $listing_full_address_path_url.='-'.trim($singleListingStreetProvince); } } else { if ( !empty( $crea_property_detail_page->generated_address ) ) { $singleListinggeneratedAddress = trim($crea_property_detail_page->generated_address); $singleListinggeneratedAddress = str_replace(' ', '-', $singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('#', '', $singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('--','-',$singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('--','-',$singleListinggeneratedAddress); $singleListinggeneratedAddress = str_replace('---','-',$singleListinggeneratedAddress); $listing_full_address_path_url.= $singleListinggeneratedAddress; } } if( (!empty( $crea_property_detail_page->mlsID ) || $crea_property_detail_page->mlsID == 'Exclusive') && $listing_full_address_path_url === $listing_get_full_address ) { $post_listing_detail_count_table = $wpdb->prefix.CREA_LISTING_DETAIL_COUNT; $page_visit_view_counter = 1; $property_detail_exclusive_or_not_results = "In-Exclusive"; if(isset( $is_exclusive ) && !empty( $is_exclusive ) && $is_exclusive == 'exclusive'){ $property_detail_exclusive_or_not_results = "Exclusive"; } $getlisting_detail_count_results = "SELECT * FROM $post_listing_detail_count_table WHERE `property_id`=$listing_id"; $getlisting_detail_count_results_array = $wpdb->get_results($getlisting_detail_count_results); if(isset( $getlisting_detail_count_results_array ) && empty( $getlisting_detail_count_results_array )){ $wpdb->insert( $post_listing_detail_count_table, array( 'property_id' => $listing_id, 'property_type' => $property_detail_exclusive_or_not_results ,'view_count' => $page_visit_view_counter ), array( '%s','%s', '%d' ) ); }else { foreach ( $getlisting_detail_count_results_array as $getlisting_detail_count_results_array_listings ) { $page_visit_view_counter = $getlisting_detail_count_results_array[0]->view_count; } $page_visit_view_counter = $page_visit_view_counter+1; $wpdb->update( $post_listing_detail_count_table, array( 'property_type' => $property_detail_exclusive_or_not_results,'view_count'=>$page_visit_view_counter), array( 'property_id' => $listing_id ), array( '%s', '%s' ), array( '%d' ) ); } $postId = $listing_id; $listing_count = $page_visit_view_counter; Aretk_Crea_Public::update_view_count( $postId, $listing_count ); } $crea_listing_price = ''; $crea_listing_price = $crea_property_detail_page->Price; if( $crea_listing_price === "0.00" ){ $crea_listing_price = $crea_property_detail_page->Lease; } $crea_listing_price = !empty($crea_listing_price) ? number_format($crea_listing_price) : ''; $crea_property_detail_page_exclusive_or_not = !empty($crea_property_detail_page->mlsID) ? $crea_property_detail_page->mlsID :''; $listingFullAddress = !empty( $crea_property_detail_page->generated_address ) ? $crea_property_detail_page->generated_address :''; $listingFullAddress = !empty($listingFullAddress) ? $listingFullAddress : ''; $listingDescription = !empty( $crea_property_detail_page->PublicRemarks ) ? $crea_property_detail_page->PublicRemarks :'' ; $listingDescription = !empty($listingDescription) ? $listingDescription : ''; $listingTransactionType = !empty($crea_property_detail_page->TransactionType ) ? $crea_property_detail_page->TransactionType :''; $listingTransactionType = !empty($listingTransactionType) ? $listingTransactionType : ''; $listingPropertyBathRooms = !empty($crea_property_detail_page->BathroomTotal) ? $crea_property_detail_page->BathroomTotal :''; $listingPropertyBathRooms = !empty($listingPropertyBathRooms) ? $listingPropertyBathRooms : ''; //Address Tab $listingAddress = !empty($crea_property_detail_page->AddressLine1)? $crea_property_detail_page->AddressLine1 :''; $listingAddress = !empty($listingAddress) ? $listingAddress : ''; $listingCity = !empty($crea_property_detail_page->City) ? $crea_property_detail_page->City : ''; $listingCity = !empty($listingCity) ? $listingCity : ''; $listingPostalCode = !empty($crea_property_detail_page->PostalCode) ? $crea_property_detail_page->PostalCode :'' ; $listingPostalCode = !empty($listingPostalCode) ? $listingPostalCode : ''; $listingCountry = !empty($crea_property_detail_page->Country) ? $crea_property_detail_page->Country :'' ; $listingCountry = !empty($listingCountry) ? $listingCountry : ''; $listing_full_address_path_for_meta_title = ''; if ( !empty( $crea_property_detail_page->StreetAddress ) ) { $listing_full_address_path_for_meta_title.= $crea_property_detail_page->StreetAddress; } if ( !empty( $crea_property_detail_page->City ) ) { $listing_full_address_path_for_meta_title.= " ".$crea_property_detail_page->City; } if ( !empty( $crea_property_detail_page->Province ) ) { $listing_full_address_path_for_meta_title.= ' '.$crea_property_detail_page->Province; } $listing_full_address_path_for_meta_title = !empty( $listing_full_address_path_for_meta_title ) ? $listing_full_address_path_for_meta_title : 'Address not available'; //Details Tab $listingLID= !empty($crea_property_detail_page->LID ) ? $crea_property_detail_page->LID :''; $listingPrice = !empty($crea_property_detail_page->Price ) ? $crea_property_detail_page->Price :''; //Details Tab if( !empty( $crea_property_detail_page ) && $crea_property_detail_page !=''){ if( !empty( $crea_property_detail_page->Price ) && isset( $crea_property_detail_page->Price ) && $crea_property_detail_page->Price == '0.00' ) { $listingPrice = number_format($crea_property_detail_page->Lease) ; } else { $listingPrice = number_format($crea_property_detail_page->Price); } } //$listingPrice = !empty($listingPrice) ? number_format($listingPrice) : ''; $listingBathroomTotal = !empty( $crea_property_detail_page->BathroomTotal ) ? $crea_property_detail_page->BathroomTotal :''; $listingPropertyBathRooms = !empty($listingBathroomTotal) ? $listingBathroomTotal : ''; $listingBedroomsTotal = !empty($crea_property_detail_page->BedroomsTotal) ? $crea_property_detail_page->BedroomsTotal :''; $listingBedroomsTotal = !empty($listingBedroomsTotal) ? $listingBedroomsTotal : ''; if( !empty( $crea_property_detail_page ) && $crea_property_detail_page !=''){ if( !empty( $crea_property_detail_page->listing_rooms) && isset( $crea_property_detail_page->listing_rooms)){ $listingRoomsTotal = count($crea_property_detail_page->listing_rooms); $listingRoomsTotal = !empty($listingRoomsTotal) ? $listingRoomsTotal : ''; } } $listingAppliances = !empty($crea_property_detail_page->Appliances)?$crea_property_detail_page->Appliances:''; $listingAppliances = !empty($listingAppliances) ? $listingAppliances : ''; $listingFeatures = !empty($crea_property_detail_page->Features)?$crea_property_detail_page->Features:''; $listingFeatures = !empty($listingFeatures) ? $listingFeatures : ''; //Agents Array $listingPropertyListingAgents = !empty($crea_property_detail_page->listing_agents)? $crea_property_detail_page->listing_agents :''; $listingPropertyListingAgents = !empty($listingPropertyListingAgents) ? $listingPropertyListingAgents : array(); $listingPropertyListingRoom = !empty( $crea_property_detail_page->listing_rooms ) ? $crea_property_detail_page->listing_rooms :''; $listingPropertyListingRoom = !empty($listingPropertyListingRoom) ? $listingPropertyListingRoom : array(); $is_exclusive_list = ''; $property_link_url = ''; if(!empty( $crea_property_detail_page ) && $crea_property_detail_page !=''){ if ( !empty( $crea_property_detail_page->mlsID ) && $crea_property_detail_page->mlsID == 'Exclusive'){ $is_exclusive_list = '/exclusive'; $property_link_url = site_url().'/listing-detail/'.$crea_property_detail_page->ID.$is_exclusive_list.'/'.$listing_full_address_path_url; } else { $property_link_url = site_url().'/listing-detail/'.$crea_property_detail_page->ID.'/'.$listing_full_address_path_url; } } $site_image_path = ARETK_CREA_PLUGIN_URL.'public/images/preview_img.jpg'; if ( $crea_property_detail_page->listing_photos != null ) { if ( isset( $crea_property_detail_page->listing_photos) && !empty( $crea_property_detail_page->listing_photos ) && !is_array($crea_property_detail_page->listing_photos) ){ if( !empty( $crea_property_detail_page->listing_photos )) { $domain_name = $_SERVER['SERVER_NAME']; $singleListingimag_array = explode('/',$crea_property_detail_page->listing_photos->URL); if( !empty($singleListingimag_array )){ $single_listing_carousel = $singleListingimag_array[2]; if( $domain_name == $single_listing_carousel ){ list($width, $height, $type, $attr) = getimagesize($crea_property_detail_page->listing_photos->URL); if( !empty( $width ) && $width !='0') { $singleListingImage = $crea_property_detail_page->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 = $crea_property_detail_page->listing_photos->URL; } } } } else { $singleListingImage = $crea_property_detail_page->listing_photos[0]->URL; } } else { $singleListingImage = $site_image_path; } ?>
® #".$crea_property_detail_page->mlsID; ?>
". $crea_property_detail_page->PublicRemarks."
"; } ?>Room Dimension
Type; ?> Dimension; ?>
Listed By:
MLS®, REALTOR®, and the associated logos are trademarks of The Canadian Real Estate Association.
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.