Пример #1
0
<?php

$propMgr = new PropertiesManager();
$properties = $propMgr->getProperties(null, null, 1000000);
$properties_map_index = 1;
?>

<div class="train-railing separator">
	<div class="railing"></div>
	<h3 class="train"><?php 
echo $title;
?>
</h3>
	<div class="railing"></div>
</div>

<?php 
estetico_load_component('common/properties_view_map', array('list_style' => 'map', 'properties' => $properties, 'properties_map_index' => $properties_map_index, 'options' => array('show_legend' => false, 'show_places' => false, 'show_fullscreen' => false)));
Пример #2
0
 function widget($args, $instance)
 {
     $properties = PropertiesManager::getProperties($instance['listing_type'], $instance['order_way'], $instance['items_count']);
     require_once COMPONENTS_PATH . '/widgets/properties.php';
 }
Пример #3
0
 function estetico_get_quick_search_item($id)
 {
     $output = '';
     $title = __(estetico_get_of_option_name('quick_search_items', $id), THEME_NAME);
     switch ($id) {
         case 'beds':
             $output = '<div class="styled-select">';
             $output .= '<select name="' . $id . '">';
             $output .= '<option value="">' . __('Beds', THEME_NAME) . '</option>';
             for ($i = 1; $i <= 20; $i++) {
                 $output .= '<option value="' . $i . '">' . $i . '+</option>';
             }
             $output .= '</select>';
             $output .= '</div>';
             break;
         case 'pets_allowed':
             $output = '<div class="styled-select">';
             $output .= '<select name="' . $id . '">';
             $output .= '<option value="">' . __('Pets allowed', THEME_NAME) . '</option>';
             $output .= '<option value="yes">' . __('Yes', THEME_NAME) . '</option>';
             $output .= '<option value="no">' . __('No', THEME_NAME) . '</option>';
             $output .= '</select>';
             $output .= '</div>';
             break;
         case 'for_sale_rent':
             $output = '<div class="styled-select">';
             $output .= '<select name="' . $id . '">';
             $output .= '<option value="">' . __('For sale or rent', THEME_NAME) . '</option>';
             $output .= '<option value="sale">' . __('Sale', THEME_NAME) . '</option>';
             $output .= '<option value="rent">' . __('Rent', THEME_NAME) . '</option>';
             $output .= '<option value="both">' . __('Both', THEME_NAME) . '</option>';
             $output .= '</select>';
             $output .= '</div>';
             break;
         case 'feature':
             $features = PropertiesManager::getAllFeatures();
             $output = '<div class="styled-select">
     <select name="' . $id . '">
       <option value="">' . $title . '</option>';
             foreach ($features as $feature) {
                 $output .= '<option value="' . esc_attr($feature->slug) . '">' . esc_html($feature->name) . '</option>';
             }
             $output .= '
     </select>
     </div>';
             break;
         case 'city':
             $cities = estetico_get_all_cities();
             $output = '<div class="styled-select">
     <select name="' . $id . '">
       <option value="">' . $title . '</option>';
             foreach ($cities as $city) {
                 $output .= '<option value="' . esc_attr($city) . '">' . esc_html($city) . '</option>';
             }
             $output .= '
     </select>
     </div>';
             break;
         case 'min_price':
         case 'max_price':
             $output = '<input type="text" name="' . $id . '" placeholder="' . esc_attr($title) . '" class="input text">';
             break;
         case 'bedrooms':
         case 'bathrooms':
             $output = '<div class="styled-select">
     <select name="' . $id . '">
       <option value="">' . $title . '</option>
       <option value="1">1+</option>
       <option value="2">2+</option>
       <option value="3">3+</option>
       <option value="4">4+</option>
       <option value="5">5+</option>
       <option value="6">6+</option>
     </select>
     </div>';
             break;
         case 'type':
             $output .= '<div class="styled-select">
     <select name="' . $id . '">
       <option value="">' . $title . '</option>';
             $propMgr = new PropertiesManager();
             $property_types = $propMgr->getPropertyTypes();
             foreach ($property_types as $type) {
                 $output .= '<option value="' . $type->slug . '">' . $type->name . '</option>';
             }
             $output .= '</select></div>';
             break;
     }
     return $output;
 }
 public static function getOtherPeopleAlsoViewedHTML($post, $options = array())
 {
     $session_id = Registry::get('session_id');
     // No session id found - terminate the function.
     if ($session_id === null) {
         return false;
     }
     $other_people_also_viewed = get_option(USE_PREFIX . 'other_people_also_viewed');
     if (false !== $other_people_also_viewed) {
         $other_people_also_viewed = unserialize($other_people_also_viewed);
     } else {
         $other_people_also_viewed = array();
     }
     $seen_properties = array();
     // Loop through all sessions
     foreach ($other_people_also_viewed as $_session_id => $_properties) {
         // Loop though each session's properties seen
         foreach ($_properties as $_property_id) {
             // If any of the properties match the current property
             if ($_property_id == $post->ID) {
                 $seen_properties = array_merge($seen_properties, $_properties);
             }
         }
     }
     // Remove any dublications
     $seen_properties = array_unique($seen_properties);
     // Remove current property list
     $seen_properties = array_diff($seen_properties, array($post->ID));
     // Create a session ID for this customer
     if (!isset($other_people_also_viewed[$session_id])) {
         $other_people_also_viewed[$session_id] = array();
     }
     $other_people_also_viewed[$session_id][] = $post->ID;
     $other_people_also_viewed[$session_id] = array_unique($other_people_also_viewed[$session_id]);
     $other_people_also_viewed = serialize($other_people_also_viewed);
     $result = update_option(USE_PREFIX . 'other_people_also_viewed', $other_people_also_viewed);
     $options = array('post__in' => $seen_properties, 'post_type' => 'properties', 'post_status' => 'publish', 'properties_per_page' => 10000);
     $properties = PropertiesManager::searchProperties($options);
     ob_start();
     $list_style = 'carousel';
     require COMPONENTS_PATH . DIRECTORY_SEPARATOR . "common" . DIRECTORY_SEPARATOR . "properties.php";
     $content .= ob_get_contents();
     ob_end_clean();
     return $content;
 }
