rep__event_html()
This function, generates HTML representation of a property listing event. It includes details like event type, date, time, and venue, depending on the provided parameters.
Namespace
REP_Malcolm
Return
string
Property listing event
Source
File: \includes\rep-helper-functions.php
function rep__event_html( $event, $show_type = false, $show_venue = false, $show_date = true, $show_time = true ){
extract( $event );
ob_start();
if( $event_date ) :
$dateObj = DateTime::createFromFormat('Y-m-d', $event_date); ?>
<div class="rep-event event-<?=str_replace("_","-",$event_type)?>"><?php
if( $show_type ) : ?>
<div class="rep-event-type"><?=['open_home'=>'Open','auction'=>'Auction'][$event_type]?></div><?php
endif;
if( $show_date || $show_time ) : ?>
<div class="rep-event-day-time"><?php
if( $show_date ) :
echo rep__date_html( $dateObj, ['l','j','M'] );
endif;
if( ( $event_time || $event_end_time ) && $show_time ) : ?>
<span class="rep-time"><?php
if( $event_time ) : ?>
<span class="time start-time"><?=date('g:i a', strtotime($event_time))?></span><?php
endif;
if( $event_type != "auction" ) :
if( $event_time && $event_end_time ) : ?>
<span class="separator">-</span><?php
endif;
if( $event_end_time ) : ?>
<span class="time end-time"><?=date('g:i a', strtotime($event_end_time))?></span><?php
endif;
endif; ?>
</span><?php
endif; ?>
</div><?php
endif;
if( $show_venue && $event_venue ) : ?>
<div class="rep-event-venue"><?=$event_venue?></div><?php
endif; ?>
</div><?php
endif;
return ob_get_clean();
}