Plugin Directory

Changeset 2374230


Ignore:
Timestamp:
09/03/2020 03:57:35 AM (6 years ago)
Author:
diversesolutions
Message:

Updating to version $dsphpversion

Location:
dsidxpress/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • dsidxpress/trunk/admin.php

    r2273542 r2374230  
    9898    }
    9999  function getGoogleMapsAPIKey(){
    100      $apiHttpResponse = dsSearchAgent_ApiRequest::FetchData("AccountOptions", array(), false, 0);
    101           if (!empty($apiHttpResponse["errors"]) || $apiHttpResponse["response"]["code"] != "200")
    102               echo "<script type='text/javascript'>console.log('Google Map API Key Not Set');</script>";
    103           else
    104               $account_options = json_decode($apiHttpResponse["body"]);
    105       $googleMapAPIsAPIKey = isset($account_options->{'GoogleMapsAPIKey'})? $account_options->{'GoogleMapsAPIKey'}:'';
    106       if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY"))
    107         define("DSIDXPRESS_GOOGLEMAP_API_KEY", $googleMapAPIsAPIKey);
     100    $apiHttpResponse = dsSearchAgent_ApiRequest::FetchData("AccountOptions", array(), false, 0);
     101   
     102    if (empty($apiHttpResponse["errors"]) && $apiHttpResponse["response"]["code"] == "200") {
     103        $account_options = json_decode($apiHttpResponse["body"]);
     104        $googleMapAPIsAPIKey = isset($account_options->{'GoogleMapsAPIKey'})? $account_options->{'GoogleMapsAPIKey'}:'';
     105
     106        if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY") || "DSIDXPRESS_GOOGLEMAP_API_KEY" == '')
     107            define("DSIDXPRESS_GOOGLEMAP_API_KEY", $googleMapAPIsAPIKey);
     108    }
    108109  }
    109110    static function Enqueue($hook) {
     
    15611562                        </td>
    15621563                    </tr>
     1564                    <?php $defaultMonthlyInsuranceRate = isset($account_options->{'DefaultMonthlyInsuranceRate'})? $account_options->{'DefaultMonthlyInsuranceRate'}:''; ?>
     1565                    <tr>
     1566                        <th>
     1567                            <label for="dsidxpress-default-insurance-rate">Monthly Insurance Rate:</label>
     1568                        </th>
     1569                        <td>
     1570                            <input type="text" id="dsidxpress-default-insurance-rate"
     1571                            name="<?php echo DSIDXPRESS_API_OPTIONS_NAME; ?>[DefaultMonthlyInsuranceRate]"
     1572                            value="<?php echo $defaultMonthlyInsuranceRate; ?>" /><br />
     1573                        </td>
     1574                    </tr>
    15631575                    <tr>
    15641576                        <th>
  • dsidxpress/trunk/api-request.php

    r2126989 r2374230  
    218218            if(preg_match('/maps.google.com/i', $script["src"]) || preg_match('/maps.googleapis.com/i', $script["src"])){
    219219                $parsedUrl = parse_url($script["src"]);
    220                 $separator = ($parsedUrl['query'] == NULL) ? "?" : "&";
     220                $separator = (array_key_exists("query", $parsedUrl) && $parsedUrl['query'] != NULL) ? "&" : "?";
    221221
    222222                $account_options = dsSearchAgent_GlobalData::GetAccountOptions(false);
  • dsidxpress/trunk/dsidxpress.php

    r2273542 r2374230  
    77Author: Diverse Solutions
    88Author URI: http://www.diversesolutions.com/
    9 Version: 3.9.0
     9Version: 3.10.0
    1010*/
    1111
     
    9292    // this is needed specifically for development as PHP seems to choke when 1) loading this in admin, 2) using windows, 3) using directory junctions
    9393    include_once(str_replace("\\", "/", WP_PLUGIN_DIR) . "/dsidxpress/admin.php");
     94    add_action('admin_enqueue_scripts', 'dsidxpress_EnqueueAdminScripts');
    9495} else {
    9596    require_once($require_prefix . "client.php");
     
    123124        </div>
    124125HTML;
     126}
     127function dsidxpress_EnqueueAdminScripts($hook) {
     128    if ('widgets.php' !== $hook) {
     129        return;
     130    }
     131    wp_enqueue_script('admin_widgets_scripts', DSIDXPRESS_PLUGIN_URL . 'js/admin-widgets.js', array(), DSIDXPRESS_PLUGIN_VERSION, true);
    125132}
    126133function dsidxpress_InitWidgets() {
  • dsidxpress/trunk/dsidxwidgets/css/client.css

    r1841099 r2374230  
    868868    color: Black;
    869869}
    870 */
    871 /* viewQRCode.js */
    872 .qrcode_description
    873 {
    874     color: #404040;
    875     font: 12px arial,sans-serif;
    876     text-align: left;
    877 }
    878 .qrcode_image
    879 {
    880     height: 220px;
    881     width: 220px;
    882 }
    883 .qrcode_icon
    884 {
    885     height: 25px;
    886     width: 15px;
    887 }
    888 .qrcode_div
    889 {
    890     width: 242px;
    891     padding: 6px;
    892     height: 265px;
    893     background-color: White;
    894 }
    895870/* end */
    896871/* Splash Styles */
  • dsidxpress/trunk/dsidxwidgets/dsidxwidgets.php

    r1789061 r2374230  
    6060}
    6161
    62 if (is_admin()) {
    63     // this is needed specifically for development as PHP seems to choke when 1) loading this in admin, 2) using windows, 3) using directory junctions
    64     include_once(dirname( __FILE__ ) . "/admin.php");
    65 }
    66 
    6762if (defined('DSIDXPRESS_PLUGIN_VERSION')) {
    6863    add_action("widgets_init", "dsidxwidgets_InitWidgets");
  • dsidxpress/trunk/dsidxwidgets/widget-service-mapsearch.php

    r2077505 r2374230  
    2222       
    2323        $googleMapAPIsAPIKey = isset($account_options->{'GoogleMapsAPIKey'})? $account_options->{'GoogleMapsAPIKey'}:'';
    24         if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY"))
     24        if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY") || "DSIDXPRESS_GOOGLEMAP_API_KEY" == '')
    2525            define("DSIDXPRESS_GOOGLEMAP_API_KEY", $googleMapAPIsAPIKey);
    2626  }
  • dsidxpress/trunk/globals.php

    r2273542 r2374230  
    1616        $options = get_option(DSIDXPRESS_OPTION_NAME);
    1717
     18        wp_enqueue_style('dsidxpress-icons', DSIDXPRESS_PLUGIN_URL . 'css/dsidx-icons.css');
     19       
    1820        if (!isset($options["Activated"]) || !$options["Activated"])
    1921            return;
     
    2224        $resourceParams = array( "IsResultsPageModernView" => $account_options->IsResultsPageModernView );
    2325        $apiHttpResponse = dsSearchAgent_ApiRequest::FetchData("EnqueueGlobalAssets", $resourceParams, false, 3600);
    24         wp_enqueue_style('dsidxpress-icons', DSIDXPRESS_PLUGIN_URL . 'css/dsidx-icons.css');
    2526
    2627        if( is_admin() ||  in_array( $pagenow, array( 'wp-login.php', 'wp-register.php' ) ) ){
  • dsidxpress/trunk/idx-listings-pages.php

    r2273542 r2374230  
    151151            }
    152152       
    153             if(strlen(trim($posts[0]->post_content))>0)
     153            if(array_key_exists(0, $posts) && strlen(trim($posts[0]->post_content))>0)
    154154            {
    155155                if(substr(get_home_url(), 0, 8 ) === "https://")               
  • dsidxpress/trunk/readme.txt

    r2273542 r2374230  
    33Tags: IDX, MLS, real estate, realtor, housing, listings, SEO, CRM, lead capture, mobile friendly, customizable, diverse solutions, market leader, ds, marketleader, rets, idxpress, dsidxpress
    44Requires at least: 3.3.0
    5 Tested up to: 5.4
    6 Stable tag: 3.9.0
     5Tested up to: 5.5
     6Stable tag: 3.10.0
    77Requires PHP: 5.4.0
    88
     
    103103
    104104== Changelog ==
     105
     106= 3.10.0 =
     107* Improvements on Modern View of Results Page
     108* Theme compatibility fixes
     109* Facebook sharing fix
     110* Compliance fixes
     111* Validations added to admin widgets
     112* Cleanup plugin
     113* Various Bug fixes
    105114
    106115= 3.9.0 =
  • dsidxpress/trunk/tinymce/link_builder/dialog.php

    r2077505 r2374230  
    2828
    2929$apiHttpResponse = dsSearchAgent_ApiRequest::FetchData("AccountOptions", array(), false, 0);
    30 if (!empty($apiHttpResponse["errors"]) || $apiHttpResponse["response"]["code"] != "200")
    31     echo "<script type='text/javascript'>console.log('Google Map API Key Not Set');</script>";
    32 else
     30if (empty($apiHttpResponse["errors"]) && $apiHttpResponse["response"]["code"] == "200") {
    3331    $account_options = json_decode($apiHttpResponse["body"]);
    34 $googleMapAPIsAPIKey = isset($account_options->{'GoogleMapsAPIKey'})? $account_options->{'GoogleMapsAPIKey'}:'';
    35 if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY"))
    36     define("DSIDXPRESS_GOOGLEMAP_API_KEY", $googleMapAPIsAPIKey);
     32    $googleMapAPIsAPIKey = isset($account_options->{'GoogleMapsAPIKey'})? $account_options->{'GoogleMapsAPIKey'}:'';
     33
     34    if (!defined("DSIDXPRESS_GOOGLEMAP_API_KEY") || "DSIDXPRESS_GOOGLEMAP_API_KEY" == '')
     35        define("DSIDXPRESS_GOOGLEMAP_API_KEY", $googleMapAPIsAPIKey);
     36}
    3737
    3838?>
  • dsidxpress/trunk/widget-idx-guided-search.php

    r2273542 r2374230  
    193193                <div class="dsidx-resp-area dsidx-resp-area-half dsidx-resp-area-half dsidx-resp-area-left">
    194194                <label for="idx-q-PriceMin">Price From</label>
    195                 <input id="idx-q-PriceMin" name="idx-q-PriceMin" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMin']}" maxlength="15" onkeypress="return dsidx.isNumber(event,this.id)" />
     195                <input id="idx-q-PriceMin" name="idx-q-PriceMin" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMin']}" maxlength="15" onkeypress="return dsidx.isDigitOnly(event,this.id)" onpaste="dsidx.validateDigitOnlyOnPaste(event)" />
    196196</div>
    197197                <div class="dsidx-resp-area dsidx-resp-area-half dsidx-resp-area-half dsidx-resp-area-right">
    198198                <label for="idx-q-PriceMin">To</label>
    199                 <input id="idx-q-PriceMax" name="idx-q-PriceMax" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMax']}" maxlength="15" onkeypress="return dsidx.isNumber(event,this.id)" />
     199                <input id="idx-q-PriceMax" name="idx-q-PriceMax" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMax']}" maxlength="15" onkeypress="return dsidx.isDigitOnly(event,this.id)" onpaste="dsidx.validateDigitOnlyOnPaste(event)" />
    200200                </div>
    201201HTML;
     
    234234                        <div class="dsidx-resp-area">
    235235                        <label for="idx-q-ImprovedSqFtMin">Min Sqft</label>
    236                         <input id="idx-q-ImprovedSqFtMin" name="idx-q-ImprovedSqFtMin" type="text" class="dsidx-improvedsqft" placeholder="Any" value="{$values['idx-q-ImprovedSqFtMin']}" />
     236                        <input id="idx-q-ImprovedSqFtMin" name="idx-q-ImprovedSqFtMin" type="text" class="dsidx-improvedsqft" placeholder="Any" value="{$values['idx-q-ImprovedSqFtMin']}" onkeypress="return dsidx.isDigitOnly(event, this.id)" onpaste="dsidx.validateDigitOnlyOnPaste(event)" />
    237237                        </div>
    238238HTML;
  • dsidxpress/trunk/widget-list-areas.php

    r2273542 r2374230  
    9191        $areaOptionsFieldName = $this->get_field_name("areaOptions");
    9292        $selectedAreaType = array($instance["areaOptions"]["areaType"] => "selected=\"selected\"");
     93        $selectedAreaType['city'] = array_key_exists('city', $selectedAreaType) ? $selectedAreaType['city'] : "";
     94        $selectedAreaType['community'] = array_key_exists('community', $selectedAreaType) ? $selectedAreaType['community'] : "";
     95        $selectedAreaType['tract'] = array_key_exists('tract', $selectedAreaType) ? $selectedAreaType['tract'] : "";
     96        $selectedAreaType['zip'] = array_key_exists('zip', $selectedAreaType) ? $selectedAreaType['zip'] : "";
    9397        $type_normalized = $instance["areaOptions"]["areaType"];
    9498        $pluginUrl = DSIDXPRESS_PLUGIN_URL;
    9599        $ajaxUrl = admin_url( 'admin-ajax.php' );
    96 
    97         $selectedCityAreaType = isset($selectedAreaType['city']) ? $selectedAreaType['city'] : '';
    98         $selectedCommunityAreaType = isset($selectedAreaType['community']) ? $selectedAreaType['community'] : '';
    99         $selectedTractAreaType = isset($selectedAreaType['tract']) ? $selectedAreaType['tract'] : '';
    100         $selectedZipAreaType = isset($selectedAreaType['zip']) ? $selectedAreaType['zip'] : '';
    101100
    102101        echo <<<HTML
     
    109108                <label for="{$areaOptionsFieldId}[areaType]">Area types</label>
    110109                <select class="widefat" id="{$areaOptionsFieldId}_areaType" name="{$areaOptionsFieldName}[areaType]" onchange="dsWidgetListAreas.SwitchType(this, '{$areaOptionsFieldId}_link_title')">
    111                     <option value="city" {$selectedCityAreaType}>Cities</option>
    112                     <option value="community" {$selectedCommunityAreaType}>Communities</option>
    113                     <option value="tract" {$selectedTractAreaType}>Tracts</option>
    114                     <option value="zip" {$selectedZipAreaType}>Zip Codes</option>
     110                    <option value="city" {$selectedAreaType['city']}>Cities</option>
     111                    <option value="community" {$selectedAreaType['community']}>Communities</option>
     112                    <option value="tract" {$selectedAreaType['tract']}>Tracts</option>
     113                    <option value="zip" {$selectedAreaType['zip']}>Zip Codes</option>
    115114                </select>
    116115            </p>
  • dsidxpress/trunk/widget-listings.php

    r2077505 r2374230  
    157157        $agentListingsNote = null;
    158158        $officeListingsNote = null;
    159         if ($options['AgentID'] == null) {
     159        if (!isset($options['AgentID']) || empty($options['AgentID'])) {
    160160            $agentListingsNote = "There are no listings to show with your current settings.  Please make sure you have provided your Agent ID on the IDX > General page of your site dashboard, or change this widget's settings to show other listings.";
    161161        }
    162         if ($options['OfficeID'] == null) {
     162        if (!isset($options['OfficeID']) || empty($options['OfficeID'])) {
    163163            $officeListingsNote = "There are no listings to show with your current settings.  Please make sure you have provided your Office ID on the IDX > General page of your site dashboard, or change this widget's settings to show other listings.";
    164164        }
Note: See TracChangeset for help on using the changeset viewer.