コード例 #1
0
ファイル: maps-util.php プロジェクト: lytranuit/wordpress
 public static function process_defaults($args)
 {
     $defaults = array('lat' => '42.37', 'lng' => '-71.03', 'center_location' => false, 'zoom' => '14', 'width' => 300, 'height' => 300, 'canvas_id' => 'map_canvas', 'class' => 'custom_google_map', 'map_js_var' => 'pls_google_map', 'featured_id' => false, 'request_params' => '', 'auto_load_listings' => false, 'polygon_search' => false, 'life_style_search' => false, 'show_lifestyle_controls' => false, 'show_lifestyle_checkboxes' => false, 'loading_overlay' => '<div>Loading...</div>', 'empty_overlay' => '<div>No Results</div>', 'search_on_load' => false, 'polygon_options' => array(), 'ajax_form_class' => false, 'polygon' => false, 'polygon_click_action' => false, 'lifestyle_distance' => 'miles', 'search_class' => 'pls_listings_search_results', 'lifestyle_select_poi' => '<div style="width: 100%; background-color:rgba(0,0,0,0.5); color: white">Select a Point of Interest to start searching</div>');
     $args = wp_parse_args($args, $defaults);
     self::$map_js_var = $args['map_js_var'];
     return $args;
 }
コード例 #2
0
		<?php 
PLS_Route::handle_dynamic();
?>

			<!-- Floating Map -->
			<aside>

				<section id="floating-box">
					<section id="map">
						<h3><?php 
_e('MAP', 'tampa');
?>
</h3>
						<?php 
echo PLS_Map::dynamic(null, array('zoom' => '10', 'width' => 290, 'height' => 314, 'canvas_id' => 'map_canvas', 'class' => 'custom_google_map', 'map_js_var' => 'pls_google_map', 'ajax_form_class' => false));
?>
					</section>
				</section>

			</aside>

			<div class="clr"></div>

		</div> <!-- /#inner -->
 
		<?php 
PLS_Route::handle_footer();
?>

	</div><!--TOP container-->
コード例 #3
0
ファイル: home.php プロジェクト: lytranuit/wordpress
            });

    		listings.init();
    		
    	});
    </script>

    <div id="slideshow" class="clearfix theme-default left bottomborder grid_8 alpha">
        <?php 
//echo PLS_Map::lifestyle(array(), array('width' => 590, 'height' => 300, 'life_style_search' => true,'show_lifestyle_controls' => true, 'show_lifestyle_checkboxes' => true, 'show_submit' => true, 'lat' => '41.815594', 'lng' => '-71.413879' ) );
?>
        <?php 
//echo PLS_Map::lifestyle_polygon(array(), array('width' => 590, 'height' => 300, 'life_style_search' => true,'show_lifestyle_controls' => true, 'show_lifestyle_checkboxes' => true, 'show_submit' => true, 'lat' => '41.815594', 'lng' => '-71.413879' ) );
?>
        <?php 
echo PLS_Map::listings(null, array('width' => 950, 'height' => 400));
?>
        <?php 
//echo PLS_Map::polygon(null, array('width' => 590, 'height' => 250, 'zoom' => 16,'map_js_var' => 'test2', 'canvas_id' => 'another2', 'polygon_search' => 'neighborhood', 'search_class' => 'another'));
?>

        <?php 
echo PLS_Partials::get_listings_search_form(array('context' => 'home_map', 'search_id' => 'another', 'class' => 'another', 'bedrooms' => 1, 'min_beds' => 0, 'max_beds' => 0, 'bathrooms' => 0, 'min_baths' => 0, 'max_baths' => 0, 'price' => 0, 'half_baths' => 0, 'property_type' => 0, 'listing_types' => 0, 'zoning_types' => 0, 'purchase_types' => 0, 'available_on' => 0, 'cities' => 0, 'states' => 0, 'zips' => 0, 'neighborhood' => 0, 'county' => 0, 'min_price' => 0, 'max_price' => 0, 'min_price_rental' => 0, 'max_price_rental' => 0, 'neighborhood_polygons' => 0));
?>
    	<?php 
echo PLS_Partials::get_listings_list_ajax(array('context' => 'custom_listings_search', 'table_id' => 'placester_listings_list', 'map_js_var' => 'test2'));
?>
 
    </div>

    <div id="listing" class="grid_8 alpha"></div>
コード例 #4
0
function custom_property_details_page($html, $listing)
{
    ob_start();
    ?>

<section id="lvl2">
	<div class="wrapper">
		<div id="property">
			<h2><?php 
    _e('Property Details', 'manchester');
    ?>
</h2>
				<section class="property-inf">
					<div class="property-title">
						<span class="blue"><b><?php 
    echo $listing['location']['full_address'];
    ?>
</b></span>
						<p><span><?php 
    echo $listing['cur_data']['beds'];
    ?>
 <?php 
    _e('Bedrooms', 'manchester');
    ?>
</span> <span><?php 
    echo $listing['cur_data']['baths'];
    ?>
 <?php 
    _e('Bathrooms', 'manchester');
    ?>
</span></p>
					</div>
		<div class="property-price">
			<span class="green"><b><?php 
    echo PLS_Format::number($listing['cur_data']['price'], array('abbreviate' => false, 'add_currency_sign' => true));
    ?>
</b></span>
		</div>
</section>

<section class="property-bin">
	<div class="property-img">
		<div class="img_box">
			<?php 
    if ($listing['images']) {
        ?>
				<?php 
        echo PLS_Image::load($listing['images'][0]['url'], array('resize' => array('w' => 600, 'h' => 250, 'method' => 'crop'), 'fancybox' => false, 'as_html' => true, 'html' => array('img_classes' => 'main-banner')));
        ?>
  
			<?php 
    } else {
        ?>
				<?php 
        echo PLS_Image::load(null, array('resize' => array('w' => 600, 'h' => 250, 'method' => 'crop'), 'fancybox' => false, 'as_html' => true, 'html' => array('img_classes' => 'main-banner')));
        ?>
  
			<?php 
    }
    ?>
		</div>
	</div>
</section>

<!-- sidebar container section -->
<section class="property-map">
	<div class="property-gmap">
		<?php 
    echo PLS_Map::dynamic($listing, array('lat' => $listing['location']['coords'][0], 'lng' => $listing['location']['coords'][1], 'zoom' => '14', 'width' => 338, 'height' => 230, 'canvas_id' => 'map_canvas', 'class' => 'custom_google_map', 'map_js_var' => 'pls_google_map', 'ajax_form_class' => false));
    ?>
	</div>

	<script type="text/javascript">
      jQuery(document).ready(function( $ ) {
        var map = new Map();
        var listing = new Listings({
          single_listing: <?php 
    echo json_encode($listing);
    ?>
,
          map: map
        });
        map.init({
          type: 'single_listing', 
          listings: listing,
          lat : <?php 
    echo json_encode($listing['location']['coords'][0]);
    ?>
,
          lng : <?php 
    echo json_encode($listing['location']['coords'][1]);
    ?>
,
          zoom : 14
        });
        listing.init();
      });
	</script>

	<div class="property-lnks">
		<!-- <section class="list-fav"><a href="#"><?php 
    _e('Add to favorites', 'manchester');
    ?>
</a></section> -->
		<section class="list-req"><a href="<?php 
    echo pls_get_option('pls-user-email');
    ?>
"><?php 
    _e('Request more info', 'manchester');
    ?>
</a></section>
	</div>
</section>

		<!-- </div>
	</div> end of wrapper
</section> -->


<section id="lvl4">
	<div class="wrapper">
		
		<section class="left-content">

			<section class="list2">
				<h5><?php 
    _e('DETAILS', 'manchester');
    ?>
</h5>
				
				<section class="list-item">
					<section class="list-details">

						<section class="list-details-1-2">
							<label><?php 
    _e('Zoning Type', 'manchester');
    ?>
</label>
							<p><?php 
    echo ucwords($listing['zoning_types'][0]);
    ?>
</p>
							<?php 
    if (isset($listing['purchase_types'][0])) {
        ?>
							<label><?php 
        _e('Listing Type', 'manchester');
        ?>
</label>
							<p><?php 
        echo ucwords($listing['purchase_types'][0]);
        ?>
</p>
							<?php 
    }
    ?>
							<?php 
    if ($listing['property_type']) {
        ?>
								<label><?php 
        _e('Property Type', 'manchester');
        ?>
</label>
								<p><?php 
        echo PLS_Format::translate_property_type($listing);
        ?>
</p>
							<?php 
    }
    ?>

							<?php 
    if (isset($listing['rets']['mls_id'])) {
        ?>
								<label><?php 
        _e('MLS#', 'manchester');
        ?>
</label>
								<p><?php 
        echo $listing['rets']['mls_id'];
        ?>
</p>
							<?php 
    } else {
        ?>
								<label><?php 
        _e('Ref #', 'manchester');
        ?>
</label>
								<p><?php 
        echo $listing['id'];
        ?>
</p>
							<?php 
    }
    ?>

						</section>

						<section class="list-details-2-2">
							<label><?php 
    _e('Bedrooms', 'manchester');
    ?>
</label>
							<p><?php 
    echo $listing['cur_data']['beds'];
    ?>
</p>
							<label><?php 
    _e('Bathrooms', 'manchester');
    ?>
</label>
							<p><?php 
    echo $listing['cur_data']['baths'];
    ?>
</p>
							<label><?php 
    _e('Half Baths', 'manchester');
    ?>
</label>
							<p><?php 
    echo $listing['cur_data']['half_baths'];
    ?>
</p>
						</section>

					</section>
				</section>

				<div class="separator-1-sma"></div>

				<?php 
    if ($listing['cur_data']['desc']) {
        ?>
					<h5><?php 
        _e('DESCRIPTION', 'manchester');
        ?>
</h5>
					<section class="list-item">
						<section class="list-details"><?php 
        echo $listing['cur_data']['desc'];
        ?>
</section>
					</section>
				<?php 
    }
    ?>

				<div class="separator-1-sma"></div>

				<?php 
    $amenities = PLS_Format::amenities_but($listing, array('half_baths', 'beds', 'baths', 'url', 'sqft', 'avail_on', 'price', 'desc'));
    ?>

				<?php 
    if (isset($amenities['list']) && $amenities['list'] != null) {
        ?>
					<?php 
        $amenities['list'] = PLS_Format::translate_amenities($amenities['list']);
        ?>
					<h5><?php 
        _e('PROPERTY AMENITIES', 'manchester');
        ?>
</h5>
						<section class="list-item">
							<section class="list-amenity">
								<?php 
        foreach ($amenities['list'] as $amenity => $value) {
            ?>
									<label><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</label>
								<?php 
        }
        ?>
							</section>
						</section>

						<div class="separator-1-sma"></div>
				<?php 
    }
    ?>

				<?php 
    if (isset($amenities['ngb']) && $amenities['ngb'] != null) {
        ?>
					<?php 
        $amenities['ngb'] = PLS_Format::translate_amenities($amenities['ngb']);
        ?>
					<h5><?php 
        _e('NEIGHBORHOOD AMENITIES', 'manchester');
        ?>
</h5>
						<section class="list-item">
							<section class="list-amenity">
								<?php 
        foreach ($amenities['ngb'] as $amenity => $value) {
            ?>
									<label><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</label>
								<?php 
        }
        ?>
							</section>
						</section>

						<div class="separator-1-sma"></div>
				<?php 
    }
    ?>

				<?php 
    if (isset($amenities['uncur']) && $amenities['uncur'] != null) {
        ?>
					<?php 
        $amenities['uncur'] = PLS_Format::translate_amenities($amenities['uncur']);
        ?>
					<h5><?php 
        _e('CUSTOM AMENITIES', 'manchester');
        ?>
</h5>
						<section class="list-item">
							<section class="list-amenity">
								<?php 
        foreach ($amenities['uncur'] as $amenity => $value) {
            ?>
									<label><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</label>
								<?php 
        }
        ?>
							</section>
						</section>

						<div class="separator-1-sma"></div>
				<?php 
    }
    ?>

			</section><!-- /.list2 -->
		</section><!-- /.left-content -->


		<aside class="sidebar">
			<section class="side-bin2">

				<?php 
    if ($listing['images']) {
        ?>
				<h5><?php 
        _e('PHOTO GALLERY', 'manchester');
        ?>
</h5>
				<section class="gallery">
					<?php 
        foreach ($listing['images'] as $image) {
            ?>
							<?php 
            echo PLS_Image::load($image['url'], array('resize' => array('w' => 140, 'h' => 93, 'method' => 'crop'), 'fancybox' => true, 'as_html' => false));
            ?>
					<?php 
        }
        ?>
				</section>
				<?php 
    }
    ?>
			</section>
		</aside>

		<div class="clr"></div>
	
	</div><!-- end of wrapper -->
</section>


<section id="lvl5">
	<div class="wrapper">

		<section class="neighborhood">

			<h5><?php 
    _e('NEIGHBORHOOD', 'manchester');
    ?>
</h5>
			<section class="neighborhood-map">
				<?php 
    echo PLS_Map::dynamic($listing, array('lat' => $listing['location']['coords'][0], 'lng' => $listing['location']['coords'][1], 'zoom' => '13', 'width' => 960, 'height' => 258, 'canvas_id' => 'map_canvas_nbr', 'class' => 'custom_google_map_nbr', 'map_js_var' => 'pls_google_map_nbr', 'ajax_form_class' => false));
    ?>
			</section>

			<script type="text/javascript">
		        jQuery(document).ready(function( $ ) {
		          var map_nbr = new Map();
		          var listing_nbr = new Listings({
		            single_listing: <?php 
    echo json_encode($listing);
    ?>
,
		            map: map_nbr
		          });
		          map_nbr.init({
		            type: 'single_listing', 
		            dom_id: 'map_canvas_nbr',
		            listings: listing_nbr,
		            lat: <?php 
    echo json_encode($listing['location']['coords'][0]);
    ?>
,
		            lng: <?php 
    echo json_encode($listing['location']['coords'][1]);
    ?>
,
		            zoom: 14
		          });
		          listing_nbr.init();
		        });
			</script>
		
		</section>
		

		<?php 
    PLS_Listing_Helper::get_compliance(array('context' => 'listings', 'agent_name' => $listing['rets']['aname'], 'office_name' => $listing['rets']['oname'], 'office_phone' => PLS_Format::phone($listing['contact']['phone']), 'agent_license' => isset($listing['rets']['alicense']) ? $listing['rets']['alicense'] : false, 'co_agent_name' => isset($listing['rets']['aconame']) ? $listing['rets']['aconame'] : false, 'co_office_name' => isset($listing['rets']['oconame']) ? $listing['rets']['oconame'] : false));
    ?>
	</div><!-- end of wrapper -->
</section>

	<?php 
    return ob_get_clean();
}
コード例 #5
0
ファイル: attribute.php プロジェクト: lytranuit/wordpress
				<h3><?php 
    echo $taxonomy['one-sentance'];
    ?>
