Wordpress Plugins – Extensions

Just another WordPress.com weblog

Simple Real Estate Pack 1.0.2

Author: Max Chirkov
Simple Real Estate Pack is a package of real estate tools and widgets designed specifically for real estate industry blogs and web sites. The plugin includes mortgage and home affordability calculators, closing cost estimator, live mortgage rates, Trulia and ALTOS statistical charts, local schools, local rental rates meter, business listings from Yelp and Google Maps. Optionally, Simple Real Estate Pack can function as an extension for Great Real Estate (GRE) plugin, and will add new features to the GRE if it’s installed. Take a look at live example of this functionality at ScottsdaleHomes.com
Installation:
Install like any other basic plugin:

Unzip and copy the simple-real-estate-pack folder to your /wp-content/plugins/ directory
Activate the Simple Real Estate Pack on your plugins page.
Go to the Real Estate Pack Settings Page and adjust options to fit your needs.
A lot of the functionality of the plugin depends on third party APIs. To take advantage of all the features it’s highly recommended that you obtain (free) API keys for each service.

Using Neighborhood Profiles in Templates

Note: This requires good understanding of HTML markup and experience in editing WordPress templates.

Extending GRE listings with SRP Neighborhood Profiles

If you’re using the Great Real Estate Plugin, you can simply include the existing template that comes with the Simple Real Estate Plugin. To do so, follow the following steps:

1. Create a copy of your page.php template and name it listingpage.php. It has to be in your theme’s folder where other templates are (page.php, post.php etc.).

2. Open the file to edit, and place the following code at the top of the file:

<?php
/*
Template Name: SRP Listing Page
*/
?>

3. Find the line that begins with <div class=”entry”> and its corresponding closing </div>. Delete everything in between and insert this code:

<?php
if(SRP_DIR)
include (SRP_DIR . ‘/templates/listing_page.php’);
?>

4. Now, you should be able to use SRP Listing Page template from the drop-down selection list when editing your listings.

Using SRP Neighborhood Profiles in Custom Templates

Assuming that a number of values that refer to property location will be passes to your custom template, you need to define the following global variable as an associative array with preset keys followed by the srp_profile() function:

<?php
$srp_property_values = array(
‘lat’ => ”,
‘lng’ => ”,
‘address’ => ”,
‘city’ => ”,
‘state’ => ”,
‘zip_code’ => ”,
‘listing_price’ => ”,
‘bedrooms’ => ”, //optional
‘bathrooms’ => ”, //optional
‘html’ => ”, //optional
);
if(function_exists(‘srp_profile’)){
srp_profile();
}
?>

All parameters are required except the noted ones. The variable’s name ($srp_property_values) required to be exact.

Using SRP API

Simple Real Estate Pack’s API allows developers to add their own widgets to the Neighborhood Profile output. Those widgets will play by the same rules as the built-in ones – they can load statically into the page or via AJAX, can be presented via tabs and their tab names and subtitles can be customized via plugin settings page by the end-user.

This implementation consists of 3 simple steps:

1. The actual function that returns your widget’s content. You can use global $srp_property_values variable to get access to the initial property/location parameters if needed.

<?php
function my_custom_srp_widget_content() {
global $srp_property_values;

..do something to generate content..

return $content;
}
?>

2. The function that initializes your widget and adds all the necessary information about it to the $srp_widgets object:

<?php
function my_custom_srp_widget_content_init($init) {
$array = array(
‘name’ => ‘widget_name’, //lower case and no special characters
‘title’ => ‘My Custom Widget Title’, //will used as subtitle within content
‘tab_name’ => ‘Widget Tab Name’, //short 1-2 word tab name
‘callback_function’ => ‘my_custom_srp_widget_content’, //callback widget content function
‘init_function’ => __FUNCTION__, //don’t change – this is reference to the current function
‘ajax’ => false, //bool – false or true grants an option for your widget to be loaded via AJAX.
‘save_to_buffer’ => false, //bool – change to true if your widget’s content needs to be cached before the output. For example your widget content function doesn’t return the data, but instead outputs it directly. If you change to TRUE, it will cache the output and return in correctly.
);
$init[] = $array;
return $init;
}
?>

Note: all parameters of the $array are required. Make sure your _init function references the $init argument and always returns $init.

3. The last step is to add a filter that will add your new widget init to the object preparation process:

<?php
add_filter(‘srp_prepare_widgets_object’, ‘my_custom_srp_widget_content_init’);
?>

Note: if you want to change an order in which widgets load, simply add 3rd numerical parameter to the filter. Keep in mind that Google Map is set to load first (and should stay that way), due to some unsolved issue.

Simple Real Estate Pack 1.0.2

Advertisements

May 22, 2010 - Posted by | download, extension, extensions, free, get, internet, plugin, plugins, Uncategorized, wordpress

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: