forked from christianwach/bp-event-organiser
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'Upcoming' tab to user profiles.
See #25.
- Loading branch information
1 parent
b71841d
commit 72f2331
Showing
4 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$args = array( | ||
'bp_displayed_user_id' => bp_displayed_user_id(), | ||
); | ||
echo eo_get_event_fullcalendar( $args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Upcoming event list template. | ||
*/ | ||
|
||
$eo_get_events_args = array( | ||
'showpastevents' => false, | ||
); | ||
|
||
if ( bp_is_user() ) { | ||
$eo_get_events_args['bp_displayed_user_id'] = bp_displayed_user_id(); | ||
} elseif ( function_exists( 'bp_is_group' ) && bp_is_group() ) { | ||
$eo_get_events_args['bp_group'] = bp_get_current_group_id(); | ||
} | ||
|
||
$events = eo_get_events( $eo_get_events_args ); ?> | ||
|
||
<?php if ( ! empty( $events ) ) : ?> | ||
<ul class="bpeo-upcoming-events"> | ||
<?php foreach ( $events as $event ) : ?> | ||
<li class="bpeo-upcoming-event-<?php echo esc_attr( $event->ID ) ?>"> | ||
<div class="bpeo-upcoming-event-datetime"> | ||
<span class="bpeo-upcoming-event-date"><?php echo date( 'M j, Y', strtotime( $event->StartDate ) ) ?></span> · <span class="bpeo-upcoming-event-time"><?php echo date( 'g:ia', strtotime( $event->StartTime ) ) ?></span> | ||
</div> | ||
|
||
<a class="bpeo-upcoming-event-title" href="<?php echo esc_url( apply_filters( 'eventorganiser_calendar_event_link', get_permalink( $event->ID ), $event->ID ) ) ?>"><?php echo esc_html( $event->post_title ) ?></a> | ||
|
||
</li> | ||
<?php endforeach; ?> | ||
</ul> | ||
<?php else : // ! empty( $events ) ?> | ||
<p><?php _e( 'No upcoming events found.', 'bp-event-organiser' ) ?></p> | ||
<?php endif; // ! empty( $events ) ?> |