</h3>		
			<?php 
}
?>

			<h3><?php 
echo $taxonomy['another'];
?>
</h3>
		</div>
		<div class="map polygon-too">
			<?php 
echo PLS_Map::neighborhood($taxonomy['listings_raw'], array('width' => 590, 'height' => 250, 'zoom' => 16), array(), $taxonomy['polygon']);
?>
		</div>
		<div class="all-listings">
			<?php 
echo $taxonomy['listings'];
?>
		</div>
		<div class="attached-photos">
		<?php 
if (isset($taxonomy['one-sentance'])) {
    ?>
				<h3><?php 
    echo $taxonomy['one-sentance'];
    ?>
</h3>		
コード例 #6
0
ファイル: property-details.php プロジェクト: russtx/tac
function custom_property_details_page($html, $listing)
{
    ob_start();
    // pls_dump($listing);
    ?>
<div id="main">
	
	<section class="property-banner">
		<?php 
    if ($listing['images']) {
        ?>
      <?php 
        echo PLS_Image::load($listing['images'][0]['url'], array('resize' => array('w' => 625, 'h' => 292, 'method' => 'crop'), 'fancybox' => false, 'as_html' => true, 'html' => array('img_classes' => 'main-banner')));
        ?>
  
    <?php 
    } else {
        ?>
      <?php 
        echo PLS_Image::load(null, array('resize' => array('w' => 625, 'h' => 292, 'method' => 'crop'), 'fancybox' => false, 'as_html' => true, 'html' => array('img_classes' => 'main-banner')));
        ?>
    <?php 
    }
    ?>
  	<p class="state"><?php 
    echo $listing['location']['full_address'];
    ?>
 <span class="rent"><?php 
    echo PLS_Format::number($listing['cur_data']['price'], array('abbreviate' => false, 'add-currency-sign' => true));
    ?>
<em></em></span><br><span class="details"><?php 
    echo $listing['cur_data']['beds'];
    ?>
 <?php 
    _e('Bedrooms', 'tampa');
    ?>
 | <?php 
    echo $listing['cur_data']['baths'];
    ?>
 <?php 
    _e('Bathrooms', 'tampa');
    ?>
</span></p>
  </section>

	<section class="user-generated">
		<h3><?php 
    _e('Details', 'tampa');
    ?>
</h3>
		<ul class="list-half">
			<li><?php 
    _e('Listing Type', 'tampa');
    ?>
 <span><?php 
    echo ucwords($listing['purchase_types'][0]);
    ?>
</span></li>
			<li><?php 
    _e('Bedrooms', 'tampa');
    ?>
 <span><?php 
    echo $listing['cur_data']['beds'];
    ?>
</span></li>
			<li><?php 
    _e('Property Type', 'tampa');
    ?>
				<span><?php 
    echo PLS_Format::translate_property_type($listing);
    ?>
</span>
			</li>
			<li><?php 
    _e('Bathrooms', 'tampa');
    ?>
 <span><?php 
    echo $listing['cur_data']['baths'];
    ?>
</span></li>
		  <?php 
    if (isset($listing['rets']['mls_id'])) {
        ?>
		    <li><?php 
        _e('MLS #', 'tampa');
        ?>
    		<span><?php 
        echo $listing['rets']['mls_id'];
        ?>
</span>
        </li>
    	<?php 
    }
    ?>
			<li><?php 
    _e('Half Baths', 'tampa');
    ?>
 <span><?php 
    echo $listing['cur_data']['half_baths'];
    ?>
</span></li>                                                            
		</ul><!--list-half-->
		<div class="clr"></div>
	</section><!--user-generated-->

	<?php 
    if ($listing['cur_data']['desc']) {
        ?>
		<section class="user-generated">
			<h3><?php 
        _e('Description', 'tampa');
        ?>
</h3>
			<p><?php 
        echo $listing['cur_data']['desc'];
        ?>
</p>
		</section>
	<?php 
    }
    ?>

	<?php 
    $amenities = PLS_Format::amenities_but($listing, array('half_baths', 'beds', 'baths', 'url', 'sqft', 'avail_on', 'price', 'desc'));
    ?>

	<?php 
    if (isset($amenities['list']) && $amenities['list'] != null) {
        ?>
		<section class="user-generated">
			<h3><?php 
        _e('Property Amenities', 'tampa');
        ?>
</h3>
			<ul class="list-third">
				<?php 
        $amenities['list'] = PLS_Format::translate_amenities($amenities['list']);
        ?>
				<?php 
        foreach ($amenities['list'] as $amenity => $value) {
            ?>
					<li><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</li>
				<?php 
        }
        ?>
			</ul>
			<div class="clr"></div>
		</section>
	<?php 
    }
    ?>

	<?php 
    if (isset($amenities['ngb']) && $amenities['ngb'] != null) {
        ?>
		<section class="user-generated">
			<h3><?php 
        _e('Neighborhood Amenities', 'tampa');
        ?>
</h3>
			<ul class="list-third">
				<?php 
        $amenities['ngb'] = PLS_Format::translate_amenities($amenities['ngb']);
        ?>
				<?php 
        foreach ($amenities['ngb'] as $amenity => $value) {
            ?>
					<li><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</li>
				<?php 
        }
        ?>
			</ul>
			<div class="clr"></div>
		</section>
	<?php 
    }
    ?>

	<?php 
    if (isset($amenities['uncur']) && $amenities['uncur'] != null) {
        ?>
		<section class="user-generated">
			<h3><?php 
        _e('Property Amenities', 'tampa');
        ?>
</h3>
			<ul class="list-third">
			<?php 
        $amenities['uncur'] = PLS_Format::translate_amenities($amenities['uncur']);
        ?>
				<?php 
        foreach ($amenities['uncur'] as $amenity => $value) {
            ?>
					<li><span><?php 
            echo $amenity;
            ?>
</span> <?php 
            echo $value;
            ?>
</li>
				<?php 
        }
        ?>
			</ul>
			<div class="clr"></div>
		</section>
	<?php 
    }
    ?>


</div><!--main-->
  
<aside>
	<section id="single-property-mini-map">
		<h3><php _e('Location', 'tampa'); ?></h3>
		<?php 
    echo PLS_Map::dynamic($listing, array('lat' => $listing['location']['coords'][0], 'lng' => $listing['location']['coords'][1], 'zoom' => '14', 'width' => 288, 'height' => 217, 'canvas_id' => 'map_canvas', 'class' => 'custom_google_map', 'map_js_var' => 'pls_google_map', 'ajax_form_class' => false));
    ?>

		<script type="text/javascript">
	      jQuery(document).ready(function( $ ) {
	        var map = new Map();
	        var listing = new Listings({
	          single_listing: <?php 
    echo json_encode($listing);
    ?>
,
	          map: map
	        });
	        map.init({
	          type: 'single_listing', 
	          listings: listing,
	          lat : <?php 
    echo json_encode($listing['location']['coords'][0]);
    ?>
,
	          lng : <?php 
    echo json_encode($listing['location']['coords'][1]);
    ?>
,
	          zoom : 14
	        });
	        listing.init();
	      });
    	</script>

	    <div class="map-bar">
	    	<!-- <a class="fav-org" href="#">Add to Favorites</a> -->
	      	<a class="info-org" href="mailto:<?php 
    echo pls_get_option('pls-user-email');
    ?>
"><?php 
    _e('Request More Info', 'tampa');
    ?>
</a>
	      	<div class="clr"></div>
	    </div><!--map-bar-->
	</section>

	<?php 
    if ($listing['images']) {
        ?>
		<section id="gallery">
			<h3><?php 
        _e('Photo Gallery', 'tampa');
        ?>
</h3>    
			<?php 
        foreach ($listing['images'] as $image) {
            ?>
					<?php 
            echo PLS_Image::load($image['url'], array('resize' => array('w' => 120, 'h' => 95, 'method' => 'crop'), 'fancybox' => true, 'as_html' => false));
            ?>
 
			<?php 
        }
        ?>
		</section><!--gallery-->
	<?php 
    }
    ?>

</aside>

<div class="clr"></div>

<section id="full">
  	<section class="user-generated">
	    <h3><?php 
    _e('Neighborhood', 'tampa');
    ?>
</h3>      
	    <?php 
    echo PLS_Map::dynamic($listing, array('lat' => $listing['location']['coords'][0], 'lng' => $listing['location']['coords'][1], 'zoom' => '14', 'width' => 930, 'height' => 260, 'canvas_id' => 'map_canvas_nbr', 'class' => 'custom_google_map_nbr', 'map_js_var' => 'pls_google_map_nbr', 'ajax_form_class' => false));
    ?>
  	</section>

  	<script type="text/javascript">
        jQuery(document).ready(function( $ ) {
          var map_nbr = new Map();
          var listing_nbr = new Listings({
            single_listing: <?php 
    echo json_encode($listing);
    ?>
,
            map: map_nbr
          });
          map_nbr.init({
            type: 'single_listing', 
            dom_id: 'map_canvas_nbr',
            listings: listing_nbr,
            lat: <?php 
    echo json_encode($listing['location']['coords'][0]);
    ?>
,
            lng: <?php 
    echo json_encode($listing['location']['coords'][1]);
    ?>
,
            zoom: 14
          });
          listing_nbr.init();
        });
	</script>
  
	<?php 
    if (isset($listing['cur_data']['mls_number']) && isset($listing['mls_logo'])) {
        ?>
		<section class="user-generated">
		    <h3><?php 
        _e('Listing Supply Source', 'tampa');
        ?>
</h3>
				<p class="p-supply"><?php 
        _e('MLS #', 'tampa');
        ?>
: <?php 
        echo $listing['cur_data']['mls_number'];
        ?>
</p>
		    <div class="clr"></div>
	  	</section>
	<?php 
    }
    ?>
	
	<?php 
    PLS_Listing_Helper::get_compliance(array('context' => 'listings', 'agent_name' => $listing['rets']['aname'], 'office_name' => $listing['rets']['oname'], 'office_phone' => PLS_Format::phone($listing['contact']['phone']), 'agent_license' => isset($listing['rets']['alicense']) ? $listing['rets']['alicense'] : false, 'co_agent_name' => isset($listing['rets']['aconame']) ? $listing['rets']['aconame'] : false, 'co_office_name' => isset($listing['rets']['oconame']) ? $listing['rets']['oconame'] : false));
    ?>
</section><!--full-->

<?php 
    return ob_get_clean();
}
コード例 #7
0
        ?>
                <li><span><?php 
        echo $amenity;
        ?>
</span> <?php 
        echo $value;
        ?>
</li>
            <?php 
    }
    ?>
        </div>	
    <?php 
}
?>

    <div class="map-wrapper grid_8 alpha">
        <h3>Property Map</h3>
        <div class="map">
            <?php 
