Example #1
0
<?php

$is_sticky = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'sticky', true);
?>

<div class="property-box">
    <div class="property-box-image <?php 
if (!has_post_thumbnail()) {
    echo "without-image";
}
?>
">

        <?php 
$agent = Realia_Query::get_property_agent();
?>

        <a href="<?php 
the_permalink();
?>
" class="property-box-image-inner <?php 
if (!empty($agent)) {
    ?>
has-agent<?php 
}
?>
">
            <?php 
if (has_post_thumbnail()) {
    ?>
                <?php 
Example #2
0
				<?php 
if (!empty($contract)) {
    ?>
					<dt><?php 
    echo __('Tipo Negocio', 'realia');
    ?>
</dt><dd><?php 
    echo esc_attr($contract);
    ?>
</dd>
				<?php 
}
?>

				<?php 
$location = Realia_Query::get_property_location_name();
?>
				<?php 
if (!empty($location)) {
    ?>
					<dt><?php 
    echo __('UbicaciĆ³n', 'realia');
    ?>
</dt><dd><?php 
    echo wp_kses($location, wp_kses_allowed_html('post'));
    ?>
</dd>
				<?php 
}
?>
Example #3
0
?>
    </a><!-- /.agent-medium-image -->

    <div class="agent-medium-content">
        <h2 class="agent-medium-title">
            <a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a>
        </h2>

        <?php 
$properties_count = Realia_Query::get_agent_properties()->post_count;
?>
        <?php 
$properties_count = !empty($properties_count) ? $properties_count : 0;
?>
    
        <div class="agent-medium-subtitle">
            <?php 
echo esc_attr($properties_count);
?>
 <?php 
echo __('properties', 'realia');
?>
        </div><!-- /.agent-medium-subtitle -->

        <hr>
Example #4
0
    }
    ?>


	<?php 
    wp_reset_query();
    ?>

<?php 
}
?>


<!-- SIMILAR PROPERTIES -->
<?php 
Realia_Query::loop_properties_similar();
?>


<?php 
if (have_posts()) {
    ?>

	<h2 class="page-header"><?php 
    echo __('Propiedades Similares', 'realia');
    ?>
</h2>

	<div class="row">
		<?php 
    while (have_posts()) {
Example #5
0
</td>
			<?php 
    }
    ?>
		</tr>
		<!-- CONTRACT  -->
		<tr>
			<td class="compare-table-label"><?php 
    echo __('Alcobas', 'realia');
    ?>
</td>
			<?php 
    foreach ($query->posts as $post) {
        ?>
				<?php 
        $contract = Realia_Query::get_property_contract_name();
        ?>
				<td class="compare-table-col"><?php 
        echo !empty($contract) ? esc_attr($contract) : '-';
        ?>
</td>
			<?php 
    }
    ?>
		</tr>
		<!-- BEDS  -->
		<tr>
			<td class="compare-table-label"><?php 
    echo __('Alcobas', 'realia');
    ?>
</td>
Example #6
0
	    	 data-latitude="<?php 
    echo esc_attr($location['latitude']);
    ?>
" 
	    	 data-longitude="<?php 
    echo esc_attr($location['longitude']);
    ?>
">
	    </div><!-- /#map-property -->
	</div><!-- /.map-property -->
<?php 
}
?>

<?php 
Realia_Query::loop_agency_agents();
?>

<?php 
if (have_posts()) {
    ?>
	
	<h2 class="page-header"><?php 
    echo __('Assigned agents', 'realia');
    ?>
</h2>

	<div class="row">
		<?php 
    while (have_posts()) {
        the_post();
 /**
  * Set property status for properties
  *
  * @access public
  * @return void
  */
 public static function check_properties()
 {
     if (get_theme_mod('realia_submission_type') != 'packages') {
         return;
     }
     $options = array();
     $users = get_users($options);
     foreach ($users as $user) {
         $query = Realia_Query::get_properties_by_user($user->ID);
         $items = $query->posts;
         if (count($items) == 0) {
             continue;
         }
         // Check if package is valid
         $is_package_valid = self::is_package_valid_for_user($user->ID);
         if (!$is_package_valid) {
             // Unpublish all properties
             self::unpublish_properties($items);
         } else {
             // Get remaining posts available to create
             $remaining = self::get_remaining_properties_count_for_user($user->ID);
             if ($remaining === 'unlimited' || $remaining >= 0) {
                 // Publish all properties
                 self::publish_properties($items);
             } else {
                 // Publish available properties
                 self::publish_properties(array_slice($items, abs($remaining), count($items) - abs($remaining)));
                 // Unpublish abs(remaining) properties
                 self::unpublish_properties(array_slice($items, 0, abs($remaining)));
             }
         }
     }
 }
Example #8
0
the_excerpt();
?>
</p>
        </div><!-- /.property-row-body -->

        <?php 
$price = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'price', true);
?>
        <?php 
$area = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'attributes_area', true);
?>
        <?php 
$contract = Realia_Query::get_property_contract_name();
?>
        <?php 
$type = Realia_Query::get_property_type_name();
?>

        <div class="property-row-meta">        
            <?php 
