Changeset 3382863
- Timestamp:
- 10/22/2025 06:33:00 PM (4 months ago)
- Location:
- flexmls-idx/trunk
- Files:
-
- 11 edited
-
README.txt (modified) (2 diffs)
-
components/photos.php (modified) (6 diffs)
-
components/v2/search-results.php (modified) (1 diff)
-
flexmls_connect.php (modified) (2 diffs)
-
integration/elementor/index.php (modified) (1 diff)
-
lib/base.php (modified) (2 diffs)
-
lib/flexmlsAPI/Core.php (modified) (1 diff)
-
pages/listing-details.php (modified) (3 diffs)
-
pages/search-results.php (modified) (2 diffs)
-
views/v2/fmcListingDetails.php (modified) (1 diff)
-
views/v2/fmcSearchResults/_listings_list.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexmls-idx/trunk/README.txt
r3375276 r3382863 5 5 Tested up to: 6.8.3 6 6 Requires PHP: 7.4 7 Stable tag: 3.15. 67 Stable tag: 3.15.7 8 8 9 9 Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site. … … 85 85 86 86 == Changelog == 87 = 3.15.7 = 88 Efficiency Update 89 * Removed Limit URL paramteter applying to IDX Slideshow Listing Links 90 * Refactored IDX Display Requirements 91 * Resolving Elementor Error with Contact Me widget 92 87 93 = 3.15.6 = 88 94 Efficiency Update 89 95 * Improving canonical link priorirty for listing detail pages 90 96 * More PHP warnings resolved 91 92 97 93 98 = 3.15.5 = -
flexmls-idx/trunk/components/photos.php
r3358668 r3382863 252 252 } 253 253 254 254 255 $params['_filter'] = implode(" And ", $filter_conditions); 255 256 $params['_select'] = 'MlsId,ListPrice,ListOfficeId,ListOfficeName,OpenHouses,BedsTotal,BathsTotal, … … 290 291 $pure_conditions['pg'] = array_key_exists('_page', $params) ? $params['_page'] : 1; 291 292 293 // Create a separate conditions array for the hyperlink that excludes the Limit parameter 294 // This prevents the slideshow dimensions from limiting the "(number) Listings" hyperlink 295 $hyperlink_conditions = $pure_conditions; 296 unset($hyperlink_conditions['Limit']); 297 292 298 if ($fmc_api->last_count == 1) { 293 299 $show_count = "1 Listing"; … … 310 316 311 317 if ($destination == 'local') { 312 $full_search_destination_link = flexmlsConnect::make_nice_tag_url('search', $ pure_conditions );318 $full_search_destination_link = flexmlsConnect::make_nice_tag_url('search', $hyperlink_conditions ); 313 319 $listing_destination_link = $full_search_destination_link; 314 320 } … … 429 435 $this_result_overall_index = ($api_page_size * ($api_current_page - 1)) + $result_count; 430 436 // figure out if there's a previous listing 431 $ pure_conditions['p'] = ($this_result_overall_index != 1) ? 'y' : 'n';437 $hyperlink_conditions['p'] = ($this_result_overall_index != 1) ? 'y' : 'n'; 432 438 433 439 // figure out if there's a next listing possible 434 $ pure_conditions['n'] = ( $this_result_overall_index < $api_last_count ) ? 'y' : 'n';440 $hyperlink_conditions['n'] = ( $this_result_overall_index < $api_last_count ) ? 'y' : 'n'; 435 441 436 442 $total_listings++; … … 440 446 441 447 //Get MlsId for MLS IDX Share Listings 442 $ pure_conditions['m'] = $listing['MlsId'];448 $hyperlink_conditions['m'] = $listing['MlsId']; 443 449 444 450 $listing_address = flexmlsConnect::format_listing_street_address($li); … … 536 542 537 543 if ($destination == 'local') { 538 $this_link = flexmlsConnect::make_nice_address_url($li, $ pure_conditions);544 $this_link = flexmlsConnect::make_nice_address_url($li, $hyperlink_conditions); 539 545 } 540 546 else { -
flexmls-idx/trunk/components/v2/search-results.php
r3375276 r3382863 548 548 } 549 549 550 static function compliance_label( $record ) {551 $compList = flexmlsConnect::mls_required_fields_and_values( "Summary", $record );550 static function compliance_label( $record, $type = "Summary" ) { 551 $compList = flexmlsConnect::mls_required_fields_and_values( $type, $record ); 552 552 foreach ( $compList as $reqs ) : 553 553 if ( flexmlsConnect::is_not_blank_or_restricted($reqs[1]) ) : -
flexmls-idx/trunk/flexmls_connect.php
r3375276 r3382863 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.15. 68 Version: 3.15.7 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.15. 6';19 const FMC_PLUGIN_VERSION = '3.15.7'; 20 20 21 21 define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
flexmls-idx/trunk/integration/elementor/index.php
r2714962 r3382863 103 103 104 104 function fmc_widget_rename($id_base, $widget_types){ 105 $w = $widget_types["wp-widget-{$id_base}"]; 106 $w_name = $w->get_widget_instance()->name; 107 $w->get_widget_instance()->name = $w_name.' <br><span style="color:red">deprecated</span>'; 105 $widget_key = "wp-widget-{$id_base}"; 106 107 // Check if the widget exists in the widget types array 108 if (!isset($widget_types[$widget_key]) || is_null($widget_types[$widget_key])) { 109 return; // Exit early if widget doesn't exist 110 } 111 112 $w = $widget_types[$widget_key]; 113 114 // Check if the widget has a valid instance before accessing it 115 if (is_null($w) || !method_exists($w, 'get_widget_instance')) { 116 return; // Exit early if widget is invalid 117 } 118 119 $widget_instance = $w->get_widget_instance(); 120 if (is_null($widget_instance) || !isset($widget_instance->name)) { 121 return; // Exit early if widget instance is invalid 122 } 123 124 $w_name = $widget_instance->name; 125 $widget_instance->name = $w_name.' <br><span style="color:red">deprecated</span>'; 108 126 } 109 127 -
flexmls-idx/trunk/lib/base.php
r3375276 r3382863 964 964 } 965 965 966 static function mls_requires_agent_phone_in_search_results() { 967 global $fmc_api; 968 $api_system_info = $fmc_api->GetSystemInfo(); 969 $mlsId = $api_system_info["MlsId"]; 970 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Summary"]["DisplayCompliance"]); 971 972 return (in_array("ListAgentPhone", $compList)); 973 } 974 975 static function mls_requires_agent_email_in_search_results() { 976 global $fmc_api; 977 $api_system_info = $fmc_api->GetSystemInfo(); 978 $mlsId = $api_system_info["MlsId"]; 979 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Summary"]["DisplayCompliance"]); 980 981 return (in_array("ListAgentEmail", $compList)); 982 } 983 984 // Similar methods for Detail view 985 static function mls_requires_agent_name_in_listing_details() { 986 global $fmc_api; 987 $api_system_info = $fmc_api->GetSystemInfo(); 988 $mlsId = $api_system_info["MlsId"]; 989 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Detail"]["DisplayCompliance"]); 990 991 return (in_array("ListAgentName", $compList)); 992 } 993 994 static function mls_requires_agent_phone_in_listing_details() { 995 global $fmc_api; 996 $api_system_info = $fmc_api->GetSystemInfo(); 997 $mlsId = $api_system_info["MlsId"]; 998 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Detail"]["DisplayCompliance"]); 999 1000 // Check for both ListMemberPhone (detail view) and ListAgentPhone (fallback) 1001 return (in_array("ListMemberPhone", $compList) || in_array("ListAgentPhone", $compList)); 1002 } 1003 1004 static function mls_requires_agent_email_in_listing_details() { 1005 global $fmc_api; 1006 $api_system_info = $fmc_api->GetSystemInfo(); 1007 $mlsId = $api_system_info["MlsId"]; 1008 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Detail"]["DisplayCompliance"]); 1009 1010 return (in_array("ListMemberEmail", $compList)); 1011 } 1012 1013 static function mls_requires_office_name_in_listing_details() { 1014 global $fmc_api; 1015 $api_system_info = $fmc_api->GetSystemInfo(); 1016 $mlsId = $api_system_info["MlsId"]; 1017 $compList = ($api_system_info["DisplayCompliance"][$mlsId]["View"]["Detail"]["DisplayCompliance"]); 1018 1019 return (in_array("ListOfficeName", $compList)); 1020 } 1021 1022 /** 1023 * Get agent phone with fallback to preferred phone and office phone if agent phone is blank/restricted 1024 * Uses the same logic for both search results and listing details 1025 * 1026 * @param array $sf StandardFields array 1027 * @param string $context 'search' or 'detail' - for future use if needed 1028 * @return string Phone number or empty string 1029 */ 1030 static function get_agent_phone_with_fallback( $sf, $context = 'search' ) { 1031 // Array of phone fields in priority order 1032 $phone_fields = array( 1033 'ListAgentPhone', 1034 'ListAgentPreferredPhone', 1035 'ListOfficePhone' 1036 ); 1037 1038 // Loop through phone fields and return the first valid one 1039 foreach ( $phone_fields as $field ) { 1040 if ( isset( $sf[$field] ) && flexmlsConnect::is_not_blank_or_restricted( $sf[$field] ) ) { 1041 return $sf[$field]; 1042 } 1043 } 1044 1045 // Return empty string if none are available 1046 return ''; 1047 } 1048 966 1049 static function mls_required_fields_and_values($type, &$record){ 967 1050 //$type String "Summary" | "Detail" … … 1029 1112 1030 1113 $logo=""; 1031 if ($api_system_info['Configuration'][0]['IdxLogoSmall']){ 1032 $logo = $api_system_info['Configuration'][0]['IdxLogoSmall']; 1033 } 1034 elseif ($api_system_info['Configuration'][0]['IdxLogo']){ 1035 $logo = $api_system_info['Configuration'][0]['IdxLogo']; 1036 } 1037 else{ 1038 $logo = "IDX"; 1114 // Only set logo if IDXLogo is required in the compliance settings 1115 if (in_array('IDXLogo', $compList)) { 1116 if ($type == 'Summary') { 1117 if (isset($api_system_info['Configuration'][0]['IdxLogoSmall']) && !empty($api_system_info['Configuration'][0]['IdxLogoSmall'])) { 1118 $logo = $api_system_info['Configuration'][0]['IdxLogoSmall']; 1119 } else { 1120 $logo = "IDX"; 1121 } 1122 } 1123 elseif ($type == 'Detail') { 1124 if (isset($api_system_info['Configuration'][0]['IdxLogo']) && !empty($api_system_info['Configuration'][0]['IdxLogo'])) { 1125 $logo = $api_system_info['Configuration'][0]['IdxLogo']; 1126 } else { 1127 $logo = "IDX"; 1128 } 1129 } 1130 else { 1131 $logo = "IDX"; 1132 } 1039 1133 } 1040 1134 -
flexmls-idx/trunk/lib/flexmlsAPI/Core.php
r3375276 r3382863 44 44 'Accept-Encoding' => "gzip,deflate", 45 45 'Content-Type' => "application/json", 46 'User-Agent' => "Flexmls WordPress Plugin/3.15. 6",47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15. 6"46 'User-Agent' => "Flexmls WordPress Plugin/3.15.7", 47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15.7" 48 48 ); 49 49 -
flexmls-idx/trunk/pages/listing-details.php
r3375276 r3382863 343 343 344 344 345 if ($sf['StateOrProvince'] == 'NY' && isset($compList[0]) && is_array($compList[0])) {346 echo "<p>{$compList[0][0]} {$compList[0][1]}</p>";347 }348 345 349 346 echo "<hr class='flexmls_connect__sr_divider'>"; … … 757 754 758 755 echo " <hr class='flexmls_connect__sr_divider'>"; 756 757 // Compliance information 758 echo "<div class='flexmls_connect__ld_compliance'>"; 759 fmcSearchResults::compliance_label( $record, "Detail" ); 760 echo "</div>"; 761 762 // Office information 763 if ( flexmlsConnect::mls_requires_office_name_in_listing_details() ) { 764 $listing_office_label = ($sf['StateOrProvince'] == 'NY') ? 'Listing Courtesy of ' : 'Listing Office: '; 765 echo "<div class='flexmls_connect__ld_office_name'>"; 766 echo "<span class='flexmls_connect__bold_label'>" . esc_html( $listing_office_label ) . "</span>"; 767 echo esc_html( $sf["ListOfficeName"] ); 768 echo "</div>"; 769 } 770 771 // Agent information 772 if ( flexmlsConnect::mls_requires_agent_name_in_listing_details() ) { 773 echo "<div class='flexmls_connect__ld_agent_info'>"; 774 echo "<span class='flexmls_connect__bold_label'>Listing Agent: </span>"; 775 echo esc_html( $sf["ListAgentName"] ); 776 777 if ( flexmlsConnect::mls_requires_agent_phone_in_listing_details() ) { 778 $phone_number = flexmlsConnect::get_agent_phone_with_fallback( $sf, 'detail' ); 779 if ( ! empty( $phone_number ) ) { 780 echo "<br/>" . esc_html( $phone_number ); 781 } 782 } 783 784 if ( flexmlsConnect::mls_requires_agent_email_in_listing_details() ) { 785 echo " | " . esc_html( $sf["ListAgentEmail"] ); 786 } 787 echo "</div>"; 788 } 789 759 790 // disclaimer 760 791 echo " <div class='flexmls_connect__idx_disclosure_text'>"; … … 764 795 if (flexmlsConnect::is_not_blank_or_restricted($reqs[1])){ 765 796 if ($reqs[0] == 'LOGO'){ 766 echo "<img style='padding-bottom: 5px' src='{$reqs[1]}' alt='{$one_line_address} - MLS# {$sf['ListingId']}' title='{$one_line_address} - MLS# {$sf['ListingId']}' />";797 // Skip logo display here - handled by compliance section 767 798 continue; 768 799 } 800 // Skip office and agent info if already handled by dedicated sections 801 if ($reqs[0] != 'Listing Office:' && $reqs[0] != 'Listing Courtesy of' && $reqs[0] != 'Listing Agent:') { 769 802 echo "<p>{$reqs[0]} {$reqs[1]}</p>"; 770 803 } 771 804 } 805 } 772 806 } 773 807 ?> -
flexmls-idx/trunk/pages/search-results.php
r3375276 r3382863 624 624 continue; 625 625 } 626 // Replace Agent Email line with email and phone (no label) 627 if ($reqs[0] == 'Agent Email:') { 628 $agent_info_parts = array(); 629 630 // Add email 631 $agent_info_parts[] = esc_html( $sf["ListAgentEmail"] ); 632 633 // Add phone if required 634 if ( flexmlsConnect::mls_requires_agent_phone_in_search_results() ) { 635 $phone_number = flexmlsConnect::get_agent_phone_with_fallback( $sf, 'search' ); 636 if ( ! empty( $phone_number ) ) { 637 $agent_info_parts[] = esc_html( $phone_number ); 638 } 639 } 640 641 echo "<div class='flexmls_connect__zebra'><span class='flexmls_connect__field_value'>" . implode( ' | ', $agent_info_parts ) . "</span></div>"; 642 } else { 626 643 echo "<div class='flexmls_connect__zebra'><span class='flexmls_connect__field_label'>{$reqs[0]} </span><span class='flexmls_connect__field_value'>{$reqs[1]}</span></div>"; 644 } 627 645 $detail_count++; 628 646 } … … 634 652 // end flexmls_connect__sr_listing_facts_container 635 653 echo "</div>"; 654 655 636 656 } 637 657 -
flexmls-idx/trunk/views/v2/fmcListingDetails.php
r3358668 r3382863 391 391 </div> 392 392 393 <?php if ( flexmlsConnect::mls_requires_office_name_in_listing_details() ) : ?> 394 <?php $listing_office_label = ($sf['StateOrProvince'] == 'NY') ? 'Listing Courtesy of' : 'Listing Office:'; ?> 395 <div class="flexmls-office-name listing-section"> 396 <span class="flexmls-bold-label"><?php echo esc_html( $listing_office_label ) ; ?></span> 397 <?php echo esc_html( $sf["ListOfficeName"] ); ?> 398 </div> 399 <?php endif; ?> 400 401 <?php if ( flexmlsConnect::mls_requires_agent_name_in_listing_details() ) : ?> 402 <div class="flexmls-agent-name-and-label-wrapper listing-section"> 403 <span class="flexmls-agent-name"> 404 <span class="flexmls-bold-label">Listing Agent: </span> 405 <?php echo esc_html( $sf["ListAgentName"] ); ?> 406 407 <?php if ( flexmlsConnect::mls_requires_agent_phone_in_listing_details() ) : ?> 408 <?php 409 $phone_number = flexmlsConnect::get_agent_phone_with_fallback( $sf, 'detail' ); 410 if ( ! empty( $phone_number ) ) { 411 echo "<br/>" . esc_html( $phone_number ); 412 } 413 ?> 414 <?php endif; ?> 415 416 <?php if ( flexmlsConnect::mls_requires_agent_email_in_listing_details() ) : ?> 417 <?php echo " | " . esc_html( $sf["ListAgentEmail"] ); ?> 418 <?php endif; ?> 419 420 </span> 421 </div> 422 <?php endif; ?> 423 424 <div class="compliance-section listing-section"> 425 <?php fmcSearchResults::compliance_label( $record, "Detail" ); ?> 426 </div> 427 393 428 <div class="disclosure-section listing-section"> 394 429 <?php if ( $sf['StateOrProvince'] != 'NY' ) : ?> 395 430 <?php foreach ( $compList as $reqs ) : ?> 396 431 <?php if ( flexmlsConnect::is_not_blank_or_restricted( $reqs[1] ) ) : ?> 397 <?php if ( $reqs[0] == 'LOGO' ) : ?> 398 <?php $listing_disclosure_title = $one_line_address . '- MLS# ' . $sf['ListingId']; ?> 399 <img style='padding-bottom: 5px' src='<?php echo esc_attr( $reqs[1] ); ?>' alt='<?php echo esc_attr( $listing_disclosure_title ); ?>' title='<?php echo esc_attr( $listing_disclosure_title ); ?>' /> 400 <?php else: ?> 432 <?php if ( $reqs[0] != 'Listing Office:' && $reqs[0] != 'Listing Courtesy of' && $reqs[0] != 'Listing Agent:' && $reqs[0] != 'LOGO' ) : ?> 401 433 <div class="listing-req"><?php echo esc_html( $reqs[0] ); ?> <?php echo esc_html( $reqs[1] ); ?></div> 402 434 <?php endif; ?> -
flexmls-idx/trunk/views/v2/fmcSearchResults/_listings_list.php
r3154099 r3382863 1 1 2 <div class="flexmls-listings-list-wrapper flexmls-widthchange-wrapper"> 2 3 <?php if ( ! empty( $this->search_data ) ) : ?> … … 112 113 <span class="flexmls-bold-label">Listing Agent: </span> 113 114 <?php echo esc_html( $sf["ListAgentName"] ); ?> 115 116 <?php if ( flexmlsConnect::mls_requires_agent_phone_in_search_results() ) : ?> 117 <?php 118 $phone_number = flexmlsConnect::get_agent_phone_with_fallback( $sf, 'search' ); 119 if ( ! empty( $phone_number ) ) { 120 echo "<br/>" . esc_html( $phone_number ); 121 } 122 ?> 123 <?php endif; ?> 124 125 <?php if ( flexmlsConnect::mls_requires_agent_email_in_search_results() ) : ?> 126 <?php echo " | " . esc_html( $sf["ListAgentEmail"] ); ?> 127 <?php endif; ?> 128 114 129 </span> 115 130 </div>
Note: See TracChangeset
for help on using the changeset viewer.