echo PLS_Map::dynamic($listing_data, array('lat' => $listing_data['location']['coords'][0], 'lng' => $listing_data['location']['coords'][1], 'width' => 590, 'height' => 250, 'zoom' => 16));
?>
        </div>
    </div>
	<?php 
PLS_Listing_Helper::get_compliance(array('context' => 'listings', 'agent_name' => $listing_data['rets']['aname'], 'office_name' => $listing_data['rets']['oname']));
?>
</article>
<?php 
$html = ob_get_clean();
echo apply_filters('property_details_filter', $html, $listing_data);
コード例 #8
0
    public static function init($content)
    {
        global $post;
        if ($post->post_type == 'property') {
            $html = '';
            $listing_data = PLS_Plugin_API::get_listing_in_loop();
            // re-order images by assigned order
            $property_images = is_array($listing_data['images']) ? $listing_data['images'] : array();
            usort($property_images, array('PLS_Partials_Property_Details', 'sort_images_by_order'));
            // reset the images
            $listing_data['images'] = $property_images;
            // Problems with API key or inconsistent data lead to notices due to null listings
            if (!is_null($listing_data)) {
                $listing_data['location']['full_address'] = $listing_data['location']['address'] . ' ' . $listing_data['location']['locality'] . ' ' . $listing_data['location']['region'];
                // This has to happen here to ensure it's not filtered out by whatever might be filtering this output...
                echo PLS_Plugin_API::log_snippet_js('listing_view', array('prop_id' => $listing_data['id']));
                ob_start();
                ?>
					<h2 itemprop="name" itemscope itemtype="http://schema.org/PostalAddress">
						<span itemprop="streetAdress"><?php 
                echo $listing_data['location']['address'];
                ?>
</span> <span itemprop="addressLocality"><?php 
                echo $listing_data['location']['locality'];
                ?>
</span>, <span itemprop="addressRegion"><?php 
                echo $listing_data['location']['region'];
                ?>
</span>
					</h2>
	
					<?php 
                echo PLS_Plugin_API::placester_favorite_link_toggle(array('property_id' => $listing_data['id'], 'add_text' => 'Add To Favorites', 'remove_text' => 'Remove From Favorites'));
                ?>
	
					<p itemprop="price"><?php 
                echo PLS_Format::number($listing_data['cur_data']['price'], array('abbreviate' => false, 'add_currency_sign' => true));
                ?>
 <span><?php 
                echo PLS_Format::translate_lease_terms($listing_data);
                ?>
</span></p>
	
					<p class="listing_type"><?php 
                if (isset($listing_data['zoning_types'][0]) && isset($listing_data['purchase_types'][0])) {
                    echo ucwords(@$listing_data['zoning_types'][0] . ' ' . @$listing_data['purchase_types'][0]);
                }
                ?>
</p>

					<div class="clearfix"></div>
	
					<?php 
                if ($listing_data['images']) {
                    ?>
						<div class="theme-default property-details-slideshow">
							<?php 
                    echo PLS_Image::load($listing_data['images'][0]['url'], array('resize' => array('w' => 590, 'h' => 300), 'fancybox' => false, 'as_html' => true, 'html' => array('itemprop' => 'image')));
                    ?>
							<?php 
                    // echo PLS_Slideshow::slideshow( array( 'anim_speed' => 1000, 'pause_time' => 15000, 'control_nav' => true, 'width' => 620, 'height' => 300, 'context' => 'home', 'data' => PLS_Slideshow::prepare_single_listing($listing_data) ) );
                    ?>
						</div>

						<div class="details-wrapper grid_8 alpha">
							<div id="slideshow" class="clearfix theme-default left bottomborder">
								<div class="grid_8 alpha">
									<ul class="property-image-gallery grid_8 alpha">
										<?php 
                    foreach ($listing_data['images'] as $images) {
                        ?>
											<li><?php 
                        echo PLS_Image::load($images['url'], array('resize' => array('w' => 100, 'h' => 75), 'fancybox' => true, 'as_html' => true, 'html' => array('itemprop' => 'image')));
                        ?>
</li>
										<?php 
                    }
                    ?>
									</ul>
								</div>

							</div>
						</div>
					<?php 
                }
                ?>
	                
	                <div class="basic-details grid_8 alpha">
	                    <ul>
	                        <li><span>Beds: </span><?php 
                echo $listing_data['cur_data']['beds'];
                ?>
</li>
	                        <li><span>Baths: </span><?php 
                echo $listing_data['cur_data']['baths'];
                ?>
</li>
	                        <?php 
                if (isset($listing_data['cur_data']['half_baths']) && $listing_data['cur_data']['half_baths'] != null) {
                    ?>
	                        	<li><span>Half Baths: </span><?php 
                    echo $listing_data['cur_data']['half_baths'];
                    ?>
</li>
	                        <?php 
                }
                ?>
	                        <li><span>Square Feet: </span><?php 
                echo PLS_Format::number($listing_data['cur_data']['sqft'], array('abbreviate' => false, 'add_currency_sign' => false));
                ?>
</li>
	                        <?php 
                if (isset($listing_data['cur_data']['avail_on']) && $listing_data['cur_data']['avail_on'] != null) {
                    ?>
	                        	<li itemprop="availability"><span>Available: </span><?php 
                    echo @$listing_data['cur_data']['avail_on'];
                    ?>
</li>
	                        <?php 
                }
                ?>
	                        <li>Property Type: <?php 
                echo PLS_Format::translate_property_type($listing_data);
                ?>
</li>
	                        <?php 
                if (isset($listing_data['rets']) && isset($listing_data['rets']['mls_id'])) {
                    ?>
	                        	<li><span>MLS #: </span><?php 
                    echo $listing_data['rets']['mls_id'];
                    ?>
</li>	
	                        <?php 
                }
                ?>
	                    </ul>
	                </div>
	
	                <div class="details-wrapper grid_8 alpha">
	                    <h3>Property Description</h3>
	                    <?php 
                if (!empty($listing_data['cur_data']['desc'])) {
                    ?>
	                        <p itemprop="description"><?php 
                    echo $listing_data['cur_data']['desc'];
                    ?>
</p>
	                    <?php 
                } else {
                    ?>
	                        <p> No description available </p>
	                    <?php 
                }
                ?>
	                </div>
	
	                
	
	                <?php 
                $amenities = PLS_Format::amenities_but($listing_data, array('half_baths', 'beds', 'baths', 'url', 'sqft', 'avail_on', 'price', 'desc'));
                ?>
	               
	                <?php 
                if (!empty($amenities['list'])) {
                    ?>
	                  <div class="amenities-section grid_8 alpha">
	                    <h3>Listing Amenities</h3>
	                    <ul>
	                    <?php 
                    $amenities['list'] = PLS_Format::translate_amenities($amenities['list']);
                    ?>
	                      <?php 
                    foreach ($amenities['list'] as $amenity => $value) {
                        ?>
	                        <li><span><?php 
                        echo $amenity;
                        ?>
</span> <?php 
                        echo $value;
                        ?>
</li>
	                      <?php 
                    }
                    ?>
	                    </ul>
		                </div>	
	                <?php 
                }
                ?>
	                <?php 
                if (!empty($amenities['ngb'])) {
                    ?>
		                <div class="amenities-section grid_8 alpha">
		                  <h3>Local Amenities</h3>
	                    <ul>
		                  <?php 
                    $amenities['ngb'] = PLS_Format::translate_amenities($amenities['ngb']);
                    ?>
		                    <?php 
                    foreach ($amenities['ngb'] as $amenity => $value) {
                        ?>
		                      <li><span><?php 
                        echo $amenity;
                        ?>
</span> <?php 
                        echo $value;
                        ?>
</li>
		                    <?php 
                    }
                    ?>
		                  </ul>
		                </div>
	                <?php 
                }
                ?>
	                
	                <?php 
                if (!empty($amenities['uncur'])) {
                    ?>
		                <div class="amenities-section grid_8 alpha">
		                  <h3>Custom Amenities</h3>
	                    <ul>
		                  <?php 
                    $amenities['uncur'] = PLS_Format::translate_amenities($amenities['uncur']);
                    ?>
		                    <?php 
                    foreach ($amenities['uncur'] as $amenity => $value) {
                        ?>
		                      <li><span><?php 
                        echo $amenity;
                        ?>
</span> <?php 
                        echo $value;
                        ?>
</li>
		                    <?php 
                    }
                    ?>
	                    </ul>
		                </div>	
	                <?php 
                }
                ?>
	
		            <div class="map-wrapper grid_8 alpha">
		                <h3>Property Map</h3>
                        <script type="text/javascript">
                          jQuery(document).ready(function( $ ) {
                            var map = new Map();
                            var listing = new Listings({
                              single_listing : <?php 
                echo json_encode($listing_data);
                ?>
,
                              map: map
                            });
                            map.init({
                              type: 'single_listing', 
                              listings: listing,
                              lat : <?php 
                echo json_encode($listing_data['location']['coords'][0]);
                ?>
,
                              lng : <?php 
                echo json_encode($listing_data['location']['coords'][1]);
                ?>
,
                              zoom : 14
                            });
                            listing.init();
                          });
     	                </script>
	                    <div class="map">
     	                  <?php 
                echo PLS_Map::dynamic($listing_data, array('lat' => $listing_data['location']['coords'][0], 'lng' => $listing_data['location']['coords'][1], 'height' => 250, 'zoom' => 16));
                ?>
	                    </div>
		            </div>
	              
	              	<?php 
                PLS_Listing_Helper::get_compliance(array('context' => 'listings', 'agent_name' => @$listing_data['rets']['aname'], 'office_name' => @$listing_data['rets']['oname']));
                ?>
	
		      	<?php 
                // Store output...
                $html = ob_get_clean();
            }
            // Enable Lead Capture
            $lead_capture_enable = pls_get_option('pd-lc-enable');
            if ($lead_capture_enable == 1) {
                ob_start();
                ?>
	                <!-- Lead Capture Shortcode -->
	                <div style="display:none;" href="#" id="property-details-lead-capture">
	                  <?php 
                do_shortcode('[lead_capture_template 
	                        lead_capture_cookie="true" 
	                        name_required="true" 
	                        question_required="false" 
	                        width="440"]');
                ?>
	                </div>
                <?php 
                // Store output...
                $lead_capture_block = ob_get_clean();
            }
            $html = apply_filters('property_details_filter', $html, $listing_data);
            // Add lead capture block to HTML
            if (isset($lead_capture_block)) {
                $html = $lead_capture_block . $html;
            }
            return $html;
        }
        // Post is not of type property, so just return what was initially passed in...
        return $content;
    }