Skip to content

Commit

Permalink
added layout 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat1192 committed Feb 26, 2025
1 parent cd7ae95 commit 5e7c352
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 27 deletions.
149 changes: 148 additions & 1 deletion assets/css/import-eventbrite-events.css
Original file line number Diff line number Diff line change
Expand Up @@ -1070,4 +1070,151 @@
font-size: 12px;
width: calc( 100% - 55px );
}
}
}

/*new style 6 start*/
/* Events Container */
.iee6_events-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
/* gap: 20px; */
margin: 25px 0;
}

/* Event Card */
.iee6_event-card {
background-color: #fff;
border-radius: 12px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
/* width: 300px; */
transition: transform 0.3s ease-in-out;
}

.iee6_event-card:hover {
transform: translateY(-5px);
}

/* Event Image */
.iee6_event-image {
position: relative;
}

.iee6_event-image img {
width: 100%;
height: 180px;
object-fit: cover;
}


/* Event Info */
.iee6_event-info {
padding: 15px;
}

.iee6_event-date {
font-size: 14px;
font-weight: bold;
color: #007bff;
text-transform: uppercase;
}

.iee6_event-title {
font-size: 18px;
font-weight: bold;
margin: 5px 0;
}

.iee6_event-time {
font-size: 14px;
color: #666;
}

.iee6_event-location {
font-size: 14px;
color: #666;
margin: 5px 0;
}

.iee6_event-description {
font-size: 13px;
color: #555;
margin-bottom: 10px;
}

/* Buttons */
.iee6_event-buttons {
display: flex;
gap: 10px;
}

.iee6_event-buttons a, button {
flex: 1;
padding: 8px 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
text-align: center;
}

.iee6_buy-btn {
opacity: 0.8;
color:#fff;
}

.iee6_buy-btn:hover {
opacity: 1;
color:#fff;
}

.iee6_details-btn {
background-color: #ddd;
color: black;
}

.iee6_details-btn:hover {
background-color: #bbb;
}

.iee6_eventbrite-item-location-icon {
position: relative;
top: 3px;
width: 12px;
height: 15px;
margin-right: 5px;
fill: #666;
}

.iee6_eventbrite-item-datetime-icon {
position: relative;
top: 3px;
width: 15px;
height: 15px;
margin-right: 5px;
fill: #666;
}