Пример #5
0
<?php

$properties_per_page = (int) estetico_get_setting('properties_per_page');
$start_page = isset($_GET['start_page']) ? (int) $_GET['start_page'] : 1;
$sort_by = !empty($_GET['sort_by']) ? $_GET['sort_by'] : '';
$list_style = !empty($_GET['list_style']) ? $_GET['list_style'] : estetico_get_setting('properties_default_listing_type');
// Do the properties query
$properties = PropertiesManager::getFiltered($_GET);
$found_posts = PropertiesManager::getLastQueryFoundItemsCount();
?>
<div class="main-content">

	<div class="filterbar">
		<div class="listing-view-change">
			<a href="<?php 
echo estetico_preserve_url(array('list_style' => 'grid'));
?>
" class="grid<?php 
if ($list_style != 'grid') {
    ?>
 active<?php 
}
?>
"><?php 
echo __('Grid', THEME_NAME);
?>
</a>
			<a href="<?php 
echo estetico_preserve_url(array('list_style' => 'list'));
?>
" class="list<?php 
Пример #6
0
function add_shortcodes_post_init()
{
    $features = PropertiesManager::getAllFeatures();
    $features_array = array();
    foreach ($features as $feature) {
        $features_array[$feature->name] = $feature->slug;
    }
    $types = PropertiesManager::getAllTypes();
    $types_array = array();
    foreach ($types as $type) {
        $types_array[$type->name] = $type->slug;
    }
    $cities = array('-' => '');
    $_cities = estetico_get_all_cities();
    foreach ($_cities as $_city) {
        $cities[$_city] = $_city;
    }
    unset($_cities, $_city);
    if (function_exists('vc_map')) {
        vc_map(array("name" => __('Properties', THEME_NAME), "base" => 'properties', 'category' => __('Estetico'), 'params' => array(array("type" => 'dropdown', 'param_name' => 'list_style', 'heading' => __('Style', THEME_NAME), "value" => array(__('Grid', THEME_NAME) => 'grid', __('List', THEME_NAME) => 'list', __('Carousel', THEME_NAME) => 'carousel', __('Map', THEME_NAME) => 'map', __('List + Map', THEME_NAME) => 'list_map', __('Grid + Map', THEME_NAME) => 'grid_map'), "description" => __('Choose the style your properties will be visualized to the visitors', THEME_NAME)), array("type" => 'dropdown', 'param_name' => 'sort_by', 'heading' => __('Sort by', THEME_NAME), "value" => array(__('None', THEME_NAME) => 'none', __('Price (low to high)', THEME_NAME) => 'price_low_to_high', __('Price (high to low)', THEME_NAME) => 'price_high_to_low', __('View count (low to high)', THEME_NAME) => 'view_count_low_to_high', __('View count (high to low)', THEME_NAME) => 'view_count_high_to_low', __('Date (low to high)', THEME_NAME) => 'date_low_to_high', __('Date (high to low)', THEME_NAME) => 'date_low_to_high'), "description" => __('Choose how to sort properties', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'min_price', 'heading' => __('Price minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'max_price', 'heading' => __('Price maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bedrooms_min', 'heading' => __('Bedrooms minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bedrooms_max', 'heading' => __('Bedrooms maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bathrooms_min', 'heading' => __('Bathrooms minimum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'bathrooms_max', 'heading' => __('Bathrooms maximum', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'sq_feet', 'heading' => __('Sq. feet', THEME_NAME), 'description' => __('Will display properties will area equal or larger than this value', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'pets_allowed', 'heading' => __('Pets allowed', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Will show properties that have either pets allowed or not.', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'type', 'heading' => __('Type', THEME_NAME), 'value' => $types_array), array("type" => 'checkbox', 'param_name' => 'feature', 'heading' => __('Feature', THEME_NAME), 'value' => $features_array), array("type" => 'dropdown', 'param_name' => 'city', 'heading' => __('City', THEME_NAME), 'value' => $cities), array("type" => 'dropdown', 'param_name' => 'for_sale_rent', 'heading' => __('For sale or rent', THEME_NAME), 'value' => array('-' => '', __('Sale', THEME_NAME) => 'sale', __('Rent', THEME_NAME) => 'rent'), 'description' => __('If you don\'t choose an option both will be shown', THEME_NAME)), array("type" => 'dropdown', 'param_name' => 'property_status', 'heading' => __('Property status', THEME_NAME), 'value' => array('' => '', __('Sold', THEME_NAME) => 'sold', __('Rented', THEME_NAME) => 'rented', __('Let agreed', THEME_NAME) => 'let_agreed', __('Sale agreed', THEME_NAME) => 'sale_agreed')), array("type" => 'textfield', 'param_name' => 'lat', 'heading' => __('Latitude', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'lng', 'heading' => __('Longitude', THEME_NAME)), array("type" => 'textfield', 'param_name' => 'distance', 'heading' => __('Distance', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'auto_slide', 'heading' => __('Auto slide', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Automatically slide properties in the carousel. It applies only for carousel style.', THEME_NAME)), array("type" => 'checkbox', 'param_name' => 'infinite_loop', 'heading' => __('Infinite slide', THEME_NAME), 'value' => array(__('Yes') => 'yes'), 'description' => __('Infinitely slide properties in the carousel. It applies only for carousel style.', THEME_NAME)))));
    }
}
Пример #7
0
<?php

$propMgr = new PropertiesManager();
$properties = $propMgr->getProperties('featured');
if (empty($properties)) {
    return;
}
$div_id = 'properties-carousel-' . rand();
?>
<div class="train-railing separator m10">
	<div class="railing"></div>
	<h3 class="train"><?php 
echo $title;
?>
</h3>
	<div class="railing"></div>
</div>

<div class="offers slide use-box-sizing-content-box" id="<?php 
echo $div_id;
?>
">
	<ul class="items grid">

	<?php 
foreach ($properties as $property) {
    extract($property->vars());
    ?>

		<li>
			<?php 
Пример #8
0
	<?php 
    }
    ?>
	
	<?php 
    if (estetico_get_setting('show_recently_viewed') == 'yes') {
        $options = array('exclude' => $property->getId());
        if (PropertiesManager::hasRecentlyViewed($options)) {
            ?>
	<div class="property-viewed property-recently-viewed">
		<h4><?php 
            _e('Recently viewed', THEME_NAME);
            ?>
</h4>
		<?php 
            echo PropertiesManager::getRecentlyViewedHTML($options);
            ?>
	</div>
	<?php 
        }
    }
    ?>

<script>
	try {
		var propertiesMap = null;
		var propertiesList = [
			{
				lat : '<?php 
    echo $property->getLatitude();
    ?>