Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added style 5 #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions includes/class-import-eventbrite-events-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,11 @@ public function eventbrite_events_archive( $atts = array() ) {
?>
<div class="iee_archive row_grid">
<?php
if( isset( $atts['layout'] ) && $atts['layout'] == 'style5' && iee_is_pro() ){
?>
<div class="iee5_main_container">
<?php
}
$template_args = array();
$template_args['css_class'] = $css_class;
$template_args['direct_link'] = $direct_link;
Expand All @@ -824,6 +829,8 @@ public function eventbrite_events_archive( $atts = array() ) {

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'] == 'style5' && iee_is_pro() ){
get_iee_template( 'iee-archive-content5.php', $template_args );
}else{
get_iee_template( 'iee-archive-content.php', $template_args );
}
Expand All @@ -847,6 +854,11 @@ public function eventbrite_events_archive( $atts = array() ) {
else :
echo apply_filters( 'iee_no_events_found_message', esc_html__( 'There are no upcoming Events at this time.', 'import-eventbrite-events' ) );
endif;
if( isset( $atts['layout'] ) && $atts['layout'] == 'style5' && iee_is_pro() ){
?>
</div>
<?php
}
?>
</div>
<style type="text/css">
Expand Down
6 changes: 3 additions & 3 deletions languages/import-eventbrite-events.pot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 Xylus Themes
# Copyright (C) 2025 Xylus Themes
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
Expand All @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-12-13T06:36:53+00:00\n"
"POT-Creation-Date: 2025-02-21T09:10:38+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: import-eventbrite-events\n"
Expand Down Expand Up @@ -835,7 +835,7 @@ msgstr ""
msgid "Start Date"
msgstr ""

#: includes/class-import-eventbrite-events-cpt.php:848
#: includes/class-import-eventbrite-events-cpt.php:855
msgid "There are no upcoming Events at this time."
msgstr ""

Expand Down
79 changes: 79 additions & 0 deletions templates/iee-archive-content5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/**
* Template part for displaying posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/

$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';
$start_date_str = get_post_meta( get_the_ID(), 'start_ts', true);
$end_date_str = get_post_meta( get_the_ID(), 'end_ts', true);
$event_address = get_post_meta( get_the_ID(), 'venue_name', true );
$venue_address = get_post_meta( get_the_ID(), 'venue_address', true );

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

$event_url = get_permalink();
$eb_event_url = get_post_meta( get_the_ID(), 'iee_event_link', true );
$target = '';
if ( 'yes' === $direct_link ){
$event_url = get_post_meta( get_the_ID(), 'iee_event_link', true );
$target = 'target="_blank"';
}
?>
<div class="iee5_event">
<div class="iee5_event-details">
<div class="iee5_event-date" style="color:<?php echo esc_attr( $accent_color ); ?>">
<?php
if ( $start_date_str && $end_date_str ) {
$start_date = date_i18n( 'l, F j, Y @ g:i A', $start_date_str );
$end_date = date_i18n( 'l, F j, Y @ g:i A', $end_date_str );
echo esc_html( $start_date . ' - ' . $end_date );
} else {
echo esc_html__('Event date not available', 'text-domain');
}
?>
</div>
<h3 class="iee5_event-title" >
<?php the_title(); ?>
</h3>
<div class="iee5_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="iee5_eventbrite-item-location-icon" style="fill:<?php echo esc_attr( $accent_color ); ?>">
<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
if ($event_address && $venue_address) {
echo esc_html( $event_address . ' - ' . $venue_address );
} elseif ($venue_address) {
echo esc_html($venue_address);
}
?>
</div>
<a class="iee5_buy-tickets" style="color: #fff;text-decoration: none;background-color:<?php echo esc_attr( $accent_color ); ?>" href="<?php echo esc_url( $eb_event_url ); ?>" <?php echo $target; ?> >
<div >
<?php esc_html_e('Buy tickets', 'text-domain'); ?>
</div>
</a>
</div>
<a href="<?php echo esc_url( $event_url ); ?>" <?php echo $target; ?> class="iee5_event-image">
<img src="<?php echo esc_url( $img_src ); ?>" alt="<?php the_title_attribute(); ?>">
</a>
</div>