Changeset 3154099
- Timestamp:
- 09/18/2024 07:01:43 PM (17 months ago)
- Location:
- flexmls-idx/trunk
- Files:
-
- 14 edited
-
README.txt (modified) (2 diffs)
-
SparkAPI/Core.php (modified) (2 diffs)
-
components/search.php (modified) (2 diffs)
-
components/v2/search.php (modified) (2 diffs)
-
flexmls_connect.php (modified) (2 diffs)
-
lib/base.php (modified) (7 diffs)
-
lib/flexmlsAPI/Core.php (modified) (1 diff)
-
lib/gutenberg.php (modified) (1 diff)
-
pages/core.php (modified) (4 diffs)
-
pages/listing-details.php (modified) (6 diffs)
-
pages/next-listing.php (modified) (1 diff)
-
pages/prev-listing.php (modified) (1 diff)
-
views/v2/fmcListingDetails.php (modified) (2 diffs)
-
views/v2/fmcSearchResults/_listings_list.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexmls-idx/trunk/README.txt
r3135793 r3154099 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 3.14.2 07 Stable tag: 3.14.21 8 8 9 9 Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site. … … 86 86 87 87 == Changelog == 88 = 3.14.21 = 89 Efficiency Update 90 * PHP Warnings and Deprecation Notifications Resolved 91 * Updated Block Categories for Gutenberg editor 92 * Listing Not Available page set to noindex and nofollow 93 * Subdivision is now a sticky value in the IDX Search widget 94 * Listing Agent IDX Display Requirement Resolved For V2 Listing Template 95 * Updated Plugin Pages To Use WP get_post Method 96 88 97 = 3.14.20 = 89 98 Efficiency Update -
flexmls-idx/trunk/SparkAPI/Core.php
r3094799 r3154099 88 88 'X-SparkApi-User-Agent' => 'flexmls-WordPress-Plugin/' . $this->plugin_version, 89 89 'X-WP-User-Agent' => $this->user_agent, 90 'X- WP-Client-IP' => $this->user_ip90 'X-User-IP-Address' => $this->user_ip 91 91 ); 92 92 } … … 811 811 ksort( $params ); 812 812 foreach ( $params as $key => $value ) { 813 $value = ( !is_null($value) ) ? $value : ''; 813 814 $security_string .= $key . $value; 814 815 $params[ $key ] = rawurlencode( $value ); -
flexmls-idx/trunk/components/search.php
r3059250 r3154099 53 53 54 54 $all_location_fields = array('City', 'StateOrProvince', 'PostalCode', 'CountyOrParish', 'MLSAreaMajor', 55 'MLSAreaMinor', 'StreetAddress', 'ListingId', 'Location' );55 'MLSAreaMinor', 'StreetAddress', 'ListingId', 'Location', 'SubdivisionName'); 56 56 57 57 $location_fields = array(); … … 66 66 $property_type_enabled = (array_key_exists('property_type_enabled', $settings)) ? trim($settings['property_type_enabled']) : "on" ; 67 67 $property_type = isset($settings['property_type'])? trim($settings['property_type']) : null; 68 $property_types_selected = explode(",", $property_type );68 $property_types_selected = explode(",", $property_type ?? ''); 69 69 $std_fields = isset($settings['std_fields'])? trim($settings['std_fields']) : null; 70 $std_fields_selected = explode(",", $std_fields );70 $std_fields_selected = explode(",", $std_fields ?? ''); 71 71 $allow_sold_searching = isset($settings['allow_sold_searching']) ? $settings['allow_sold_searching'] : null; 72 72 $allow_pending_searching = array_key_exists('allow_pending_searching',$settings) ? $settings['allow_pending_searching'] : null; -
flexmls-idx/trunk/components/v2/search.php
r2926110 r3154099 60 60 61 61 $all_location_fields = array('City', 'StateOrProvince', 'PostalCode', 'CountyOrParish', 'MLSAreaMajor', 62 'MLSAreaMinor', 'StreetAddress', 'ListingId', 'Location' );62 'MLSAreaMinor', 'StreetAddress', 'ListingId', 'Location', 'SubdivisionName'); 63 63 64 64 $location_fields = array(); … … 73 73 $property_type_enabled = (array_key_exists('property_type_enabled', $settings)) ? trim($settings['property_type_enabled']) : "on" ; 74 74 $property_type = isset($settings['property_type'])? trim($settings['property_type']) : null; 75 $property_types_selected = explode(",", $property_type );75 $property_types_selected = explode(",", $property_type ?? ''); 76 76 $std_fields = isset($settings['std_fields'])? trim($settings['std_fields']) : null; 77 $std_fields_selected = explode(",", $std_fields );77 $std_fields_selected = explode(",", $std_fields ?? ''); 78 78 $allow_sold_searching = isset($settings['allow_sold_searching']) ? $settings['allow_sold_searching'] : null; 79 79 $allow_pending_searching = array_key_exists('allow_pending_searching',$settings) ? $settings['allow_pending_searching'] : null; -
flexmls-idx/trunk/flexmls_connect.php
r3135793 r3154099 6 6 Description: Provides Flexmls® Customers with Flexmls® IDX features on their WordPress websites. <strong>Tips:</strong> <a href="admin.php?page=fmc_admin_settings">Activate your Flexmls® IDX plugin</a> on the settings page; <a href="widgets.php">add widgets to your sidebar</a> using the Widgets Admin under Appearance; and include widgets on your posts or pages using the Flexmls® IDX Widget Short-Code Generator on the Visual page editor. 7 7 Author: FBS 8 Version: 3.14.2 08 Version: 3.14.21 9 9 Author URI: https://www.flexmls.com 10 10 Requires at least: 5.0 … … 17 17 const FMC_API_BASE = 'sparkapi.com'; 18 18 const FMC_API_VERSION = 'v1'; 19 const FMC_PLUGIN_VERSION = '3.14.2 0';19 const FMC_PLUGIN_VERSION = '3.14.21'; 20 20 21 21 define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
flexmls-idx/trunk/lib/base.php
r3094799 r3154099 265 265 */ 266 266 267 $show_link = ( $query_url_parse['host'] == 'link.flexmls.com' ) ? $query_url : flexmlsConnect::get_default_idx_link_url();267 $show_link = ( isset($query_url_parse['host']) && $query_url_parse['host'] == 'link.flexmls.com' ) ? $query_url : flexmlsConnect::get_default_idx_link_url(); 268 268 269 269 if(strpos($show_link, 'StreetAddress')){ … … 626 626 } 627 627 628 $content = get_p age($neigh_template_page_id);628 $content = get_post($neigh_template_page_id); 629 629 return $content->post_content; 630 630 … … 727 727 static function format_listing_street_address($data) { 728 728 729 $listing = $data['StandardFields'] ;729 $listing = $data['StandardFields'] ?? []; 730 730 $first_line_address = (flexmlsConnect::is_not_blank_or_restricted($listing['UnparsedFirstLineAddress'])) ? $listing['UnparsedFirstLineAddress'] : ""; 731 731 $second_line_address = ""; … … 873 873 $AttributionContact = null; 874 874 875 $GetListingOfficeInfo = $fmc_api->GetAccount($sf['ListOfficeId']) ;876 $GetListingAgentInfo = $fmc_api->GetAccount($sf['ListAgentId']) ;877 878 if ( flexmlsConnect::is_not_blank_or_restricted( $sf['AttributionContact'] ) ) {875 $GetListingOfficeInfo = $fmc_api->GetAccount($sf['ListOfficeId']) ?? ''; 876 $GetListingAgentInfo = $fmc_api->GetAccount($sf['ListAgentId']) ?? ''; 877 878 if ( isset( $sf['AttributionContact'] ) && flexmlsConnect::is_not_blank_or_restricted( $sf['AttributionContact'] ) ) { 879 879 $AttributionContact = $sf['AttributionContact']; 880 880 } 881 elseif ( flexmlsConnect::is_not_blank_or_restricted( $GetListingAgentInfo['AttributionContact'] ) ) {881 elseif ( isset( $sf['AttributionContact'] ) && flexmlsConnect::is_not_blank_or_restricted( $GetListingAgentInfo['AttributionContact'] ) ) { 882 882 $AttributionContact = $GetListingAgentInfo['AttributionContact']; 883 883 } 884 elseif ( flexmlsConnect::is_not_blank_or_restricted( $GetListingOfficeInfo['AttributionContact'] ) ) {884 elseif ( isset( $sf['AttributionContact'] ) && flexmlsConnect::is_not_blank_or_restricted( $GetListingOfficeInfo['AttributionContact'] ) ) { 885 885 $AttributionContact = $GetListingOfficeInfo['AttributionContact']; 886 886 } … … 939 939 940 940 return (in_array("ListOfficeName",$compList)); 941 } 942 943 static function mls_requires_agent_name_in_search_results() { 944 global $fmc_api; 945 $api_system_info = $fmc_api->GetSystemInfo(); 946 $mlsId = $api_system_info["MlsId"]; 947 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Summary"]["DisplayCompliance"]); 948 949 return (in_array("ListAgentName", $compList)); 941 950 } 942 951 … … 1312 1321 } 1313 1322 1323 static public function is_portal_on() { 1324 global $fmc_api; 1325 1326 $portal = $fmc_api->GetPortal(); 1327 1328 return (bool)$portal[0]['Enabled']; 1329 } 1330 1314 1331 static function get_portal_slug() { 1315 1332 global $fmc_api; … … 1317 1334 $portal_slug = null; 1318 1335 $portal = $fmc_api->GetPortal(); 1319 1320 if( sizeof($portal) > 0 && array_key_exists('DisplayName', $portal[0]) && !empty($portal[0]['DisplayName'])){ 1336 $portal_on = flexmlsConnect::is_portal_on(); 1337 1338 if ( $portal_on ) { 1321 1339 $portal_slug = $portal[0]['DisplayName']; 1322 1340 } else { -
flexmls-idx/trunk/lib/flexmlsAPI/Core.php
r3135793 r3154099 44 44 'Accept-Encoding' => "gzip,deflate", 45 45 'Content-Type' => "application/json", 46 'User-Agent' => "FlexMLS WordPress Plugin/3.14.2 0",47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.14.2 0"46 'User-Agent' => "FlexMLS WordPress Plugin/3.14.21", 47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.14.21" 48 48 ); 49 49 -
flexmls-idx/trunk/lib/gutenberg.php
r2564556 r3154099 103 103 return; 104 104 105 add_filter( 'block_categories ', function( $categories, $post ) {105 add_filter( 'block_categories_all', function( $categories, $post ) { 106 106 return array_merge( 107 107 $categories, -
flexmls-idx/trunk/pages/core.php
r2984660 r3154099 32 32 $this->standard_fields = $result[0] ?? ''; 33 33 34 $account_mls_id = $this->account->MlsId ?? ''; 35 34 36 //WP-1020 - ORE 35 $sf_sqft_value = ($ this->account->MlsId == "20191104230040909159000000") ? 'LivingArea' : 'BuildingAreaTotal';37 $sf_sqft_value = ($account_mls_id == "20191104230040909159000000") ? 'LivingArea' : 'BuildingAreaTotal'; 36 38 37 39 … … 453 455 $this->build_browse_list( flexmlsConnect::wp_input_get('pg') ); 454 456 455 if ( $no_more == false) {457 if ( isset( $no_more ) && !$no_more) { 456 458 $this->build_browse_list( flexmlsConnect::wp_input_get('pg') + 1 ); 457 459 } … … 467 469 } 468 470 469 if ( array_key_exists((string) $this_listings_index-1, $this->browse_list) ) { 470 $previous_listing_url = $this->browse_list[(string) $this_listings_index-1]['Uri']; 471 } 472 if ( array_key_exists((string) $this_listings_index+1, $this->browse_list) ) { 473 $next_listing_url = $this->browse_list[(string) $this_listings_index+1]['Uri']; 471 $this_listing_minus = $this_listings_index - 1; 472 $this_listing_add = $this_listings_index + 1; 473 474 if ( array_key_exists( $this_listing_minus, $this->browse_list) ) { 475 $previous_listing_url = $this->browse_list[$this_listing_minus]['Uri']; 476 } 477 478 if ( array_key_exists($this_listing_add, $this->browse_list) ) { 479 $next_listing_url = $this->browse_list[$this_listing_add]['Uri']; 474 480 } 475 481 … … 517 523 518 524 $result_count = 0; 519 foreach ($results as $record) { 520 $result_count++; 521 522 $this_result_overall_index = ($this->api->page_size * ($this->api->current_page - 1)) + $result_count; 523 524 $link_to_details_criteria = $modified_raw_criteria; 525 // figure out if there's a previous listing 526 $link_to_details_criteria['p'] = ($this_result_overall_index != 1) ? 'y' : 'n'; 527 528 // figure out if there's a next listing possible 529 $link_to_details_criteria['n'] = ( $this_result_overall_index < $this->api->last_count ) ? 'y' : 'n'; 530 531 if ($link_to_details_criteria['n'] == 'n') { 532 $this->no_more = true; 533 } 534 535 $this->browse_list[(string) $this_result_overall_index] = array( 536 'Index' => $this_result_overall_index, 537 'Id' => $record['Id'], 538 'ListingId' => $record['StandardFields']['ListingId'], 539 'Uri' => flexmlsConnect::make_nice_address_url($record, $link_to_details_criteria, $this->type) 540 ); 541 542 } 543 544 } 525 if ( is_array($results) ) { 526 foreach ($results as $record) { 527 $result_count++; 528 529 $this_result_overall_index = ($this->api->page_size * ($this->api->current_page - 1)) + $result_count; 530 531 $link_to_details_criteria = $modified_raw_criteria; 532 // figure out if there's a previous listing 533 $link_to_details_criteria['p'] = ($this_result_overall_index != 1) ? 'y' : 'n'; 534 535 // figure out if there's a next listing possible 536 $link_to_details_criteria['n'] = ( $this_result_overall_index < $this->api->last_count ) ? 'y' : 'n'; 537 538 if ($link_to_details_criteria['n'] == 'n') { 539 $this->no_more = true; 540 } 541 542 $this->browse_list[(string) $this_result_overall_index] = array( 543 'Index' => $this_result_overall_index, 544 'Id' => $record['Id'], 545 'ListingId' => $record['StandardFields']['ListingId'], 546 'Uri' => flexmlsConnect::make_nice_address_url($record, $link_to_details_criteria, $this->type) 547 ); 548 549 } 550 551 } 552 } 545 553 546 554 function contact_form_agent_email($standard_fields) { -
flexmls-idx/trunk/pages/listing-details.php
r3135793 r3154099 16 16 add_filter( 'wpseo_title', array( $this, 'wpseo_title' ), 0 ); 17 17 add_filter( 'wpseo_canonical', array( $this, 'wpseo_canonical' ), 0 ); 18 add_filter( 'wp_robots', array($this, ' remove_wp_robots_closed_listing'), 0 );18 add_filter( 'wp_robots', array($this, 'wp_robots_noindex_listing'), 0 ); 19 19 20 20 add_action('wp_head', array($this, 'open_graph_tags'), 0 ); … … 70 70 else { 71 71 $page = flexmlsConnect::get_no_listings_page_number(); 72 $page_data = get_p age($page);72 $page_data = get_post($page); 73 73 $fmc_special_page_caught['page-title'] = "Listing Not Available"; 74 74 $fmc_special_page_caught['post-title'] = $page_data->post_title; … … 92 92 if (flexmlsConnect::get_no_listings_pref() == 'page'){ 93 93 $page = flexmlsConnect::get_no_listings_page_number(); 94 $page_data = get_p age($page);94 $page_data = get_post($page); 95 95 remove_filter('the_content', array('flexmlsConnectPage', 'custom_post_content')); 96 96 echo apply_filters('the_content', $page_data->post_content); … … 702 702 } 703 703 ?> 704 <?php if ( flexmlsConnect::is_not_blank_or_restricted( $sf['CompensationDisclaimer'] ) ) : ?> 704 <?php if ( array_key_exists( 'CompensationDisclaimer', $sf ) ) : ?> 705 <?php if ( flexmlsConnect::is_not_blank_or_restricted( $sf['CompensationDisclaimer'] ) ) : ?> 705 706 <hr /> 706 707 <div class="compensation-disclaimer"> … … 709 710 <hr /> 710 711 <?php endif; ?> 712 <?php endif; ?> 711 713 <?php 712 714 echo "<p>"; … … 755 757 } 756 758 757 function remove_wp_robots_closed_listing($robots) {758 759 $link_criteria_mls_status = $this->listing_data['StandardFields'][' MlsStatus'];759 function wp_robots_noindex_listing($robots) { 760 761 $link_criteria_mls_status = $this->listing_data['StandardFields']['StandardStatus'] ?? ''; 760 762 761 763 if ( $link_criteria_mls_status == 'Closed' && get_option( 'blog_public' ) != 0 ) { 762 $robots['noindex'] = true; 763 $robots['nofollow'] = true; 764 $robots['noindex'] = true; 765 $robots['nofollow'] = true; 766 764 767 return $robots; 765 }766 768 767 return $robots; 768 769 } 769 } 770 771 elseif ( ! isset( $this->listing_data ) ) { 772 773 $robots['noindex'] = true; 774 $robots['nofollow'] = true; 775 776 return $robots; 777 778 } else { 779 780 return $robots; 781 782 } 783 784 } 770 785 771 786 /** -
flexmls-idx/trunk/pages/next-listing.php
r1106081 r3154099 1 1 <?php 2 2 3 #[AllowDynamicProperties] 3 4 class flexmlsConnectPageNextListing extends flexmlsConnectPageCore { 4 5 -
flexmls-idx/trunk/pages/prev-listing.php
r1106081 r3154099 1 1 <?php 2 2 3 #[AllowDynamicProperties] 3 4 class flexmlsConnectPagePrevListing extends flexmlsConnectPageCore { 4 5 -
flexmls-idx/trunk/views/v2/fmcListingDetails.php
r3135793 r3154099 32 32 <h2 class="property-title flexmls-title-largest flexmls-primary-color-font flexmls-heading-font"><?php echo esc_html( $one_line_address ); ?></h2> 33 33 34 <?php if ( strtotime( $sf['OnMarketDate'] ) > strtotime( '-7 days' ) ) : ?> 35 <span class="new-listing-tag">New Listing</span> 34 <?php if ( $sf['OnMarketDate'] ) : ?> 35 <?php if ( strtotime( $sf['OnMarketDate'] ) > strtotime( '-7 days' ) ) : ?> 36 <span class="new-listing-tag">New Listing</span> 37 <?php endif; ?> 36 38 <?php endif; ?> 37 39 </div> … … 319 321 <?php endforeach; ?> 320 322 <?php endif; ?> 321 322 <?php if ( flexmlsConnect::is_not_blank_or_restricted( $sf['CompensationDisclaimer'] ) ) : ?> 323 <hr /> 324 <div class="compensation-disclaimer"> 325 <?php echo $sf['CompensationDisclaimer']; ?> 326 </div> 327 <hr /> 323 324 <?php if ( array_key_exists( 'CompensationDisclaimer', $sf ) ) : ?> 325 <?php if ( flexmlsConnect::is_not_blank_or_restricted( $sf['CompensationDisclaimer'] ) ) : ?> 326 <hr /> 327 <div class="compensation-disclaimer"> 328 <?php echo $sf['CompensationDisclaimer']; ?> 329 </div> 330 <hr /> 331 <?php endif; ?> 328 332 <?php endif; ?> 329 333 -
flexmls-idx/trunk/views/v2/fmcSearchResults/_listings_list.php
r3094799 r3154099 33 33 <?php $main_photo = fmcSearchResults::main_photo_from_collection( $sf['Photos'] ); ?> 34 34 <div class="flexmls-image-wrapper" style="background-image: url('<?php echo esc_url( $main_photo['Uri640'] ); ?>');"> 35 <?php if ( $sf['OnMarketDate'] ) : ?> 35 36 <?php if ( strtotime( $sf['OnMarketDate'] ) > strtotime( '-7 days' ) ) : ?> 36 37 <span class="new-listing-tag">New Listing</span> … … 39 40 <span class="new-listing-tag open-house">Open House</span> 40 41 <?php endif; ?> 42 <?php endif; ?> 41 43 <?php 42 44 … … 104 106 </span> 105 107 <?php endif; ?> 108 109 <?php if ( flexmlsConnect::mls_requires_agent_name_in_search_results() ) : ?> 110 <div class="flexmls-agent-name-and-label-wrapper"> 111 <span class="flexmls-agent-name"> 112 <span class="flexmls-bold-label">Listing Agent: </span> 113 <?php echo esc_html( $sf["ListAgentName"] ); ?> 114 </span> 115 </div> 116 <?php endif; ?> 117 106 118 </div> 107 119 </a>
Note: See TracChangeset
for help on using the changeset viewer.