Plugin Directory

Changeset 3065294


Ignore:
Timestamp:
04/05/2024 08:53:56 AM (2 years ago)
Author:
zebrasoft
Message:

Update for 1.3.3

Location:
immotoolbox-connect/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • immotoolbox-connect/trunk/immotoolbox-connect.php

    r2939285 r3065294  
    44Plugin URI: https://www.immotoolbox.com/
    55Description: Displays ImmoToolBox real estate listings in your website
    6 Version: 1.3.2
     6Version: 1.3.3
    77Author: ZebraSoft Monaco
    88Author URI: https://www.zebrasoft.mc
     
    2424along with ImmoToolBox Connect. If not, see https://www.gnu.org/licenses/gpl.html.
    2525*/
    26 define('ITBCONNECT_VERSION', '1.3.2');
     26define('ITBCONNECT_VERSION', '1.3.3');
    2727
    2828/**
  • immotoolbox-connect/trunk/includes/ITBConnectAPI.php

    r2930754 r3065294  
    77    {
    88        $options = get_option(ITBCONNECT_OPTION_NAME, []);
     9        $private_key = empty($atts['private_key'])?$options['private_key']:$atts['private_key'];
    910        $property_page_id = empty($atts['property_page_id'])?$options['property_page_id']:$atts['property_page_id'];
    1011        $property_page_id = apply_filters('wpml_object_id', $property_page_id, 'page', true);
     
    8283            }
    8384        }
     85        if (!empty($atts['rooms_min'])) {
     86            $get['num_rooms_min'] = $atts['rooms_min'];
     87        }
     88        if (!empty($atts['rooms_max'])) {
     89            $get['num_rooms_max'] = $atts['rooms_max'];
     90        }
     91
     92        if (!empty($atts['bedrooms'])) {
     93            if (is_array($atts['bedrooms'])) {
     94                $get['num_bedrooms'] = [];
     95                foreach ($atts['bedrooms'] as $item) {
     96                    if ($item) $get['num_bedrooms'][] = $item;
     97                }
     98                if (!$get['num_bedrooms']) unset($get['num_bedrooms']);
     99                else $get['num_bedrooms'] = implode(',', $get['num_bedrooms']);
     100            }
     101            else {
     102                $get['num_bedrooms'] = $atts['bedrooms'];
     103            }
     104        }
     105        if (!empty($atts['bedrooms_min'])) {
     106            $get['num_bedrooms_min'] = $atts['bedrooms_min'];
     107        }
     108        if (!empty($atts['bedrooms_max'])) {
     109            $get['num_bedrooms_max'] = $atts['bedrooms_max'];
     110        }
     111
     112        if (!empty($atts['bathrooms'])) {
     113            if (is_array($atts['bathrooms'])) {
     114                $get['num_bathrooms'] = [];
     115                foreach ($atts['bathrooms'] as $item) {
     116                    if ($item) $get['num_bathrooms'][] = $item;
     117                }
     118                if (!$get['num_bathrooms']) unset($get['num_bathrooms']);
     119                else $get['num_bathrooms'] = implode(',', $get['num_bathrooms']);
     120            }
     121            else {
     122                $get['num_bathrooms'] = $atts['bathrooms'];
     123            }
     124        }
     125        if (!empty($atts['bathrooms_min'])) {
     126            $get['num_bathrooms_min'] = $atts['bathrooms_min'];
     127        }
     128        if (!empty($atts['bathrooms_max'])) {
     129            $get['num_bathrooms_max'] = $atts['bathrooms_max'];
     130        }
     131
     132        if (!empty($atts['parkings'])) {
     133            if (is_array($atts['parkings'])) {
     134                $get['num_parkings'] = [];
     135                foreach ($atts['parkings'] as $item) {
     136                    if ($item) $get['num_parkings'][] = $item;
     137                }
     138                if (!$get['num_parkings']) unset($get['num_parkings']);
     139                else $get['num_parkings'] = implode(',', $get['num_parkings']);
     140            }
     141            else {
     142                $get['num_parkings'] = $atts['parkings'];
     143            }
     144        }
     145        if (!empty($atts['parkings_min'])) {
     146            $get['num_parkings_min'] = $atts['parkings_min'];
     147        }
     148        if (!empty($atts['parkings_max'])) {
     149            $get['num_parkings_max'] = $atts['parkings_max'];
     150        }
     151
     152        if (!empty($atts['box'])) {
     153            if (is_array($atts['box'])) {
     154                $get['num_box'] = [];
     155                foreach ($atts['box'] as $item) {
     156                    if ($item) $get['num_box'][] = $item;
     157                }
     158                if (!$get['num_box']) unset($get['num_box']);
     159                else $get['num_box'] = implode(',', $get['num_box']);
     160            }
     161            else {
     162                $get['num_box'] = $atts['box'];
     163            }
     164        }
     165        if (!empty($atts['box_min'])) {
     166            $get['num_box_min'] = $atts['box_min'];
     167        }
     168        if (!empty($atts['box_max'])) {
     169            $get['num_box_max'] = $atts['box_max'];
     170        }
     171
     172        if (!empty($atts['cellars'])) {
     173            if (is_array($atts['cellars'])) {
     174                $get['num_cellars'] = [];
     175                foreach ($atts['cellars'] as $item) {
     176                    if ($item) $get['num_cellars'][] = $item;
     177                }
     178                if (!$get['num_cellars']) unset($get['num_cellars']);
     179                else $get['num_cellars'] = implode(',', $get['num_cellars']);
     180            }
     181            else {
     182                $get['num_cellars'] = $atts['cellars'];
     183            }
     184        }
     185        if (!empty($atts['cellars_min'])) {
     186            $get['num_cellars_min'] = $atts['cellars_min'];
     187        }
     188        if (!empty($atts['cellars_max'])) {
     189            $get['num_cellars_max'] = $atts['cellars_max'];
     190        }
    84191
    85192        if (!empty($atts['type_property'])) {
     
    153260        $return['atts'] = $atts;
    154261        $headers = [
    155             'X-AUTH-TOKEN: '.$options['private_key']
     262            'X-AUTH-TOKEN: '.$private_key
    156263            , 'accept: application/ld+json'
    157264        ];
  • immotoolbox-connect/trunk/public/ITBConnectPublic.php

    r2939285 r3065294  
    239239        $data_view['selection_url'] = get_page_link(isset($atts['selection_page_id'])?$atts['selection_page_id']:$option['basket_page_id']);
    240240        $data_view['atts'] = $atts;
     241
     242        if (!empty($_REQUEST['nsearch'])) {
     243            $atts = $atts + $_REQUEST['nsearch'];
     244        }
    241245        $data_view['properties'] = ITBConnectAPI::properties($atts);
    242246        $twig = self::getTwig();
  • immotoolbox-connect/trunk/readme.md

    r2939285 r3065294  
    44Tags: immotoolbox, realestate, agency, property
    55Requires at least: 4.9
    6 Tested up to: 6.2
     6Tested up to: 6.5
    77Requires PHP: 5.9
    8 Stable tag: 1.3.2
     8Stable tag: 1.3.3
    99License: GPL3
    1010License URI: https://www.gnu.org/licenses/gpl.html
  • immotoolbox-connect/trunk/readme.txt

    r2939285 r3065294  
    44Tags: immotoolbox, realestate, agency, property
    55Requires at least: 4.9
    6 Tested up to: 6.2
     6Tested up to: 6.5
    77Requires PHP: 5.9
    8 Stable tag: 1.3.2
     8Stable tag: 1.3.3
    99License: GPL3
    1010License URI: https://www.gnu.org/licenses/gpl.html
Note: See TracChangeset for help on using the changeset viewer.