Skip to content

Commit

Permalink
Merge pull request #64 from SimplyRETS/fix-63-listing-page-title
Browse files Browse the repository at this point in the history
Show full address in the title on listing details pages
  • Loading branch information
CodyReichert committed Feb 24, 2018
2 parents 6d0fde9 + 37cca97 commit ad9dba7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.3.9
* FEATURE: Add more address information to single listing page titles for improved indexing.

## 2.3.8
* FEATURE: Add support for "status" attribute on [sr_search_form] (non-advanced version only).

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: SimplyRETS
Tags: rets, idx, real estate listings, real estate, listings, rets listings, simply rets, realtor, rets feed, idx feed
Requires at least: 3.0.1
Tested up to: 4.8.1
Stable tag: 2.3.8
Stable tag: 2.3.9
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -235,6 +235,9 @@ listing sidebar widget.

== Changelog ==

= 2.3.9 =
* FEATURE: Add more address information to single listing page titles for improved indexing.

= 2.3.8 =
* FEATURE: Add support for "status" attribute on [sr_search_form] (non-advanced version only).

Expand Down
4 changes: 2 additions & 2 deletions simply-rets-api-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function srApiOptionsRequest( $url ) {
$php_version = phpversion();
$site_url = get_site_url();

$ua_string = "SimplyRETSWP/2.3.8 Wordpress/{$wp_version} PHP/{$php_version}";
$ua_string = "SimplyRETSWP/2.3.9 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";

if( is_callable( 'curl_init' ) ) {
Expand Down Expand Up @@ -209,7 +209,7 @@ public static function srApiRequest( $url ) {
$wp_version = get_bloginfo('version');
$php_version = phpversion();

$ua_string = "SimplyRETSWP/2.3.8 Wordpress/{$wp_version} PHP/{$php_version}";
$ua_string = "SimplyRETSWP/2.3.9 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";

if( is_callable( 'curl_init' ) ) {
Expand Down
25 changes: 17 additions & 8 deletions simply-rets-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,31 @@ public static function buildDetailsLink($listing, $params = array()) {

// Listing details
$listing_id = $listing->mlsId;
$listing_address = $listing->address->full;

if($prettify && $custom_permalink_struct === "pretty_extra") {
$listing_city = $listing->address->city;
$listing_state = $listing->address->state;
$listing_zip = $listing->address->postalCode;
$listing_address = $listing->address->full;

$listing_city = $listing->address->city;
$listing_state = $listing->address->state;
$listing_zip = $listing->address->postalCode;
$listing_address_full = $listing_address
. ', '
. $listing_city
. ', '
. $listing_state
. ' '
. $listing_zip;

if($prettify && $custom_permalink_struct === "pretty_extra") {

$url .= "/listings/$listing_city/$listing_state/$listing_zip/$listing_address/$listing_id";
$url .= "/listings/$listing_city/$listing_state/$listing_zip/$listing_address_full/$listing_id";

if(!empty($query)) {
$url .= "?" . $query;
}

} elseif($prettify && $custom_permalink_struct === "pretty") {

$url .= "/listings/$listing_id/$listing_address";
$url .= "/listings/$listing_id/$listing_address_full";

if(!empty($query)) {
$url .= "?" . $query;
Expand All @@ -98,16 +105,18 @@ public static function buildDetailsLink($listing, $params = array()) {

$url .= "?sr-listings=sr-single"
. "&listing_id=$listing_id"
. "&listing_title=$listing_address";
. "&listing_title=$listing_address_full";

if(!empty($query)) {
$url .= "&" . $query;
}

}

// URL encode special characters
$url = str_replace(' ', '+', $url);
$url = str_replace('#', '%23', $url);
$url = str_replace(',', '%2C', $url);

return $url;
}
Expand Down
2 changes: 1 addition & 1 deletion simply-rets.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://simplyrets.com
Description: Show your Real Estate listings on your Wordpress site. SimplyRETS provides a very simple set up and full control over your listings.
Author: SimplyRETS
Version: 2.3.8
Version: 2.3.9
License: GNU General Public License v3 or later
Copyright (c) SimplyRETS 2014 - 2015
Expand Down

0 comments on commit ad9dba7

Please sign in to comment.