Plugin Directory

Changeset 3382863


Ignore:
Timestamp:
10/22/2025 06:33:00 PM (4 months ago)
Author:
flexmls
Message:

Flexmls WordPress plugin 3.15.7

Location:
flexmls-idx/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • flexmls-idx/trunk/README.txt

    r3375276 r3382863  
    55Tested up to: 6.8.3
    66Requires PHP: 7.4
    7 Stable tag: 3.15.6
     7Stable tag: 3.15.7
    88
    99Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site.
     
    8585
    8686== Changelog ==
     87= 3.15.7 =
     88Efficiency 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
    8793= 3.15.6 =
    8894Efficiency Update
    8995* Improving canonical link priorirty for listing detail pages
    9096* More PHP warnings resolved
    91 
    9297
    9398= 3.15.5 =
  • flexmls-idx/trunk/components/photos.php

    r3358668 r3382863  
    252252    }
    253253
     254
    254255    $params['_filter'] = implode(" And ", $filter_conditions);
    255256    $params['_select'] = 'MlsId,ListPrice,ListOfficeId,ListOfficeName,OpenHouses,BedsTotal,BathsTotal,
     
    290291    $pure_conditions['pg'] = array_key_exists('_page', $params) ? $params['_page'] : 1;
    291292
     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
    292298    if ($fmc_api->last_count == 1) {
    293299      $show_count = "1 Listing";
     
    310316
    311317    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 );
    313319      $listing_destination_link = $full_search_destination_link;
    314320    }
     
    429435        $this_result_overall_index = ($api_page_size * ($api_current_page - 1)) + $result_count;
    430436        // 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';
    432438
    433439        // 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';
    435441
    436442        $total_listings++;
     
    440446
    441447        //Get MlsId for MLS IDX Share Listings
    442         $pure_conditions['m'] = $listing['MlsId'];
     448        $hyperlink_conditions['m'] = $listing['MlsId'];
    443449
    444450        $listing_address = flexmlsConnect::format_listing_street_address($li);
     
    536542
    537543          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);
    539545          }
    540546          else {
  • flexmls-idx/trunk/components/v2/search-results.php

    r3375276 r3382863  
    548548    }
    549549
    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 );
    552552        foreach ( $compList as $reqs ) :
    553553            if ( flexmlsConnect::is_not_blank_or_restricted($reqs[1]) ) :
  • flexmls-idx/trunk/flexmls_connect.php

    r3375276 r3382863  
    66Description: Provides Flexmls&reg; Customers with Flexmls&reg; IDX features on their WordPress websites. <strong>Tips:</strong> <a href="admin.php?page=fmc_admin_settings">Activate your Flexmls&reg; 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&reg; IDX Widget Short-Code Generator on the Visual page editor.
    77Author: FBS
    8 Version: 3.15.6
     8Version: 3.15.7
    99Author URI:  https://www.flexmls.com
    1010Requires at least: 5.0
     
    1717const FMC_API_BASE = 'sparkapi.com';
    1818const FMC_API_VERSION = 'v1';
    19 const FMC_PLUGIN_VERSION = '3.15.6';
     19const FMC_PLUGIN_VERSION = '3.15.7';
    2020
    2121define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • flexmls-idx/trunk/integration/elementor/index.php

    r2714962 r3382863  
    103103
    104104function 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>';
    108126}
    109127
  • flexmls-idx/trunk/lib/base.php

    r3375276 r3382863  
    964964  }
    965965
     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
    9661049  static function mls_required_fields_and_values($type, &$record){
    9671050    //$type   String   "Summary" | "Detail"
     
    10291112
    10301113    $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      }
    10391133    }
    10401134
  • flexmls-idx/trunk/lib/flexmlsAPI/Core.php

    r3375276 r3382863  
    4444        'Accept-Encoding' => "gzip,deflate",
    4545        '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"
    4848    );
    4949
  • flexmls-idx/trunk/pages/listing-details.php

    r3375276 r3382863  
    343343
    344344
    345     if ($sf['StateOrProvince'] == 'NY' && isset($compList[0]) && is_array($compList[0])) {
    346       echo "<p>{$compList[0][0]} {$compList[0][1]}</p>";
    347     }
    348345
    349346    echo "<hr class='flexmls_connect__sr_divider'>";
     
    757754
    758755      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
    759790    // disclaimer
    760791      echo "  <div class='flexmls_connect__idx_disclosure_text'>";
     
    764795          if (flexmlsConnect::is_not_blank_or_restricted($reqs[1])){
    765796              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
    767798                  continue;
    768799                }
     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:') {
    769802                echo "<p>{$reqs[0]} {$reqs[1]}</p>";
    770803              }
    771804          }
     805      }
    772806  }
    773807?>
  • flexmls-idx/trunk/pages/search-results.php

    r3375276 r3382863  
    624624                        continue;
    625625                    }
     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 {
    626643          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                    }
    627645                    $detail_count++;
    628646                }
     
    634652            // end flexmls_connect__sr_listing_facts_container
    635653            echo "</div>";
     654
     655
    636656        }
    637657
  • flexmls-idx/trunk/views/v2/fmcListingDetails.php

    r3358668 r3382863  
    391391    </div>
    392392
     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
    393428    <div class="disclosure-section listing-section">
    394429        <?php if ( $sf['StateOrProvince'] != 'NY' ) : ?>
    395430            <?php foreach ( $compList as $reqs ) : ?>
    396431                <?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' ) : ?>
    401433                        <div class="listing-req"><?php echo esc_html( $reqs[0] ); ?> <?php echo esc_html( $reqs[1] ); ?></div>
    402434                    <?php endif; ?>
  • flexmls-idx/trunk/views/v2/fmcSearchResults/_listings_list.php

    r3154099 r3382863  
     1
    12<div class="flexmls-listings-list-wrapper flexmls-widthchange-wrapper">
    23    <?php if ( ! empty( $this->search_data ) ) : ?>
     
    112113                                <span class="flexmls-bold-label">Listing Agent: </span>
    113114                                <?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                               
    114129                            </span>
    115130                        </div>
Note: See TracChangeset for help on using the changeset viewer.