Changeset 3481358
- Timestamp:
- 03/12/2026 04:52:44 PM (3 weeks ago)
- Location:
- simply-rets
- Files:
-
- 1 deleted
- 13 edited
- 25 copied
-
tags/3.2.1 (copied) (copied from simply-rets/trunk)
-
tags/3.2.1/assets/css/owl.carousel.min.css (copied) (copied from simply-rets/trunk/assets/css/owl.carousel.min.css)
-
tags/3.2.1/assets/css/owl.theme.default.min.css (copied) (copied from simply-rets/trunk/assets/css/owl.theme.default.min.css)
-
tags/3.2.1/assets/css/owl.theme.min.css (deleted)
-
tags/3.2.1/assets/css/simply-rets-client.css (copied) (copied from simply-rets/trunk/assets/css/simply-rets-client.css)
-
tags/3.2.1/assets/js/owl.carousel.min.js (copied) (copied from simply-rets/trunk/assets/js/owl.carousel.min.js)
-
tags/3.2.1/assets/js/simply-rets-client.js (copied) (copied from simply-rets/trunk/assets/js/simply-rets-client.js)
-
tags/3.2.1/composer.json (copied) (copied from simply-rets/trunk/composer.json)
-
tags/3.2.1/composer.lock (copied) (copied from simply-rets/trunk/composer.lock)
-
tags/3.2.1/readme.txt (copied) (copied from simply-rets/trunk/readme.txt) (2 diffs)
-
tags/3.2.1/simply-rets-admin.php (copied) (copied from simply-rets/trunk/simply-rets-admin.php) (2 diffs)
-
tags/3.2.1/simply-rets-analytics.php (copied) (copied from simply-rets/trunk/simply-rets-analytics.php)
-
tags/3.2.1/simply-rets-api-client.php (copied) (copied from simply-rets/trunk/simply-rets-api-client.php)
-
tags/3.2.1/simply-rets-api-helper.php (copied) (copied from simply-rets/trunk/simply-rets-api-helper.php)
-
tags/3.2.1/simply-rets-comments-template.php (modified) (1 diff)
-
tags/3.2.1/simply-rets-contact-form.php (copied) (copied from simply-rets/trunk/simply-rets-contact-form.php)
-
tags/3.2.1/simply-rets-maps.php (copied) (copied from simply-rets/trunk/simply-rets-maps.php) (1 diff)
-
tags/3.2.1/simply-rets-openhouses.php (copied) (copied from simply-rets/trunk/simply-rets-openhouses.php)
-
tags/3.2.1/simply-rets-post-pages.php (copied) (copied from simply-rets/trunk/simply-rets-post-pages.php) (1 diff)
-
tags/3.2.1/simply-rets-query-parser.php (copied) (copied from simply-rets/trunk/simply-rets-query-parser.php)
-
tags/3.2.1/simply-rets-renderer.php (copied) (copied from simply-rets/trunk/simply-rets-renderer.php)
-
tags/3.2.1/simply-rets-setup.php (copied) (copied from simply-rets/trunk/simply-rets-setup.php)
-
tags/3.2.1/simply-rets-shortcode.php (copied) (copied from simply-rets/trunk/simply-rets-shortcode.php) (1 diff)
-
tags/3.2.1/simply-rets-utils.php (copied) (copied from simply-rets/trunk/simply-rets-utils.php) (27 diffs)
-
tags/3.2.1/simply-rets-widgets.php (copied) (copied from simply-rets/trunk/simply-rets-widgets.php) (2 diffs)
-
tags/3.2.1/simply-rets.php (copied) (copied from simply-rets/trunk/simply-rets.php) (2 diffs)
-
tags/3.2.1/tests/bootstrap.php (modified) (1 diff)
-
tags/3.2.1/tests/test-plugin.php (copied) (copied from simply-rets/trunk/tests/test-plugin.php) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simply-rets-admin.php (modified) (2 diffs)
-
trunk/simply-rets-comments-template.php (modified) (1 diff)
-
trunk/simply-rets-maps.php (modified) (1 diff)
-
trunk/simply-rets-post-pages.php (modified) (1 diff)
-
trunk/simply-rets-shortcode.php (modified) (1 diff)
-
trunk/simply-rets-utils.php (modified) (27 diffs)
-
trunk/simply-rets-widgets.php (modified) (2 diffs)
-
trunk/simply-rets.php (modified) (2 diffs)
-
trunk/tests/bootstrap.php (modified) (1 diff)
-
trunk/tests/test-plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simply-rets/tags/3.2.1/readme.txt
r3477656 r3481358 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.9 7 Stable tag: 3.2. 07 Stable tag: 3.2.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 237 237 238 238 == Changelog == 239 240 = 3.2.1 = 241 242 * IMPROVE: Add direct access protection to all files 243 * IMPROVE: Use wp_safe_redirect() instead of wp_redirect() 239 244 240 245 = 3.2.0 = -
simply-rets/tags/3.2.1/simply-rets-admin.php
r3477656 r3481358 6 6 * 7 7 */ 8 if (! defined('ABSPATH')) { 9 exit; 10 } 8 11 9 12 … … 133 136 $permalink = get_post_permalink($post_id); 134 137 update_option("sr_demo_page_created", true); 135 wp_ redirect($permalink);138 wp_safe_redirect($permalink); 136 139 exit(); 137 140 } -
simply-rets/tags/3.2.1/simply-rets-comments-template.php
r1072117 r3481358 1 1 <?php 2 2 // Override any themes comments template to ensure nothing appears. 3 ?> 3 if (! defined('ABSPATH')) { 4 exit; 5 } -
simply-rets/tags/3.2.1/simply-rets-maps.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 -
simply-rets/tags/3.2.1/simply-rets-post-pages.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 -
simply-rets/tags/3.2.1/simply-rets-shortcode.php
r3477656 r3481358 8 8 * 9 9 */ 10 if (! defined('ABSPATH')) { 11 exit; 12 } 10 13 11 14 /* Code starts here */ -
simply-rets/tags/3.2.1/simply-rets-utils.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 … … 16 19 $vendors = (array)get_option('sr_adv_search_meta_vendors', array()); 17 20 18 if (count($vendors) > 1) {21 if (count($vendors) > 1) { 19 22 return false; 20 23 } … … 33 36 if (!empty($v)) { 34 37 $types = get_option("sr_adv_search_meta_types_$v", $def_types); 35 36 38 } elseif (!empty($vendors[0])) { 37 39 $vendor = $vendors[0]; 38 40 $types = get_option("sr_adv_search_meta_types_$vendor", $def_types); 39 40 41 } else { 41 42 $types = $def_types; … … 47 48 public static function srShowListingMeta() { 48 49 49 if ( get_option('sr_show_listingmeta')) {50 if (get_option('sr_show_listingmeta')) { 50 51 $show_listing_meta = false; 51 52 } else { … … 62 63 public static function showAgentContact() { 63 64 64 if ( get_option('sr_show_agent_contact')) {65 if (get_option('sr_show_agent_contact')) { 65 66 $show = false; 66 67 } else { … … 77 78 $normalized_type = null; 78 79 79 switch ($type) {80 switch ($type) { 80 81 case "RES": 81 82 $normalized_type = "Residential"; … … 113 114 $normalized_type = "Mobile Home"; 114 115 break; 115 116 116 } 117 117 … … 138 138 $idxAddress = $listing->internetAddressDisplay; 139 139 $address = $idxAddress === false 140 ? $idxAddressReplacement = get_option(141 "sr_idx_address_display_text",142 "Undisclosed address"143 ) : $listing->address->full;140 ? $idxAddressReplacement = get_option( 141 "sr_idx_address_display_text", 142 "Undisclosed address" 143 ) : $listing->address->full; 144 144 145 145 $city = $listing->address->city; … … 150 150 // exclude city, state, and zip. This ensures that commas are 151 151 // only used when these fields exist. 152 $comma1 = ($address AND ($city OR $state OR$zip)) ? ', ' : '';152 $comma1 = ($address and ($city or $state or $zip)) ? ', ' : ''; 153 153 $comma2 = $city ? ', ' : ''; 154 154 … … 226 226 ); 227 227 228 if ($prettify && $custom_permalink_struct === "pretty_extra") {228 if ($prettify && $custom_permalink_struct === "pretty_extra") { 229 229 230 230 $url .= "/listings/$listing_city/$listing_state/$listing_zip/$listing_address_full/$listing_id"; 231 231 232 if (!empty($query)) {232 if (!empty($query)) { 233 233 $url .= "?" . $query; 234 234 } 235 236 } elseif($prettify && $custom_permalink_struct === "pretty") { 235 } elseif ($prettify && $custom_permalink_struct === "pretty") { 237 236 238 237 $url .= "/listings/$listing_id/$listing_address_full"; 239 238 240 if (!empty($query)) {239 if (!empty($query)) { 241 240 $url .= "?" . $query; 242 241 } 243 244 242 } else { 245 243 246 244 $url .= "?sr-listings=sr-single" 247 . "&listing_id=$listing_id"248 . "&listing_title=$listing_address_full";249 250 if (!empty($query)) {245 . "&listing_id=$listing_id" 246 . "&listing_title=$listing_address_full"; 247 248 if (!empty($query)) { 251 249 $url .= "&" . $query; 252 250 } 253 254 251 } 255 252 … … 262 259 } 263 260 264 public static function buildPaginationLinks( $pagination) {261 public static function buildPaginationLinks($pagination) { 265 262 $prevPagination = $pagination["prev"]; 266 263 $nextPagination = $pagination["next"]; 267 264 $destination = $prevPagination && strpos($prevPagination, "/openhouses") || 268 $nextPagination && strpos($nextPagination, "/openhouses")269 ? "sr-openhouses"270 : "sr-search";265 $nextPagination && strpos($nextPagination, "/openhouses") 266 ? "sr-openhouses" 267 : "sr-search"; 271 268 272 269 $siteUrl = get_home_url() . "/?sr-listings={$destination}&"; … … 278 275 279 276 280 if ($prevPagination !== null && !empty($prevPagination)) {277 if ($prevPagination !== null && !empty($prevPagination)) { 281 278 $prev = str_replace($apiUrls, $siteUrl, $prevPagination); 282 279 $prev_link = "<a href='{$prev}'>Prev</a>"; … … 284 281 } 285 282 286 if ($nextPagination !== null && !empty($nextPagination)) {283 if ($nextPagination !== null && !empty($nextPagination)) { 287 284 $next = str_replace($apiUrls, $siteUrl, $nextPagination); 288 285 $maybe_pipe = $prevPagination && !empty($prevPagination) ? "|" : ""; … … 318 315 } 319 316 320 list($name, $value) = explode('=', $i, 2);321 322 if ( isset($arr[$name])) {323 324 if ( is_array($arr[$name])) {317 list($name, $value) = explode('=', $i, 2); 318 319 if (isset($arr[$name])) { 320 321 if (is_array($arr[$name])) { 325 322 $arr[$name][] = $value; 326 } 327 else { 323 } else { 328 324 $arr[$name] = array($arr[$name], $value); 329 325 } 330 } 331 else { 326 } else { 332 327 $arr[$name] = $value; 333 328 } … … 366 361 367 362 public static function ordinalSuffix($number) { 368 $ends = array('th', 'st','nd','rd','th','th','th','th','th','th');369 if ((($number % 100) >= 11) && (($number %100) <= 13)) {370 return $number . 'th';371 } else { 372 return $number . $ends[$number % 10];363 $ends = array('th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th'); 364 if ((($number % 100) >= 11) && (($number % 100) <= 13)) { 365 return $number . 'th'; 366 } else { 367 return $number . $ends[$number % 10]; 373 368 } 374 369 } … … 434 429 . "</span>"; 435 430 } 436 437 431 } 438 432 … … 456 450 457 451 return html_entity_decode($built_disclaimer); 458 459 452 } else { 460 453 461 454 return "This information is believed to be accurate, but without any warranty."; 462 463 455 } 464 456 } … … 483 475 if ($agentOfficeAboveTheFoldEnabled) { 484 476 485 if (!empty($agent) AND!empty($office)) {477 if (!empty($agent) and !empty($office)) { 486 478 487 479 /** … … 493 485 $listing_by .= "<strong>$listing_by_contact</strong>"; 494 486 return "<p>$listing_by</p>"; 495 496 } elseif (empty($agent) AND !empty($office)) { 487 } elseif (empty($agent) and !empty($office)) { 497 488 498 489 /** … … 502 493 $listing_by .= "<strong>$listing_by_contact</strong>"; 503 494 return "<p>$listing_by</p>"; 504 505 } elseif (!empty($agent) AND empty($office)) { 495 } elseif (!empty($agent) and empty($office)) { 506 496 507 497 /** … … 511 501 $listing_by .= "<strong>$listing_by_contact</strong>"; 512 502 return "<p>$listing_by</p>"; 513 514 503 } else { 515 504 return ""; … … 534 523 } 535 524 } 536 537 525 } 538 526 … … 541 529 542 530 public static $default_photo = 543 "https://s3-us-west-2.amazonaws.com/simplyrets/trial/properties/defprop.jpg";531 "https://s3-us-west-2.amazonaws.com/simplyrets/trial/properties/defprop.jpg"; 544 532 545 533 public static function normalizeListingPhotoUrl($url) { … … 613 601 614 602 $response = (array)$response; 615 if (array_key_exists("message", $response)) {603 if (array_key_exists("message", $response)) { 616 604 return ( 617 605 '<br><p><strong>' … … 628 616 629 617 $noResultsMsg = "<p><strong>" 630 . "0 listings matched your search. "631 . "Please try to broaden your search criteria or try again later."632 . "</strong></p>";618 . "0 listings matched your search. " 619 . "Please try to broaden your search criteria or try again later." 620 . "</strong></p>"; 633 621 return $noResultsMsg; 634 622 } 635 636 623 } 637 624 … … 644 631 */ 645 632 if (!function_exists('http_parse_headers')) { 646 function http_parse_headers ($raw_headers) {633 function http_parse_headers($raw_headers) { 647 634 $headers = array(); // $headers = []; 648 635 … … 651 638 652 639 if (isset($h[1])) { 653 if (!isset($headers[$h[0]])) {640 if (!isset($headers[$h[0]])) { 654 641 $headers[$h[0]] = trim($h[1]); 655 } else if (is_array($headers[$h[0]])) {656 $tmp = array_merge($headers[$h[0]], array(trim($h[1])));642 } else if (is_array($headers[$h[0]])) { 643 $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); 657 644 $headers[$h[0]] = $tmp; 658 645 } else { 659 $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1])));646 $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); 660 647 $headers[$h[0]] = $tmp; 661 648 } -
simply-rets/tags/3.2.1/simply-rets-widgets.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 /* … … 44 47 45 48 // Add all available property types to query string 46 foreach ($ptypes as $k =>$type) {49 foreach ($ptypes as $k => $type) { 47 50 $qs .= "&type={$type}"; 48 51 } 49 52 50 53 // Add configured parameters to query string 51 foreach ((array)$params as $key=>$value) {54 foreach ((array)$params as $key => $value) { 52 55 $qs .= "&{$key}={$value}"; 53 56 } -
simply-rets/tags/3.2.1/simply-rets.php
r3477656 r3481358 5 5 Description: Show your Real Estate listings on your Wordpress site. SimplyRETS provides a very simple set up and full control over your listings. 6 6 Author: SimplyRETS 7 Version: 3.2. 07 Version: 3.2.1 8 8 License: GNU General Public License v3 or later 9 9 … … 11 11 12 12 */ 13 if (! defined('ABSPATH')) { 14 exit; 15 } 13 16 14 17 /* Code starts here */ 15 const SIMPLYRETSWP_VERSION = "v3.2. 0";18 const SIMPLYRETSWP_VERSION = "v3.2.1"; 16 19 17 20 $plugin = plugin_basename(__FILE__); -
simply-rets/tags/3.2.1/tests/bootstrap.php
r2328109 r3481358 1 1 <?php 2 if (! defined('ABSPATH')) { 3 exit; 4 } 2 5 3 6 $_tests_dir = getenv('WP_TESTS_DIR'); 4 if ( !$_tests_dir) $_tests_dir = '/tmp/wordpress-tests-lib';7 if (!$_tests_dir) $_tests_dir = '/tmp/wordpress-tests-lib'; 5 8 6 9 require_once $_tests_dir . '/includes/functions.php'; 7 10 8 11 function _manually_load_plugin() { 9 require dirname( __FILE__) . '/../simply-rets.php';12 require dirname(__FILE__) . '/../simply-rets.php'; 10 13 } 11 14 12 tests_add_filter( 'muplugins_loaded', '_manually_load_plugin');15 tests_add_filter('muplugins_loaded', '_manually_load_plugin'); 13 16 14 17 require $_tests_dir . '/includes/bootstrap.php'; -
simply-rets/tags/3.2.1/tests/test-plugin.php
r3477656 r3481358 1 1 <?php 2 if (! defined('ABSPATH')) { 3 exit; 4 } 2 5 3 6 class SampleTest extends WP_UnitTestCase { … … 7 10 // sample tests 8 11 function testCreatePost() { 9 $this->factory->post->create_many( 5);12 $this->factory->post->create_many(5); 10 13 } 11 14 -
simply-rets/trunk/readme.txt
r3477656 r3481358 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.9 7 Stable tag: 3.2. 07 Stable tag: 3.2.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 237 237 238 238 == Changelog == 239 240 = 3.2.1 = 241 242 * IMPROVE: Add direct access protection to all files 243 * IMPROVE: Use wp_safe_redirect() instead of wp_redirect() 239 244 240 245 = 3.2.0 = -
simply-rets/trunk/simply-rets-admin.php
r3477656 r3481358 6 6 * 7 7 */ 8 if (! defined('ABSPATH')) { 9 exit; 10 } 8 11 9 12 … … 133 136 $permalink = get_post_permalink($post_id); 134 137 update_option("sr_demo_page_created", true); 135 wp_ redirect($permalink);138 wp_safe_redirect($permalink); 136 139 exit(); 137 140 } -
simply-rets/trunk/simply-rets-comments-template.php
r1072117 r3481358 1 1 <?php 2 2 // Override any themes comments template to ensure nothing appears. 3 ?> 3 if (! defined('ABSPATH')) { 4 exit; 5 } -
simply-rets/trunk/simply-rets-maps.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 -
simply-rets/trunk/simply-rets-post-pages.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 -
simply-rets/trunk/simply-rets-shortcode.php
r3477656 r3481358 8 8 * 9 9 */ 10 if (! defined('ABSPATH')) { 11 exit; 12 } 10 13 11 14 /* Code starts here */ -
simply-rets/trunk/simply-rets-utils.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 … … 16 19 $vendors = (array)get_option('sr_adv_search_meta_vendors', array()); 17 20 18 if (count($vendors) > 1) {21 if (count($vendors) > 1) { 19 22 return false; 20 23 } … … 33 36 if (!empty($v)) { 34 37 $types = get_option("sr_adv_search_meta_types_$v", $def_types); 35 36 38 } elseif (!empty($vendors[0])) { 37 39 $vendor = $vendors[0]; 38 40 $types = get_option("sr_adv_search_meta_types_$vendor", $def_types); 39 40 41 } else { 41 42 $types = $def_types; … … 47 48 public static function srShowListingMeta() { 48 49 49 if ( get_option('sr_show_listingmeta')) {50 if (get_option('sr_show_listingmeta')) { 50 51 $show_listing_meta = false; 51 52 } else { … … 62 63 public static function showAgentContact() { 63 64 64 if ( get_option('sr_show_agent_contact')) {65 if (get_option('sr_show_agent_contact')) { 65 66 $show = false; 66 67 } else { … … 77 78 $normalized_type = null; 78 79 79 switch ($type) {80 switch ($type) { 80 81 case "RES": 81 82 $normalized_type = "Residential"; … … 113 114 $normalized_type = "Mobile Home"; 114 115 break; 115 116 116 } 117 117 … … 138 138 $idxAddress = $listing->internetAddressDisplay; 139 139 $address = $idxAddress === false 140 ? $idxAddressReplacement = get_option(141 "sr_idx_address_display_text",142 "Undisclosed address"143 ) : $listing->address->full;140 ? $idxAddressReplacement = get_option( 141 "sr_idx_address_display_text", 142 "Undisclosed address" 143 ) : $listing->address->full; 144 144 145 145 $city = $listing->address->city; … … 150 150 // exclude city, state, and zip. This ensures that commas are 151 151 // only used when these fields exist. 152 $comma1 = ($address AND ($city OR $state OR$zip)) ? ', ' : '';152 $comma1 = ($address and ($city or $state or $zip)) ? ', ' : ''; 153 153 $comma2 = $city ? ', ' : ''; 154 154 … … 226 226 ); 227 227 228 if ($prettify && $custom_permalink_struct === "pretty_extra") {228 if ($prettify && $custom_permalink_struct === "pretty_extra") { 229 229 230 230 $url .= "/listings/$listing_city/$listing_state/$listing_zip/$listing_address_full/$listing_id"; 231 231 232 if (!empty($query)) {232 if (!empty($query)) { 233 233 $url .= "?" . $query; 234 234 } 235 236 } elseif($prettify && $custom_permalink_struct === "pretty") { 235 } elseif ($prettify && $custom_permalink_struct === "pretty") { 237 236 238 237 $url .= "/listings/$listing_id/$listing_address_full"; 239 238 240 if (!empty($query)) {239 if (!empty($query)) { 241 240 $url .= "?" . $query; 242 241 } 243 244 242 } else { 245 243 246 244 $url .= "?sr-listings=sr-single" 247 . "&listing_id=$listing_id"248 . "&listing_title=$listing_address_full";249 250 if (!empty($query)) {245 . "&listing_id=$listing_id" 246 . "&listing_title=$listing_address_full"; 247 248 if (!empty($query)) { 251 249 $url .= "&" . $query; 252 250 } 253 254 251 } 255 252 … … 262 259 } 263 260 264 public static function buildPaginationLinks( $pagination) {261 public static function buildPaginationLinks($pagination) { 265 262 $prevPagination = $pagination["prev"]; 266 263 $nextPagination = $pagination["next"]; 267 264 $destination = $prevPagination && strpos($prevPagination, "/openhouses") || 268 $nextPagination && strpos($nextPagination, "/openhouses")269 ? "sr-openhouses"270 : "sr-search";265 $nextPagination && strpos($nextPagination, "/openhouses") 266 ? "sr-openhouses" 267 : "sr-search"; 271 268 272 269 $siteUrl = get_home_url() . "/?sr-listings={$destination}&"; … … 278 275 279 276 280 if ($prevPagination !== null && !empty($prevPagination)) {277 if ($prevPagination !== null && !empty($prevPagination)) { 281 278 $prev = str_replace($apiUrls, $siteUrl, $prevPagination); 282 279 $prev_link = "<a href='{$prev}'>Prev</a>"; … … 284 281 } 285 282 286 if ($nextPagination !== null && !empty($nextPagination)) {283 if ($nextPagination !== null && !empty($nextPagination)) { 287 284 $next = str_replace($apiUrls, $siteUrl, $nextPagination); 288 285 $maybe_pipe = $prevPagination && !empty($prevPagination) ? "|" : ""; … … 318 315 } 319 316 320 list($name, $value) = explode('=', $i, 2);321 322 if ( isset($arr[$name])) {323 324 if ( is_array($arr[$name])) {317 list($name, $value) = explode('=', $i, 2); 318 319 if (isset($arr[$name])) { 320 321 if (is_array($arr[$name])) { 325 322 $arr[$name][] = $value; 326 } 327 else { 323 } else { 328 324 $arr[$name] = array($arr[$name], $value); 329 325 } 330 } 331 else { 326 } else { 332 327 $arr[$name] = $value; 333 328 } … … 366 361 367 362 public static function ordinalSuffix($number) { 368 $ends = array('th', 'st','nd','rd','th','th','th','th','th','th');369 if ((($number % 100) >= 11) && (($number %100) <= 13)) {370 return $number . 'th';371 } else { 372 return $number . $ends[$number % 10];363 $ends = array('th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th'); 364 if ((($number % 100) >= 11) && (($number % 100) <= 13)) { 365 return $number . 'th'; 366 } else { 367 return $number . $ends[$number % 10]; 373 368 } 374 369 } … … 434 429 . "</span>"; 435 430 } 436 437 431 } 438 432 … … 456 450 457 451 return html_entity_decode($built_disclaimer); 458 459 452 } else { 460 453 461 454 return "This information is believed to be accurate, but without any warranty."; 462 463 455 } 464 456 } … … 483 475 if ($agentOfficeAboveTheFoldEnabled) { 484 476 485 if (!empty($agent) AND!empty($office)) {477 if (!empty($agent) and !empty($office)) { 486 478 487 479 /** … … 493 485 $listing_by .= "<strong>$listing_by_contact</strong>"; 494 486 return "<p>$listing_by</p>"; 495 496 } elseif (empty($agent) AND !empty($office)) { 487 } elseif (empty($agent) and !empty($office)) { 497 488 498 489 /** … … 502 493 $listing_by .= "<strong>$listing_by_contact</strong>"; 503 494 return "<p>$listing_by</p>"; 504 505 } elseif (!empty($agent) AND empty($office)) { 495 } elseif (!empty($agent) and empty($office)) { 506 496 507 497 /** … … 511 501 $listing_by .= "<strong>$listing_by_contact</strong>"; 512 502 return "<p>$listing_by</p>"; 513 514 503 } else { 515 504 return ""; … … 534 523 } 535 524 } 536 537 525 } 538 526 … … 541 529 542 530 public static $default_photo = 543 "https://s3-us-west-2.amazonaws.com/simplyrets/trial/properties/defprop.jpg";531 "https://s3-us-west-2.amazonaws.com/simplyrets/trial/properties/defprop.jpg"; 544 532 545 533 public static function normalizeListingPhotoUrl($url) { … … 613 601 614 602 $response = (array)$response; 615 if (array_key_exists("message", $response)) {603 if (array_key_exists("message", $response)) { 616 604 return ( 617 605 '<br><p><strong>' … … 628 616 629 617 $noResultsMsg = "<p><strong>" 630 . "0 listings matched your search. "631 . "Please try to broaden your search criteria or try again later."632 . "</strong></p>";618 . "0 listings matched your search. " 619 . "Please try to broaden your search criteria or try again later." 620 . "</strong></p>"; 633 621 return $noResultsMsg; 634 622 } 635 636 623 } 637 624 … … 644 631 */ 645 632 if (!function_exists('http_parse_headers')) { 646 function http_parse_headers ($raw_headers) {633 function http_parse_headers($raw_headers) { 647 634 $headers = array(); // $headers = []; 648 635 … … 651 638 652 639 if (isset($h[1])) { 653 if (!isset($headers[$h[0]])) {640 if (!isset($headers[$h[0]])) { 654 641 $headers[$h[0]] = trim($h[1]); 655 } else if (is_array($headers[$h[0]])) {656 $tmp = array_merge($headers[$h[0]], array(trim($h[1])));642 } else if (is_array($headers[$h[0]])) { 643 $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); 657 644 $headers[$h[0]] = $tmp; 658 645 } else { 659 $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1])));646 $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); 660 647 $headers[$h[0]] = $tmp; 661 648 } -
simply-rets/trunk/simply-rets-widgets.php
r3477656 r3481358 7 7 * 8 8 */ 9 if (! defined('ABSPATH')) { 10 exit; 11 } 9 12 10 13 /* … … 44 47 45 48 // Add all available property types to query string 46 foreach ($ptypes as $k =>$type) {49 foreach ($ptypes as $k => $type) { 47 50 $qs .= "&type={$type}"; 48 51 } 49 52 50 53 // Add configured parameters to query string 51 foreach ((array)$params as $key=>$value) {54 foreach ((array)$params as $key => $value) { 52 55 $qs .= "&{$key}={$value}"; 53 56 } -
simply-rets/trunk/simply-rets.php
r3477656 r3481358 5 5 Description: Show your Real Estate listings on your Wordpress site. SimplyRETS provides a very simple set up and full control over your listings. 6 6 Author: SimplyRETS 7 Version: 3.2. 07 Version: 3.2.1 8 8 License: GNU General Public License v3 or later 9 9 … … 11 11 12 12 */ 13 if (! defined('ABSPATH')) { 14 exit; 15 } 13 16 14 17 /* Code starts here */ 15 const SIMPLYRETSWP_VERSION = "v3.2. 0";18 const SIMPLYRETSWP_VERSION = "v3.2.1"; 16 19 17 20 $plugin = plugin_basename(__FILE__); -
simply-rets/trunk/tests/bootstrap.php
r2328109 r3481358 1 1 <?php 2 if (! defined('ABSPATH')) { 3 exit; 4 } 2 5 3 6 $_tests_dir = getenv('WP_TESTS_DIR'); 4 if ( !$_tests_dir) $_tests_dir = '/tmp/wordpress-tests-lib';7 if (!$_tests_dir) $_tests_dir = '/tmp/wordpress-tests-lib'; 5 8 6 9 require_once $_tests_dir . '/includes/functions.php'; 7 10 8 11 function _manually_load_plugin() { 9 require dirname( __FILE__) . '/../simply-rets.php';12 require dirname(__FILE__) . '/../simply-rets.php'; 10 13 } 11 14 12 tests_add_filter( 'muplugins_loaded', '_manually_load_plugin');15 tests_add_filter('muplugins_loaded', '_manually_load_plugin'); 13 16 14 17 require $_tests_dir . '/includes/bootstrap.php'; -
simply-rets/trunk/tests/test-plugin.php
r3477656 r3481358 1 1 <?php 2 if (! defined('ABSPATH')) { 3 exit; 4 } 2 5 3 6 class SampleTest extends WP_UnitTestCase { … … 7 10 // sample tests 8 11 function testCreatePost() { 9 $this->factory->post->create_many( 5);12 $this->factory->post->create_many(5); 10 13 } 11 14
Note: See TracChangeset
for help on using the changeset viewer.