if (!empty($type)) {
    ?>
            
                <div class="property-row-meta-item">
                    <span><i class="fa fa-info"></i></span>
                    <strong><?php 
    echo esc_attr($type);
    ?>
</strong>
                </div><!-- /.property-box-meta-item -->
            <?php 
    ?>
                <?php 
    while (have_posts()) {
        the_post();
        ?>
                    <?php 
        include Realia_Template_Loader::locate('properties/row');
        ?>
                <?php 
    }
    ?>
            <?php 
}
?>
            <?php 
Realia_Query::loop_reset();
?>
        </div><!-- /.fullscreen-map-sidebar-inner -->
    </div><!-- /.fullscreen-map-sidebar -->

    <div class="fullscreen-map-content">
        <div id="fullscreen-map"
             data-transparent-marker-image="<?php 
echo get_template_directory_uri();
?>
/assets/img/transparent-marker-image.png"></div>
    </div><!-- /.fullscreen-map-content -->
</div><!-- /.fullscreen-map -->

<?php 
get_footer('empty');
Example #10
0
    ?>
	<div class="mb30 text-grey">
		<?php 
    the_content();
    ?>
	</div>
<?php 
}
?>

<?php 
include 'agents/card.php';
?>

<?php 
Realia_Query::loop_agent_properties();
?>

<?php 
if (have_posts()) {
    ?>
	<h2 class="page-header"><?php 
    echo __('Assigned properties', 'realia');
    ?>
</h2>

	<div class="row">
		<?php 
    while (have_posts()) {
        the_post();
        ?>
 /**
  * Catch template and render JSON output
  *
  * @access public
  * @return string
  */
 public static function catch_template()
 {
     if (get_query_var('properties-feed')) {
         header('HTTP/1.0 200 OK');
         header('Content-Type: application/json');
         $property_groups = array();
         $data = array();
         Realia_Query::loop_properties_all();
         Realia_Query::loop_properties_filter();
         if (have_posts()) {
             while (have_posts()) {
                 the_post();
                 // Property GPS positions. We will use these values
                 // for genearating unique md5 hash for property groups.
                 $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true);
                 $latitude = $location['latitude'];
                 $longitude = $location['longitude'];
                 // Build on array of property groups. We need to know how
                 // many and which properties are at the same position.
                 if (!empty($latitude) && !empty($longitude)) {
                     $hash = sha1($latitude . $longitude);
                     $property_groups[$hash][] = get_the_ID();
                 }
             }
         }
         wp_reset_query();
         foreach ($property_groups as $group) {
             $args = array('post_type' => 'property', 'posts_per_page' => -1, 'post_status' => 'publish', 'post__in' => $group);
             query_posts($args);
             if (have_posts()) {
                 // Group of properties at the same position so we will process
                 // property loop inside the template.
                 if (count($group) > 1) {
                     $location = get_post_meta($group[0], REALIA_PROPERTY_PREFIX . 'map_location', true);
                     $latitude = $location['latitude'];
                     $longitude = $location['longitude'];
                     // Marker
                     ob_start();
                     $template = Realia_Template_Loader::locate('google-map-infowindow-group');
                     include $template;
                     $output = ob_get_contents();
                     ob_end_clean();
                     $content = str_replace(array("\r\n", "\n", "\t"), '', $output);
                     // Infowindow
                     ob_start();
                     $template = Realia_Template_Loader::locate('google-map-marker-group');
                     include $template;
                     $output = ob_get_contents();
                     ob_end_clean();
                     $marker_content = str_replace(array("\r\n", "\n", "\t"), '', $output);
                     // Just one property. We can get current post here.
                 } else {
                     the_post();
                     $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true);
                     $latitude = $location['latitude'];
                     $longitude = $location['longitude'];
                     $content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-infowindow'));
                     $marker_content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-marker'));
                 }
                 // Array of values passed into markers[] array in jquery-google-map.js library
                 $data[] = array('latitude' => $latitude, 'longitude' => $longitude, 'content' => $content, 'marker_content' => $marker_content);
             }
             wp_reset_query();
         }
         echo json_encode($data);
         exit;
     }
 }
    ?>
			<?php 
    while (have_posts()) {
        the_post();
        ?>
				<?php 
        if (get_theme_mod('realia_general_show_property_archive_as_grid', null) == '1') {
            ?>
					<div class="property-container">
						<?php 
            echo Realia_Template_Loader::load('properties/box');
            ?>
					</div><!-- /.property-container -->

					<?php 
            if (0 == ($index + 1) % 3 && Realia_Query::loop_has_next()) {
                ?>
						</div><div class="properties-row">
					<?php 
            }
            ?>
				<?php 
        } else {
            ?>
					<?php 
            echo Realia_Template_Loader::load('properties/row');
            ?>
				<?php 
        }
        ?>
				<?php 
Example #13
0
                <?php 
}
?>
            </a>
        </div><!-- /.agency-row-image -->

        <div class="agency-row-content col-sm-9 col-md-5">
            <h2 class="agency-row-title"><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h2>
            <div class="agency-row-subtitle"><?php 
echo Realia_Query::get_agency_agents()->post_count;
?>
 <?php 
echo __('agents', 'realia');
?>
</div>
            <hr>
            <?php 
the_excerpt();
?>
        </div>

        <div class="agency-row-info col-sm-12 col-md-4">
            <?php 
$address = get_post_meta(get_the_ID(), REALIA_AGENCY_PREFIX . 'address', true);
?>