/* Responsive Design */
@media (max-width: 768px ) {
.iee6_events-container {
flex-direction: column;
align-items: center;
display: block;
}
}
@media (min-width: 768px) and (max-width: 992px) {
.iee6_events-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.iee6_events-container .eventbrite_events{
width: 50%;
}
}
a.iee6_event-title, a.iee6_buy-btn, a.iee6_details-btn {
text-decoration: none !important;
}
/*new style 6 end*/
67 changes: 41 additions & 26 deletions includes/class-import-eventbrite-events-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,39 +814,54 @@ public function eventbrite_events_archive( $atts = array() ) {
?>
<div class="iee_archive row_grid">
<?php
$template_args = array();
$template_args['css_class'] = $css_class;
$template_args['direct_link'] = $direct_link;
if( isset( $atts['layout'] ) && $atts['layout'] == 'style6' ){
?>
<div class="iee6_events-container">
<?php
}
$template_args = array();
$template_args['css_class'] = $css_class;
$template_args['direct_link'] = $direct_link;

if ( $eventbrite_events->have_posts() ) :
while ( $eventbrite_events->have_posts() ) :
$eventbrite_events->the_post();
if ( $eventbrite_events->have_posts() ) :
while ( $eventbrite_events->have_posts() ) :
$eventbrite_events->the_post();

if( isset( $atts['layout'] ) && $atts['layout'] == 'style2' && iee_is_pro() ){
get_iee_template( 'iee-archive-content2.php', $template_args );
}else{
get_iee_template( 'iee-archive-content.php', $template_args );
}
if( isset( $atts['layout'] ) && $atts['layout'] == 'style2' && iee_is_pro() ){
get_iee_template( 'iee-archive-content2.php', $template_args );
}elseif( isset( $atts['layout'] ) && $atts['layout'] == 'style6' && iee_is_pro() ){
get_iee_template( 'iee-archive-content6.php', $template_args );
}else{
get_iee_template( 'iee-archive-content.php', $template_args );
}

endwhile; // End of the loop.
endwhile; // End of the loop.

if ( $eventbrite_events->max_num_pages > 1 ) : // custom pagination
if ( $eventbrite_events->max_num_pages > 1 ) : // custom pagination
?>
<div class="col-iee-md-12">
<nav class="prev-next-posts">
<div class="prev-posts-link alignright">
<?php echo get_next_posts_link( 'Next Events &raquo;', $eventbrite_events->max_num_pages ); ?>
</div>
<div class="next-posts-link alignleft">
<?php echo get_previous_posts_link( '&laquo; Previous Events' ); ?>
</div>
</nav>
</div>
<?php
endif;
else :
echo apply_filters( 'iee_no_events_found_message', esc_html__( 'There are no upcoming Events at this time.', 'import-eventbrite-events' ) );
endif;
?>
</div>
<?php
if( isset( $atts['layout'] ) && $atts['layout'] == 'style6' && iee_is_pro() ){
?>
<div class="col-iee-md-12">
<nav class="prev-next-posts">
<div class="prev-posts-link alignright">
<?php echo get_next_posts_link( 'Next Events &raquo;', $eventbrite_events->max_num_pages ); ?>
</div>
<div class="next-posts-link alignleft">
<?php echo get_previous_posts_link( '&laquo; Previous Events' ); ?>
</div>
</nav>
</div>
<?php
endif;
else :
echo apply_filters( 'iee_no_events_found_message', esc_html__( 'There are no upcoming Events at this time.', 'import-eventbrite-events' ) );
endif;
}
?>
</div>
<style type="text/css">
Expand Down
89 changes: 89 additions & 0 deletions templates/iee-archive-content6.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
/**
* Template part for displaying dynamic events
*/
global $iee_events;
$start_date_str = get_post_meta( get_the_ID(), 'start_ts', true );
$start_date_formated = date_i18n( 'F j, Y ', $start_date_str );
$event_address = get_post_meta( get_the_ID(), 'venue_name', true );
$venue_address = get_post_meta( get_the_ID(), 'venue_address', true );
$iee_event_id = get_post_meta( get_the_ID(), 'iee_event_id', true );

if ( $event_address != '' && $venue_address != '' ) {
$event_address .= ' - ' . $venue_address;
} elseif ( $venue_address != '' ) {
$event_address = $venue_address;
}

$iee_options = get_option( IEE_OPTIONS );
$accent_color = isset( $iee_options['accent_color'] ) ? $iee_options['accent_color'] : '#039ED7';
$time_format = isset( $iee_options['time_format'] ) ? $iee_options['time_format'] : '12hours';

if( $time_format === '12hours' ){
$start_time = date_i18n( 'h:i a', $start_date_str );
}elseif($time_format === '24hours' ){
$start_time = date_i18n( 'G:i', $start_date_str );
}else{
$start_time = date_i18n( get_option( 'time_format' ), $start_date_str );
}

$image_url = array();
if ( has_post_thumbnail() ) {
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
$event_image = $image_url[0];
} else {
$image_date = date_i18n( 'F+d', $start_date_str );
$event_image = 'https://dummyimage.com/420x210/ccc/969696.png&text=' . $image_date;
}

$event_url = get_permalink();
$eb_event_url = get_post_meta( get_the_ID(), 'iee_event_link', true );
$target = '';
if ( 'yes' === $direct_link ){
$event_url = $eb_event_url;
$target = 'target="_blank"';
}


$event_title = get_the_title();
$event_description = wp_trim_words( get_the_excerpt(), 15, '...' );
?>
<div <?php post_class( array( $css_class, 'archive-event' ) ); ?> >
<div class="iee6_event-card">
<div class="iee6_event-image">
<a href="<?php echo esc_url( $event_url ); ?>" <?php echo $target; ?> >
<img src="<?php echo esc_url( $event_image ); ?>" alt="<?php echo esc_attr( $event_title ); ?>">
</a>
</div>
<div class="iee6_event-info">
<span class="iee6_event-date" style="color:<?php echo esc_attr( $accent_color ); ?>" >
<?php echo date_i18n( 'D j', $start_date_str ); ?>
</span>
<a class="iee6_event-title" href="<?php echo esc_url( $event_url ); ?>" <?php echo $target; ?> >
<div style="color:<?php echo esc_attr( $accent_color ); ?>" ><?php echo esc_html( $event_title ); ?></div>
</a>
<div class="iee6_event-time" >
<svg class="iee6_eventbrite-item-datetime-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm10-6a1 1 0 0 1 1 1v4.586l2.707 2.707a1 1 0 0 1-1.414 1.414l-3-3A1 1 0 0 1 11 12V7a1 1 0 0 1 1-1z" />
</svg>
<?php echo esc_html( $start_date_formated ) . ' @ ' . esc_html( $start_time ); ?>
</div>
<div class="iee6_event-location">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 48 64" xml:space="preserve" class="iee6_eventbrite-item-location-icon" >
<g>
<path d="M24,0C10.7,0,0,11.2,0,25.3c0,12,16.5,31.7,21.6,37.6c0.5,0.8,1.6,1.1,2.4,1.1c1.1,0,1.9-0.5,2.4-1.1 C31.5,57.1,48,37.1,48,25.3C48,11.2,37.3,0,24,0z M24,57.6C14.9,46.9,5.3,32.8,5.3,25.3c0-11.2,8.3-20,18.7-20s18.7,9.1,18.7,20 C42.7,32.8,33.1,46.9,24,57.6z"></path>
<path d="M24,13.3c-5.9,0-10.7,4.8-10.7,10.7S18.1,34.7,24,34.7S34.7,29.9,34.7,24S29.9,13.3,24,13.3z M24,29.3 c-2.9,0-5.3-2.4-5.3-5.3s2.4-5.3,5.3-5.3s5.3,2.4,5.3,5.3S26.9,29.3,24,29.3z"></path>
</g>
</svg>
<?php echo esc_html( $event_address ); ?>
</div>
<div class="iee6_event-description"><?php echo esc_html( $event_description ); ?></div>
<div class="iee6_event-buttons">
<a class="iee6_buy-btn" href="<?php echo esc_url( $eb_event_url ); ?>" style="background-color:<?php echo esc_attr( $accent_color ); ?>" >
<?php esc_html_e( 'Buy tickets', 'import-eventbrite-events' ); ?>
</a>
<a class="iee6_details-btn" href="<?php echo esc_url( $event_url ); ?>" <?php echo $target; ?> ><?php esc_html_e( 'View details', 'import-eventbrite-events' ); ?></a>
</div>
</div>
</div>
</div>

0 comments on commit 5e7c352

Please sign in to comment.