How do I cleanup the listing data before it is imported into Open-Realty?

To cleanup or modify listing information before it is imported into Open-Realty, you can use the remapper.php file. All listings are passed to this remap function, allowing you to write custom code to modify listings as you need.

The basic remapper.php file looks like the one below, which is simply looping through all the listing, making no modifications and returning the complete unmodified records back to TransparentRETS.

<?php
    function remap($listings,$classID){
        /*
        // Loop though each listing in the array.
        foreach ($listings as $count => $listing){
            //Check if field year_built from the MLS contains the year 1983
            if($listing['year_built'] == '1983') {
                //Change the zip code value for field zip4 to 55555
                $listings[$count]['zip4']='55555';
            }
        }
        */
        //Return the Modified Listings
        return $listings;
    }
?>

You can add custom code to the remap() function above to change data as you need. For example, if your MLS has a field called MarketingRemarks and agents are allowed to place html tags in this field, and you want to remove the html tags, you can use the php strip_tags() function to do this.


<?php
    class remapper{
        function remap($listings,$classID){
            // Loop though each listing in the array.
            foreach ($listings as $count => $listing){
                //Check if the field MarketingRemarks exists as not all property classes contain this field. We could also check the $classID
                if(isset($listing['MarketingRemarks'])){
                    //Remove all HTML tags with strip_tags from the MarketingRemarks field
                    $listings[$count]['MarketingRemarks']= strip_tags($listing['MarketingRemarks']);
                }
            }
            //Return the Modified Listings
            return $listings;
        }
    }
?>

You can customize the above function to make virtually and modifications you want to the listing data.
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

How do I display MLS required text on IDX listings not from our office?

A common requirement is that you display text like "Listing provided by: Realtor X's...