Leon Corre Theme for Wordpress 4.x

This commit is contained in:
Luca 2017-11-20 16:34:37 +01:00
parent 6036088a53
commit e0da362ae5
101 changed files with 4633 additions and 2 deletions

47
footer.php Normal file
View File

@ -0,0 +1,47 @@
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="wrap" style="display:none;">
<?php
get_template_part( 'template-parts/footer/footer', 'widgets' );
if ( has_nav_menu( 'social' ) ) : ?>
<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>">
<?php
wp_nav_menu( array(
'theme_location' => 'social',
'menu_class' => 'social-links-menu',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),
) );
?>
</nav><!-- .social-navigation -->
<?php endif;
get_template_part( 'template-parts/footer/site', 'info' );
?>
</div><!-- .wrap -->
</footer><!-- #colophon -->
</div><!-- .site-content-contain -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>

60
header.php Normal file
View File

@ -0,0 +1,60 @@
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
<script src="https://use.fontawesome.com/3db894370e.js"></script>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<?php if ( has_nav_menu( 'top' ) ) : ?>
<div class="navigation-top">
<div class="wrap">
<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
</div><!-- .wrap -->
</div><!-- .navigation-top -->
<?php endif; ?>
<?php get_template_part( 'template-parts/header/header', 'image' ); ?>
</header><!-- #masthead -->
<?php
/*
* If a regular post or page, and not the front page, show the featured image.
* Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
*/
if ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :
echo '<div class="single-featured-image-header">';
echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
echo '</div><!-- .single-featured-image-header -->';
endif;
?>
<span id="inicio"></span>
<div class="site-content-contain">
<div id="content" class="site-content">

View File

@ -0,0 +1,160 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to BuddyPress - 2012-02-14 */
global $bp, $EM_Notices;
$url = $bp->events->link . 'my-events/'; //url to this page
$order = ( !empty($_REQUEST ['order']) ) ? $_REQUEST ['order']:'ASC';
$limit = ( !empty($_REQUEST['limit']) ) ? $_REQUEST['limit'] : 20;//Default limit
$page = ( !empty($_REQUEST['pno']) ) ? $_REQUEST['pno']:1;
$offset = ( $page > 1 ) ? ($page-1)*$limit : 0;
$EM_Events = EM_Events::get( array('group'=>'this','scope'=>'future', 'limit' => 0, 'order' => $order) );
$events_count = count ( $EM_Events );
$future_count = EM_Events::count( array('status'=>1, 'owner' =>get_current_user_id(), 'scope' => 'future'));
$pending_count = EM_Events::count( array('status'=>0, 'owner' =>get_current_user_id(), 'scope' => 'all') );
$use_events_end = get_option('dbem_use_event_end');
echo $EM_Notices;
?>
<div class="tablenav">
<?php
if ( $events_count >= $limit ) {
$events_nav = em_admin_paginate( $events_count, $limit, $page);
echo $events_nav;
}
?>
<br class="clear" />
</div>
<?php
if (empty ( $EM_Events )) {
// TODO localize
echo "<p>". __( 'No Events','events-manager') ."</p>";
} else {
foreach( $EM_Events as $EM_Event ){ break; }
$can_edit_events = $EM_Event->can_manage('edit_events','edit_others_events');
?>
<table class="widefat events-table">
<thead>
<tr>
<?php /*
<th class='manage-column column-cb check-column' scope='col'>
<input class='select-all' type="checkbox" value='1' />
</th>
*/ ?>
<th><?php _e ( 'Name', 'events-manager'); ?></th>
<th><?php _e ( 'Location', 'events-manager'); ?></th>
<th><?php _e ( 'Date and time', 'events-manager'); ?></th>
</tr>
</thead>
<tbody>
<?php
$rowno = 0;
$event_count = 0;
foreach ( $EM_Events as $EM_Event ) {
/* @var $event EM_Event */
$can_edit_events = $EM_Event->can_manage('edit_events','edit_others_events');
if( ($rowno < $limit || empty($limit)) && ($event_count >= $offset || $offset === 0) ) {
$rowno++;
$class = ($rowno % 2) ? 'alternate' : '';
// FIXME set to american
$localised_start_date = date_i18n(get_option('dbem_date_format'), $EM_Event->start);
$localised_end_date = date_i18n(get_option('dbem_date_format'), $EM_Event->end);
$style = "";
$today = date ( "Y-m-d" );
$location_summary = "<b>" . $EM_Event->get_location()->name . "</b><br/>" . $EM_Event->get_location()->address . " - " . $EM_Event->get_location()->town;
if ($EM_Event->start_date < $today && $EM_Event->end_date < $today){
$class .= " past";
}
//Check pending approval events
if ( !$EM_Event->status ){
$class .= " pending";
}
?>
<tr class="event <?php echo trim($class); ?>" <?php echo $style; ?> id="event_<?php echo $EM_Event->event_id ?>">
<?php /*
<td>
<input type='checkbox' class='row-selector' value='<?php echo $event->event_id; ?>' name='events[]' />
</td>
*/ ?>
<td>
<strong>
<?php
if( $can_edit_events ){
echo $EM_Event->output('<a href="#_EDITEVENTURL">#_NAME</a>');
}else{
echo $EM_Event->output('#_EVENTLINK');
}
?>
</strong>
<?php
if( $EM_Event->can_manage('manage_bookings','manage_others_bookings') && get_option('dbem_rsvp_enabled') == 1 && $EM_Event->rsvp == 1 ){
?>
<br/>
<a href="<?php echo $url ?>bookings/?event_id=<?php echo $EM_Event->event_id ?>"><?php echo __("Bookings",'events-manager'); ?></a> &ndash;
<?php _e("Booked",'events-manager'); ?>: <?php echo $EM_Event->get_bookings()->get_booked_spaces()."/".$EM_Event->get_spaces(); ?>
<?php if( get_option('dbem_bookings_approval') == 1 ): ?>
| <?php _e("Pending",'events-manager') ?>: <?php echo $EM_Event->get_bookings()->get_pending_spaces(); ?>
<?php endif;
}
?>
<div class="row-actions">
<?php if( $EM_Event->can_manage('delete_events', 'delete_others_events')) : $can_delete_events = true; ?>
<span class="trash"><a href="<?php echo $url ?>?action=event_delete&amp;event_id=<?php echo $EM_Event->event_id . '&amp;_wpnonce=' . wp_create_nonce('event_delete_'.$EM_Event->event_id); ?>" class="em-event-delete"><?php _e('Delete','events-manager'); ?></a></span>
<?php endif; ?>
<?php if( $can_edit_events ): ?>
<?php if( $can_delete_events ) echo " | "; ?>
<a href="<?php echo $url ?>edit/?action=event_duplicate&amp;event_id=<?php echo $EM_Event->event_id . '&amp;_wpnonce=' . wp_create_nonce('event_duplicate_'.$EM_Event->event_id); ?>" title="<?php echo esc_attr ( sprintf(__('Duplicate %s','events-manager'), __('Event','events-manager')) ); ?>">
<?php esc_html_e('Duplicate','events-manager'); ?>
</a>
<?php endif; ?>
</div>
</td>
<td>
<?php echo $location_summary; ?>
</td>
<td>
<?php echo $localised_start_date; ?>
<?php echo ($localised_end_date != $localised_start_date) ? " - $localised_end_date":'' ?>
<br />
<?php
//TODO Should 00:00 - 00:00 be treated as an all day event?
echo substr ( $EM_Event->start_time, 0, 5 ) . " - " . substr ( $EM_Event->end_time, 0, 5 );
?>
<br />
<?php
if ( $EM_Event->is_recurrence() && $EM_Event->can_manage('edit_events','edit_others_events') ) {
$recurrence_delete_confirm = __('WARNING! You will delete ALL recurrences of this event, including booking history associated with any event in this recurrence. To keep booking information, go to the relevant single event and save it to detach it from this recurrence series.','events-manager');
?>
<strong>
<?php echo $EM_Event->get_recurrence_description(); ?> <br />
<a href="<?php echo $url ?>edit/?event_id=<?php echo $EM_Event->recurrence_id ?>"><?php _e ( 'Edit Recurring Events', 'events-manager'); ?></a>
</strong>
<?php
}else{ echo "&nbsp;"; }
?>
</td>
</tr>
<?php
}
$event_count++;
}
?>
</tbody>
</table>
<?php
} // end of table
?>
<div class='tablenav'>
<div class="alignleft actions">
<br class='clear' />
</div>
<?php if ( $events_count >= $limit ) : ?>
<div class="tablenav-pages">
<?php
echo $events_nav;
?>
</div>
<?php endif; ?>
<br class='clear' />
</div>

View File

@ -0,0 +1,4 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to BuddyPress - 2012-02-14 */
em_bookings_admin();
?>

View File

@ -0,0 +1,2 @@
<?php
em_events_admin();

View File

@ -0,0 +1,162 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to BuddyPress - 2012-02-14 */
global $bp, $EM_Notices;
echo $EM_Notices;
$url = $bp->events->link . 'my-events/'; //url to this page
$order = ( !empty($_REQUEST ['order']) ) ? $_REQUEST ['order']:'ASC';
$limit = ( !empty($_REQUEST['limit']) ) ? $_REQUEST['limit'] : 20;//Default limit
$page = ( !empty($_REQUEST['pno']) ) ? $_REQUEST['pno']:1;
$offset = ( $page > 1 ) ? ($page-1)*$limit : 0;
$EM_Events = EM_Events::get( array('group'=>'my','scope'=>'future', 'limit' => 0, 'order' => $order) );
$events_count = count ( $EM_Events );
$future_count = EM_Events::count( array('status'=>1, 'owner' =>get_current_user_id(), 'scope' => 'future'));
$pending_count = EM_Events::count( array('status'=>0, 'owner' =>get_current_user_id(), 'scope' => 'all') );
$use_events_end = get_option('dbem_use_event_end');
echo $EM_Notices;
?>
<div class="tablenav">
<?php
if ( $events_count >= $limit ) {
$events_nav = em_admin_paginate( $events_count, $limit, $page);
echo $events_nav;
}
?>
<br class="clear" />
</div>
<?php
if (empty ( $EM_Events )) {
// TODO localize
echo "<p>". __( 'No Events','events-manager') ."</p>";
} else {
?>
<table class="widefat events-table">
<thead>
<tr>
<?php /*
<th class='manage-column column-cb check-column' scope='col'>
<input class='select-all' type="checkbox" value='1' />
</th>
*/ ?>
<th><?php _e ( 'Name', 'events-manager'); ?></th>
<th>&nbsp;</th>
<th><?php _e ( 'Location', 'events-manager'); ?></th>
<th colspan="2"><?php _e ( 'Date and time', 'events-manager'); ?></th>
</tr>
</thead>
<tbody>
<?php
$rowno = 0;
$event_count = 0;
foreach ( $EM_Events as $event ) {
/* @var $event EM_Event */
if( ($rowno < $limit || empty($limit)) && ($event_count >= $offset || $offset === 0) ) {
$rowno++;
$class = ($rowno % 2) ? 'alternate' : '';
// FIXME set to american
$localised_start_date = date_i18n(get_option('dbem_date_format'), $event->start);
$localised_end_date = date_i18n(get_option('dbem_date_format'), $event->end);
$style = "";
$today = current_time('timestamp');
$location_summary = "<b>" . $event->get_location()->name . "</b><br/>" . $event->get_location()->address . " - " . $event->get_location()->town;
if ($event->start < $today && $event->end < $today){
$class .= " past";
}
//Check pending approval events
if ( !$event->status ){
$class .= " pending";
}
?>
<tr class="event <?php echo trim($class); ?>" <?php echo $style; ?> id="event_<?php echo $event->event_id ?>">
<?php /*
<td>
<input type='checkbox' class='row-selector' value='<?php echo $event->event_id; ?>' name='events[]' />
</td>
*/ ?>
<td>
<strong>
<a class="row-title" href="<?php echo $event->get_edit_url(); ?>"><?php echo ($event->event_name); ?></a>
</strong>
<?php
if( $event->can_manage('manage_bookings','manage_others_bookings') && get_option('dbem_rsvp_enabled') == 1 && $event->event_rsvp == 1 ){
?>
<br/>
<a href="<?php echo esc_url($event->get_bookings_url()); ?>"><?php echo __("Bookings",'events-manager'); ?></a> &ndash;
<?php _e("Booked",'events-manager'); ?>: <?php echo $event->get_bookings()->get_booked_spaces()."/".$event->get_spaces(); ?>
<?php if( get_option('dbem_bookings_approval') == 1 ): ?>
| <?php _e("Pending",'events-manager') ?>: <?php echo $event->get_bookings()->get_pending_spaces(); ?>
<?php endif;
}
?>
<div class="row-actions">
<?php if( current_user_can('delete_events')) : ?>
<span class="trash"><a href="<?php echo $url ?>?action=event_delete&amp;event_id=<?php echo $event->event_id ?>" class="em-event-delete"><?php _e('Delete','events-manager'); ?></a></span>
<?php endif; ?>
</div>
</td>
<td>
<a href="<?php echo $url ?>edit/?action=event_duplicate&amp;event_id=<?php echo $event->event_id ?>" title="<?php _e ( 'Duplicate this event', 'events-manager'); ?>">
<strong>+</strong>
</a>
</td>
<td>
<?php echo $location_summary; ?>
<?php if( is_object($category) && !empty($category->name) ) : ?>
<br/><span class="category"><strong><?php _e( 'Category', 'events-manager'); ?>: </strong><?php echo $category->name ?></span>
<?php endif; ?>
</td>
<td>
<?php echo $localised_start_date; ?>
<?php echo ($localised_end_date != $localised_start_date) ? " - $localised_end_date":'' ?>
<br />
<?php
if(!$event->event_all_day){
echo date_i18n(get_option('time_format'), $event->start) . " - " . date_i18n(get_option('time_format'), $event->end);
}else{
echo get_option('dbem_event_all_day_message');
}
?>
</td>
<td>
<?php
if ( $event->is_recurrence() && $event->can_manage('edit_events','edit_others_events') ) {
$recurrence_delete_confirm = __('WARNING! You will delete ALL recurrences of this event, including booking history associated with any event in this recurrence. To keep booking information, go to the relevant single event and save it to detach it from this recurrence series.','events-manager');
?>
<strong>
<?php echo $event->get_recurrence_description(); ?> <br />
<a href="<?php echo $url ?>edit/?event_id=<?php echo $event->recurrence_id ?>"><?php _e ( 'Edit Recurring Events', 'events-manager'); ?></a>
<?php if( current_user_can('delete_events')) : ?>
<span class="trash"><a href="<?php echo $url ?>?action=event_delete&amp;event_id=<?php echo $event->event_id ?>" class="em-event-rec-delete" onclick ="if( !confirm('<?php echo $recurrence_delete_confirm; ?>') ){ return false; }"><?php _e('Delete','events-manager'); ?></a></span>
<?php endif; ?>
</strong>
<?php
}else{ echo "&nbsp;"; }
?>
</td>
</tr>
<?php
}
$event_count++;
}
?>
</tbody>
</table>
<?php
} // end of table
?>
<div class='tablenav'>
<div class="alignleft actions">
<br class='clear' />
</div>
<?php if ( $events_count >= $limit ) : ?>
<div class="tablenav-pages">
<?php
echo $events_nav;
?>
</div>
<?php endif; ?>
<br class='clear' />
</div>

View File

@ -0,0 +1,2 @@
<?php
em_locations_admin();

View File

@ -0,0 +1,46 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to BuddyPress - 2012-02-14 */
global $bp, $EM_Notices;
echo $EM_Notices;
if( user_can($bp->displayed_user->id,'edit_events') ){
?>
<h4><?php _e('My Events', 'events-manager'); ?></h4>
<?php
$args = array(
'owner'=>$bp->displayed_user->id,
'format_header' => get_option('dbem_bp_events_list_format_header'),
'format' => get_option('dbem_bp_events_list_format'),
'format_footer' => get_option('dbem_bp_events_list_format_footer'),
'owner' => $bp->displayed_user->id,
'pagination'=>1
);
$args['limit'] = !empty($args['limit']) ? $args['limit'] : get_option('dbem_events_default_limit');
if( EM_Events::count($args) > 0 ){
echo EM_Events::output($args);
}else{
?>
<p><?php _e('No Events', 'events-manager'); ?>.
<?php if( get_current_user_id() == $bp->displayed_user->id ): ?>
<a href="<?php echo $bp->events->link . 'my-events/edit/'; ?>"><?php _e('Add Event','events-manager'); ?></a>
<?php endif; ?>
</p>
<?php
}
}
?>
<h4><?php _e("Events I'm Attending", 'events-manager'); ?></h4>
<?php
$EM_Person = new EM_Person( $bp->displayed_user->id );
$EM_Bookings = $EM_Person->get_bookings( false, apply_filters('em_bp_attending_status',1) );
if(count($EM_Bookings->bookings) > 0){
//Get events here in one query to speed things up
$event_ids = array();
foreach($EM_Bookings as $EM_Booking){
$event_ids[] = $EM_Booking->event_id;
}
echo EM_Events::output(array('event'=>$event_ids));
}else{
?>
<p><?php _e('Not attending any events yet.','events-manager'); ?></p>
<?php
}

View File

@ -0,0 +1,10 @@
This folder contains email templates or parts of email templates that would be used in emails.
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/buddypress/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,69 @@
<?php
/*
* This displays the content of the #_BOOKINGSUMMARY placeholder
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manage/placeholders/ and modifying it however you need.
* For more information, see http://wp-events-plugin.com/documentation/using-template-files/
*/
/* @var $EM_Booking EM_Booking */ ?>
<?php foreach($EM_Booking->get_tickets_bookings() as $EM_Ticket_Booking): /* @var $EM_Ticket_Booking EM_Ticket_Booking */ ?>
<?php echo $EM_Ticket_Booking->get_ticket()->ticket_name; ?>
--------------------------------------
<?php _e('Quantity','events-manager'); ?>: <?php echo $EM_Ticket_Booking->get_spaces(); ?>
<?php _e('Price','events-manager'); ?>: <?php echo $EM_Ticket_Booking->get_price(true); ?>
<?php endforeach; ?>
=======================================
<?php
$price_summary = $EM_Booking->get_price_summary_array();
//we should now have an array of information including base price, taxes and post/pre tax discounts
?>
<?php _e('Sub Total','events-manager'); ?> : <?php echo $EM_Booking->get_price_base(true); ?>
<?php if( count($price_summary['discounts_pre_tax']) > 0 ): ?>
<?php _e('Discounts Before Taxes','events-manager'); ?>
<?php foreach( $price_summary['discounts_pre_tax'] as $discount_summary ): ?>
(<?php echo $discount_summary['name']; ?>) : -<?php echo $discount_summary['amount']; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if( count($price_summary['surcharges_pre_tax']) > 0 ): ?>
<?php _e('Surcharges Before Taxes','events-manager'); ?>
<?php foreach( $price_summary['surcharges_pre_tax'] as $surcharge_summary ): ?>
(<?php echo $surcharge_summary['name']; ?>) : <?php echo $surcharge_summary['amount']; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if( !empty($price_summary['taxes']['amount']) ): ?>
<?php _e('Taxes','events-manager'); ?> ( <?php echo $price_summary['taxes']['rate']; ?> ) : <?php echo $price_summary['taxes']['amount']; ?>
<?php endif; ?>
<?php if( count($price_summary['discounts_post_tax']) > 0 ): ?>
<?php _e('Discounts (After Taxes)','events-manager'); ?>
<?php foreach( $price_summary['discounts_post_tax'] as $discount_summary ): ?>
<?php echo $discount_summary['name']; ?> : -<?php echo $discount_summary['amount']; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if( count($price_summary['surcharges_post_tax']) > 0 ): ?>
<?php _e('Surcharges (After Taxes)','events-manager'); ?>
<?php foreach( $price_summary['surcharges_post_tax'] as $surcharge_summary ): ?>
<?php echo $surcharge_summary['name']; ?> : <?php echo $surcharge_summary['amount']; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php _e('Total Price','events-manager'); ?> : <?php echo $price_summary['total']; ?>

View File

@ -0,0 +1,12 @@
<?php foreach($EM_Booking->get_tickets_bookings() as $EM_Ticket_Booking): ?>
<?php
/* @var $EM_Ticket_Booking EM_Ticket_Booking */
echo $EM_Ticket_Booking->get_ticket()->name;
?>
<?php _e('Quantity','events-manager'); ?>: <?php echo $EM_Ticket_Booking->get_spaces(); ?>
<?php _e('Price','events-manager'); ?>: <?php echo em_get_currency_symbol(!get_option('dbem_smtp_html'))." ". number_format($EM_Ticket_Booking->get_price(),2); ?>
<?php endforeach; ?>

View File

@ -0,0 +1,10 @@
This folder contains email templates or parts of email templates that would be used in emails.
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/emails/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,21 @@
Files in this folder or in wp-content/themes/yourthemedir/plugins/events-manager/formats/ would be used to replace formatting options in the settings page. This allows you a much greater degree of flexibility as you can use PHP go do all sorts of customizations to your events.
To overwrite a formatting option, you need to firstly create a file here with the same name as the setting name in the wp_options table without the dbem_ prefix. So, for example:
'dbem_event_list_item_format' - format for controlling a single event format in a list of events
becomes
event_list_item_format.php
Then, using the example above, to activate the overriding format, you need to add this to your theme's functions.php file.
<?php
function my_em_custom_formats( $array ){
$my_formats = array('dbem_event_list_item_format'); //the format you want to override, corresponding to file above.
return $array + $my_formats; //return the default array and your formats.
}
add_filter('em_formats_filter', 'my_em_custom_formats', 1, 1);
?>
If you want to add more than one format, add more option names to the $my_formats array and create the corresponding php file.

View File

@ -0,0 +1,28 @@
<?php
/*
* This file generates the default booking form fields. Events Manager Pro does not use this file.
*/
/* @var $EM_Event EM_Event */
//Here we have extra information required for the booking.
?>
<?php if( !is_user_logged_in() && apply_filters('em_booking_form_show_register_form',true) ): ?>
<?php //User can book an event without registering, a username will be created for them based on their email and a random password will be created. ?>
<input type="hidden" name="register_user" value="1" />
<p>
<label for='user_name'><?php _e('Name','events-manager') ?></label>
<input type="text" name="user_name" id="user_name" class="input" value="<?php if(!empty($_REQUEST['user_name'])) echo esc_attr($_REQUEST['user_name']); ?>" />
</p>
<p>
<label for='dbem_phone'><?php _e('Phone','events-manager') ?></label>
<input type="text" name="dbem_phone" id="dbem_phone" class="input" value="<?php if(!empty($_REQUEST['dbem_phone'])) echo esc_attr($_REQUEST['dbem_phone']); ?>" />
</p>
<p>
<label for='user_email'><?php _e('E-mail','events-manager') ?></label>
<input type="text" name="user_email" id="user_email" class="input" value="<?php if(!empty($_REQUEST['user_email'])) echo esc_attr($_REQUEST['user_email']); ?>" />
</p>
<?php do_action('em_register_form'); //careful if making an add-on, this will only be used if you're not using custom booking forms ?>
<?php endif; ?>
<p>
<label for='booking_comment'><?php _e('Comment', 'events-manager') ?></label>
<textarea name='booking_comment' rows="2" cols="20"><?php echo !empty($_REQUEST['booking_comment']) ? esc_attr($_REQUEST['booking_comment']):'' ?></textarea>
</p>

View File

@ -0,0 +1,40 @@
<?php
/*
* This file generates the default login form within the booking form (if enabled in options).
*/
?>
<div class="em-booking-login">
<form class="em-booking-login-form" action="<?php echo site_url('wp-login.php', 'login_post'); ?>" method="post">
<p><?php esc_html_e('Log in if you already have an account with us.','events-manager'); ?></p>
<p>
<label><?php esc_html_e( 'Username','events-manager') ?></label>
<input type="text" name="log" class="input" value="" />
</p>
<p>
<label><?php esc_html_e( 'Password','events-manager') ?></label>
<input type="password" name="pwd" class="input" value="" />
</p>
<?php do_action('login_form'); ?>
<input type="submit" name="wp-submit" id="em_wp-submit" value="<?php esc_html_e('Log In', 'events-manager'); ?>" tabindex="100" />
<input name="rememberme" type="checkbox" id="em_rememberme" value="forever" /> <label><?php esc_html_e( 'Remember Me','events-manager') ?></label>
<input type="hidden" name="redirect_to" value="<?php echo esc_url( get_site_url(false, $_SERVER['REQUEST_URI']) ); ?>#em-booking" />
<br />
<?php
//Signup Links
if ( get_option('users_can_register') ) {
echo "<br />";
if ( function_exists('bp_get_signup_page') ) { //Buddypress
$register_link = bp_get_signup_page();
}elseif ( file_exists( ABSPATH."/wp-signup.php" ) ) { //MU + WP3
$register_link = site_url('wp-signup.php', 'login');
} else {
$register_link = site_url('wp-login.php?action=register', 'login');
}
?>
<a href="<?php echo $register_link ?>"><?php esc_html_e('Sign Up','events-manager') ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
<?php
}
?>
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php esc_html_e('Password Lost and Found', 'events-manager') ?>"><?php esc_html_e('Lost your password?', 'events-manager') ?></a>
</form>
</div>

View File

@ -0,0 +1,52 @@
<?php
/*
* This file generates the input fields for an event with a single ticket and settings set to not show a table for single tickets (default setting)
* If you want to add to this form this, you'd be better off hooking into the actions below.
*/
/* @var $EM_Ticket EM_Ticket */
/* @var $EM_Event EM_Event */
global $allowedposttags;
do_action('em_booking_form_ticket_header', $EM_Ticket); //do not delete
/*
* This variable can be overridden, by hooking into the em_booking_form_tickets_cols filter and adding your collumns into this array.
* Then, you should create a em_booking_form_ticket_field_arraykey action for your collumn data, which will pass a ticket and event object.
*/
$collumns = $EM_Event->get_tickets()->get_ticket_collumns(); //array of collumn type => title
foreach( $collumns as $type => $name ): ?>
<?php
//output collumn by type, or call a custom action
switch($type){
case 'type':
if(!empty($EM_Ticket->ticket_description)){ //show description if there is one
?><p class="ticket-desc"><?php echo wp_kses($EM_Ticket->ticket_description,$allowedposttags); ?></p><?php
}
break;
case 'price':
?><p class="ticket-price"><label><?php echo $name; ?></label><strong><?php echo $EM_Ticket->get_price(true); ?></strong></p><?php
break;
case 'spaces':
if( $EM_Ticket->get_available_spaces() > 1 && ( empty($EM_Ticket->ticket_max) || $EM_Ticket->ticket_max > 1 ) ): //more than one space available ?>
<p class="em-tickets-spaces">
<label for='em_tickets'><?php echo $name; ?></label>
<?php
$default = !empty($_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']) ? $_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']:0;
$spaces_options = $EM_Ticket->get_spaces_options(false,$default);
if( $spaces_options ){
echo $spaces_options;
}else{
echo "<strong>".__('N/A','events-manager')."</strong>";
}
?>
</p>
<?php do_action('em_booking_form_ticket_spaces', $EM_Ticket); //do not delete ?>
<?php else: //if only one space or ticket max spaces per booking is 1 ?>
<input type="hidden" name="em_tickets[<?php echo $EM_Ticket->ticket_id ?>][spaces]" value="1" class="em-ticket-select" />
<?php do_action('em_booking_form_ticket_spaces', $EM_Ticket); //do not delete ?>
<?php endif;
break;
default:
do_action('em_booking_form_ticket_field_'.$type, $EM_Ticket, $EM_Event);
break;
}
endforeach; ?>
<?php do_action('em_booking_form_ticket_footer', $EM_Ticket); //do not delete ?>

View File

@ -0,0 +1,60 @@
<?php
/*
* This file generates a tabular list of tickets for the event booking forms with input values for choosing ticket spaces.
* If you want to add to this form this, you'd be better off hooking into the actions below.
*/
/* @var $EM_Event EM_Event */
global $allowedposttags;
$EM_Tickets = $EM_Event->get_bookings()->get_tickets(); //already instantiated, so should be a quick retrieval.
/*
* This variable can be overridden, by hooking into the em_booking_form_tickets_cols filter and adding your collumns into this array.
* Then, you should create a em_booking_form_tickets_col_arraykey action for your collumn data, which will pass a ticket and event object.
*/
$collumns = $EM_Tickets->get_ticket_collumns(); //array of collumn type => title
?>
<table class="em-tickets" cellspacing="0" cellpadding="0">
<tr>
<?php foreach($collumns as $type => $name): ?>
<th class="em-bookings-ticket-table-<?php echo $type; ?>"><?php echo $name; ?></th>
<?php endforeach; ?>
</tr>
<?php foreach( $EM_Tickets->tickets as $EM_Ticket ): /* @var $EM_Ticket EM_Ticket */ ?>
<?php if( $EM_Ticket->is_displayable() ): ?>
<?php do_action('em_booking_form_tickets_loop_header', $EM_Ticket); //do not delete ?>
<tr class="em-ticket" id="em-ticket-<?php echo $EM_Ticket->ticket_id; ?>">
<?php foreach( $collumns as $type => $name ): ?>
<?php
//output collumn by type, or call a custom action
switch($type){
case 'type':
?>
<td class="em-bookings-ticket-table-type"><?php echo wp_kses_data($EM_Ticket->ticket_name); ?><?php if(!empty($EM_Ticket->ticket_description)) :?><br><span class="ticket-desc"><?php echo wp_kses($EM_Ticket->ticket_description,$allowedposttags); ?></span><?php endif; ?></td>
<?php
break;
case 'price':
?>
<td class="em-bookings-ticket-table-price"><?php echo $EM_Ticket->get_price(true); ?></td>
<?php
break;
case 'spaces':
?>
<td class="em-bookings-ticket-table-spaces">
<?php
$default = !empty($_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']) ? $_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']:0;
$spaces_options = $EM_Ticket->get_spaces_options(true,$default);
echo ( $spaces_options ) ? $spaces_options:"<strong>".__('N/A','events-manager')."</strong>";
?>
</td>
<?php
break;
default:
do_action('em_booking_form_tickets_col_'.$type, $EM_Ticket, $EM_Event);
break;
}
?>
<?php endforeach; ?>
</tr>
<?php do_action('em_booking_form_tickets_loop_footer', $EM_Ticket); //do not delete ?>
<?php endif; ?>
<?php endforeach; ?>
</table>

View File

@ -0,0 +1,120 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to the event editor. If at all possible, try making customizations using CSS, jQuery, or using our hooks and filters. - 2012-02-14 */
/*
* To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
* You also must keep the _wpnonce hidden field in this form too.
*/
global $EM_Event, $EM_Notices, $bp;
//check that user can access this page
if( is_object($EM_Event) && !$EM_Event->can_manage('edit_events','edit_others_events') ){
?>
<div class="wrap"><h2><?php esc_html_e('Unauthorized Access','events-manager'); ?></h2><p><?php echo sprintf(__('You do not have the rights to manage this %s.','events-manager'),__('Event','events-manager')); ?></p></div>
<?php
return false;
}elseif( !is_object($EM_Event) ){
$EM_Event = new EM_Event();
}
$required = apply_filters('em_required_html','<i>*</i>');
echo $EM_Notices;
//Success notice
if( !empty($_REQUEST['success']) ){
if(!get_option('dbem_events_form_reshow')) return false;
}
?>
<form enctype='multipart/form-data' id="event-form" class="em-event-admin-editor <?php if( $EM_Event->is_recurring() ) echo 'em-event-admin-recurring' ?>" method="post" action="<?php echo esc_url(add_query_arg(array('success'=>null))); ?>">
<div class="wrap">
<?php do_action('em_front_event_form_header'); ?>
<?php if(get_option('dbem_events_anonymous_submissions') && !is_user_logged_in()): ?>
<h3 class="event-form-submitter"><?php esc_html_e( 'Your Details', 'events-manager'); ?></h3>
<div class="inside event-form-submitter">
<p>
<label><?php esc_html_e('Name', 'events-manager'); ?></label>
<input type="text" name="event_owner_name" id="event-owner-name" value="<?php echo esc_attr($EM_Event->event_owner_name); ?>" />
</p>
<p>
<label><?php esc_html_e('Email', 'events-manager'); ?></label>
<input type="text" name="event_owner_email" id="event-owner-email" value="<?php echo esc_attr($EM_Event->event_owner_email); ?>" />
</p>
<?php do_action('em_front_event_form_guest'); ?>
<?php do_action('em_font_event_form_guest'); //deprecated ?>
</div>
<?php endif; ?>
<h3 class="event-form-name"><?php esc_html_e( 'Event Name', 'events-manager'); ?></h3>
<div class="inside event-form-name">
<input type="text" name="event_name" id="event-name" value="<?php echo esc_attr($EM_Event->event_name,ENT_QUOTES); ?>" /><?php echo $required; ?>
<br />
<?php esc_html_e('The event name. Example: Birthday party', 'events-manager'); ?>
<?php em_locate_template('forms/event/group.php',true); ?>
</div>
<h3 class="event-form-when"><?php esc_html_e( 'When', 'events-manager'); ?></h3>
<div class="inside event-form-when">
<?php
if( empty($EM_Event->event_id) && $EM_Event->can_manage('edit_recurring_events','edit_others_recurring_events') && get_option('dbem_recurrence_enabled') ){
em_locate_template('forms/event/when-with-recurring.php',true);
}elseif( $EM_Event->is_recurring() ){
em_locate_template('forms/event/recurring-when.php',true);
}else{
em_locate_template('forms/event/when.php',true);
}
?>
</div>
<?php if( get_option('dbem_locations_enabled') ): ?>
<h3 class="event-form-where"><?php esc_html_e( 'Where', 'events-manager'); ?></h3>
<div class="inside event-form-where">
<?php em_locate_template('forms/event/location.php',true); ?>
</div>
<?php endif; ?>
<h3 class="event-form-details"><?php esc_html_e( 'Details', 'events-manager'); ?></h3>
<div class="inside event-form-details">
<div class="event-editor">
<?php if( get_option('dbem_events_form_editor') && function_exists('wp_editor') ): ?>
<?php wp_editor($EM_Event->post_content, 'em-editor-content', array('textarea_name'=>'content') ); ?>
<?php else: ?>
<textarea name="content" rows="10" style="width:100%"><?php echo $EM_Event->post_content ?></textarea>
<br />
<?php esc_html_e( 'Details about the event.', 'events-manager')?> <?php esc_html_e( 'HTML allowed.', 'events-manager')?>
<?php endif; ?>
</div>
<div class="event-extra-details">
<?php if(get_option('dbem_attributes_enabled')) { em_locate_template('forms/event/attributes-public.php',true); } ?>
<?php if(get_option('dbem_categories_enabled')) { em_locate_template('forms/event/categories-public.php',true); } ?>
</div>
</div>
<?php if( $EM_Event->can_manage('upload_event_images','upload_event_images') ): ?>
<h3><?php esc_html_e( 'Event Image', 'events-manager'); ?></h3>
<div class="inside event-form-image">
<?php em_locate_template('forms/event/featured-image-public.php',true); ?>
</div>
<?php endif; ?>
<?php if( get_option('dbem_rsvp_enabled') && $EM_Event->can_manage('manage_bookings','manage_others_bookings') ) : ?>
<!-- START Bookings -->
<h3><?php esc_html_e('Bookings/Registration','events-manager'); ?></h3>
<div class="inside event-form-bookings">
<?php em_locate_template('forms/event/bookings.php',true); ?>
</div>
<!-- END Bookings -->
<?php endif; ?>
<?php do_action('em_front_event_form_footer'); ?>
</div>
<p class="submit">
<?php if( empty($EM_Event->event_id) ): ?>
<input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Submit %s','events-manager'), __('Event','events-manager') )); ?>' />
<?php else: ?>
<input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Update %s','events-manager'), __('Event','events-manager') )); ?>' />
<?php endif; ?>
</p>
<input type="hidden" name="event_id" value="<?php echo $EM_Event->event_id; ?>" />
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('wpnonce_event_save'); ?>" />
<input type="hidden" name="action" value="event_save" />
<?php if( !empty($_REQUEST['redirect_to']) ): ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($_REQUEST['redirect_to']); ?>" />
<?php endif; ?>
</form>

View File

@ -0,0 +1,31 @@
<?php
/*
* This file is called by templates/forms/event-editor.php to display attribute fields on your event form on your website.
* You can override this file by copying it to /wp-content/themes/yourtheme/plugins/events-manager/forms/event/ and editing it there.
*/
global $EM_Event;
/* @var $EM_Event EM_Event */
$attributes = em_get_attributes();
$has_deprecated = false;
?>
<?php if( count( $attributes['names'] ) > 0 ) : ?>
<?php foreach( $attributes['names'] as $name) : ?>
<div class="event-attributes">
<label for="em_attributes[<?php echo $name ?>]"><?php echo $name ?></label>
<?php if( count($attributes['values'][$name]) > 1 ): ?>
<select name="em_attributes[<?php echo $name ?>]">
<?php foreach($attributes['values'][$name] as $attribute_val): ?>
<?php if( is_array($EM_Event->event_attributes) && array_key_exists($name, $EM_Event->event_attributes) && $EM_Event->event_attributes[$name]==$attribute_val ): ?>
<option selected="selected"><?php echo $attribute_val; ?></option>
<?php else: ?>
<option><?php echo $attribute_val; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php else: ?>
<?php $default_value = (!empty($attributes['values'][$name][0])) ? $attributes['values'][$name][0]:''; ?>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Event->event_attributes) ? esc_attr($EM_Event->event_attributes[$name], ENT_QUOTES):''; ?>" value="<?php echo $default_value; ?>" />
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -0,0 +1,89 @@
<?php
global $EM_Event;
$attributes = em_get_attributes();
$has_deprecated = false;
?>
<div id="event-attributes">
<?php if( !empty($attributes['names']) && count( $attributes['names'] ) > 0 ) : ?>
<table class="form-table">
<thead>
<tr valign="top">
<td><strong>Attribute Name</strong></td>
<td><strong>Value</strong></td>
</tr>
</thead>
<tbody id="mtm_body">
<?php
$count = 1;
foreach( $attributes['names'] as $name){
?>
<tr valign="top" id="em_attribute_<?php echo $count ?>">
<td scope="row"><?php echo $name ?></td>
<td>
<?php if( count($attributes['values'][$name]) > 1 ): ?>
<select name="em_attributes[<?php echo $name ?>]">
<?php foreach($attributes['values'][$name] as $attribute_val): ?>
<?php if( array_key_exists($name, $EM_Event->event_attributes) && $EM_Event->event_attributes[$name]==$attribute_val ): ?>
<option selected="selected"><?php echo $attribute_val; ?></option>
<?php else: ?>
<option><?php echo $attribute_val; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php else: ?>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Event->event_attributes) ? esc_attr($EM_Event->event_attributes[$name], ENT_QUOTES):''; ?>" />
<?php endif; ?>
</td>
</tr>
<?php
$count++;
}
if($count == 1){
?>
<tr><td colspan="2"><?php echo sprintf(__("You don't have any custom attributes defined in any of your Events Manager template settings. Please add them the <a href='%s'>settings page</a>",'events-manager'),EM_ADMIN_URL ."&amp;page=events-manager-options"); ?></td></tr>
<?php
}
?>
</tbody>
</table>
<?php if( count(array_diff(array_keys($EM_Event->event_attributes), $attributes['names'])) > 0 ): ?>
<p><strong><?php _e('Deprecated Attributes', 'events-manager')?></strong></p>
<p><em><?php _e("If you see any attributes under here, that means they're not used in Events Manager formats. To add them, you need to add the custom attribute again to a formatting option in the settings page. To remove any of these deprecated attributes, give it a blank value and save.",'events-manager') ?></em></p>
<table class="form-table">
<thead>
<tr valign="top">
<td><strong>Attribute Name</strong></td>
<td><strong>Value</strong></td>
</tr>
</thead>
<tbody id="mtm_body">
<?php
if( is_array($EM_Event->event_attributes) and count($EM_Event->event_attributes) > 0){
foreach( $EM_Event->event_attributes as $name => $value){
if( is_array($value) ) $value = serialize($value);
if( !in_array($name, $attributes['names']) ){
?>
<tr valign="top" id="em_attribute_<?php echo $count ?>">
<td scope="row"><?php echo $name ?></td>
<td>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo esc_attr($value, ENT_QUOTES); ?>" />
</td>
</tr>
<?php
$count++;
}
}
}
?>
</tbody>
</table>
<?php endif; ?>
<?php else : ?>
<p>
<?php _e('In order to use attributes, you must define some in your templates, otherwise they\'ll never show. Go to Events > Settings > General to add attribute placeholders.', 'events-manager'); ?>
</p>
<script>
jQuery(document).ready(function($){ $('#event_attributes').addClass('closed'); });
</script>
<?php endif; ?>
</div>

View File

@ -0,0 +1,37 @@
<?php
global $EM_Event, $post;
?>
<div id='rsvp-data'>
<?php
$available_spaces = $EM_Event->get_bookings()->get_available_spaces();
$booked_spaces = $EM_Event->get_bookings()->get_booked_spaces();
if ( count($EM_Event->get_bookings()->bookings) > 0 ) {
?>
<div class='wrap'>
<p><strong><?php echo __('Available Spaces','events-manager').': '.$EM_Event->get_bookings()->get_available_spaces(); ?></strong></p>
<p><strong><?php echo __('Confirmed Spaces','events-manager').': '.$EM_Event->get_bookings()->get_booked_spaces(); ?></strong></p>
<p><strong><?php echo __('Pending Spaces','events-manager').': '.$EM_Event->get_bookings()->get_pending_spaces(); ?></strong></p>
</div>
<br class='clear'/>
<?php
} else {
?>
<p><em><?php _e('No responses yet!', 'events-manager')?></em></p>
<?php
}
?>
<div id='major-publishing-actions'>
<div id='publishing-action'>
<a id='printable' href='<?php echo $EM_Event->get_bookings_url(); ?>'><?php _e('manage bookings','events-manager')?></a><br />
<a target='_blank' href='<?php echo EM_ADMIN_URL ."&amp;page=events-manager-bookings&action=bookings_report&event_id=".$EM_Event->event_id ?>'><?php _e('printable view','events-manager')?></a>
<?php if( locate_template('plugins/events-manager/templates/csv-event-bookings.php', false) ): ?>
<br /><a href='<?php echo EM_ADMIN_URL ."&amp;page=events-manager-bookings&action=export_csv&event_id=".$EM_Event->event_id ?>'><?php _e('export csv','events-manager')?></a>
<?php endif; ?>
<?php do_action('em_admin_event_booking_options'); ?>
<br class='clear'/>
</div>
<br class='clear'/>
</div>
</div>

View File

@ -0,0 +1,109 @@
<?php
/*
* Used for both multiple and single tickets. $col_count will always be 1 in single ticket mode, and be a unique number for each ticket starting from 1
* This form should have $EM_Ticket and $col_count available globally.
*/
global $col_count, $EM_Ticket;
$col_count = absint($col_count); //now we know it's a number
?>
<div class="em-ticket-form">
<input type="hidden" name="em_tickets[<?php echo $col_count; ?>][ticket_id]" class="ticket_id" value="<?php echo esc_attr($EM_Ticket->ticket_id) ?>" />
<div class="em-ticket-form-main">
<div class="ticket-name">
<label title="<?php esc_attr_e('Enter a ticket name.','events-manager'); ?>"><?php esc_html_e('Name','events-manager') ?></label>
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_name]" value="<?php echo esc_attr($EM_Ticket->ticket_name) ?>" class="ticket_name" />
</div>
<div class="ticket-description">
<label><?php esc_html_e('Description','events-manager') ?></label>
<textarea name="em_tickets[<?php echo $col_count; ?>][ticket_description]" class="ticket_description"><?php echo esc_html(wp_unslash($EM_Ticket->ticket_description)) ?></textarea>
</div>
<div class="ticket-price"><label><?php esc_html_e('Price','events-manager') ?></label><input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_price]" class="ticket_price" value="<?php echo esc_attr($EM_Ticket->get_price_precise()) ?>" /></div>
<div class="ticket-spaces">
<label title="<?php esc_attr_e('Enter a maximum number of spaces (required).','events-manager'); ?>"><?php esc_html_e('Spaces','events-manager') ?></label>
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_spaces]" value="<?php echo esc_attr($EM_Ticket->ticket_spaces) ?>" class="ticket_spaces" />
</div>
</div>
<div class="em-ticket-form-advanced" style="display:none;">
<div class="ticket-spaces ticket-spaces-min">
<label title="<?php esc_attr_e('Leave either blank for no upper/lower limit.','events-manager'); ?>"><?php echo esc_html_x('At least','spaces per booking','events-manager');?></label>
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_min]" value="<?php echo esc_attr($EM_Ticket->ticket_min) ?>" class="ticket_min" />
<?php esc_html_e('spaces per booking', 'events-manager')?>
</div>
<div class="ticket-spaces ticket-spaces-max">
<label title="<?php esc_attr_e('Leave either blank for no upper/lower limit.','events-manager'); ?>"><?php echo esc_html_x('At most','spaces per booking', 'events-manager'); ?></label>
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_max]" value="<?php echo esc_attr($EM_Ticket->ticket_max) ?>" class="ticket_max" />
<?php esc_html_e('spaces per booking', 'events-manager')?>
</div>
<div class="ticket-dates em-time-range em-date-range">
<div class="ticket-dates-from">
<label title="<?php esc_attr_e('Add a start or end date (or both) to impose time constraints on ticket availability. Leave either blank for no upper/lower limit.','events-manager'); ?>">
<?php esc_html_e('Available from','events-manager') ?>
</label>
<div class="ticket-dates-from-normal">
<input type="text" name="ticket_start_pub" class="em-date-input-loc em-date-start" />
<input type="hidden" name="em_tickets[<?php echo $col_count; ?>][ticket_start]" class="em-date-input ticket_start" value="<?php echo ( !empty($EM_Ticket->ticket_start) ) ? date("Y-m-d", $EM_Ticket->start_timestamp):''; ?>" />
</div>
<div class="ticket-dates-from-recurring">
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_start_recurring_days]" size="3" value="<?php if( !empty($EM_Ticket->ticket_meta['recurrences']) && is_numeric($EM_Ticket->ticket_meta['recurrences']['start_days'])) echo absint($EM_Ticket->ticket_meta['recurrences']['start_days']); ?>" />
<?php esc_html_e('day(s)','events-manager'); ?>
<select name="em_tickets[<?php echo $col_count; ?>][ticket_start_recurring_when]" class="ticket-dates-from-recurring-when">
<option value="before" <?php if( !empty($EM_Ticket->ticket_meta['recurrences']['start_days']) && $EM_Ticket->ticket_meta['recurrences']['start_days'] <= 0) echo 'selected="selected"'; ?>><?php echo esc_html(sprintf(_x('%s the event starts','before or after','events-manager'),__('Before','events-manager'))); ?></option>
<option value="after" <?php if( !empty($EM_Ticket->ticket_meta['recurrences']['start_days']) && $EM_Ticket->ticket_meta['recurrences']['start_days'] > 0) echo 'selected="selected"'; ?>><?php echo esc_html(sprintf(_x('%s the event starts','before or after','events-manager'),__('After','events-manager'))); ?></option>
</select>
</div>
<?php echo esc_html_x('at', 'time','events-manager'); ?>
<input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="em_tickets[<?php echo $col_count; ?>][ticket_start_time]" value="<?php echo ( !empty($EM_Ticket->ticket_start) ) ? date( em_get_hour_format(), $EM_Ticket->start_timestamp):''; ?>" />
</div>
<div class="ticket-dates-to">
<label title="<?php esc_attr_e('Add a start or end date (or both) to impose time constraints on ticket availability. Leave either blank for no upper/lower limit.','events-manager'); ?>">
<?php esc_html_e('Available until','events-manager') ?>
</label>
<div class="ticket-dates-to-normal">
<input type="text" name="ticket_end_pub" class="em-date-input-loc em-date-end" />
<input type="hidden" name="em_tickets[<?php echo $col_count; ?>][ticket_end]" class="em-date-input ticket_end" value="<?php echo ( !empty($EM_Ticket->ticket_end) ) ? date("Y-m-d", $EM_Ticket->end_timestamp):''; ?>" />
</div>
<div class="ticket-dates-to-recurring">
<input type="text" name="em_tickets[<?php echo $col_count; ?>][ticket_end_recurring_days]" size="3" value="<?php if( !empty($EM_Ticket->ticket_meta['recurrences']['end_days']) ) echo absint($EM_Ticket->ticket_meta['recurrences']['end_days']); ?>" />
<?php esc_html_e('day(s)','events-manager'); ?>
<select name="em_tickets[<?php echo $col_count; ?>][ticket_end_recurring_when]" class="ticket-dates-to-recurring-when">
<option value="before" <?php if( !empty($EM_Ticket->ticket_meta['recurrences']['end_days']) && $EM_Ticket->ticket_meta['recurrences']['end_days'] <= 0) echo 'selected="selected"'; ?>><?php echo esc_html(sprintf(_x('%s the event starts','before or after','events-manager'),__('Before','events-manager'))); ?></option>
<option value="after" <?php if( !empty($EM_Ticket->ticket_meta['recurrences']['end_days']) && $EM_Ticket->ticket_meta['recurrences']['end_days'] > 0) echo 'selected="selected"'; ?>><?php echo esc_html(sprintf(_x('%s the event starts','before or after','events-manager'),__('After','events-manager'))); ?></option>
</select>
</div>
<?php echo esc_html_x('at', 'time','events-manager'); ?>
<input id="end-time" class="em-time-input em-time-end" type="text" size="8" maxlength="8" name="em_tickets[<?php echo $col_count; ?>][ticket_end_time]" value="<?php echo ( !empty($EM_Ticket->ticket_end) ) ? date( em_get_hour_format(), $EM_Ticket->end_timestamp):''; ?>" />
</div>
</div>
<?php if( !get_option('dbem_bookings_tickets_single') || count($EM_Ticket->get_event()->get_tickets()->tickets) > 1 ): ?>
<div class="ticket-required">
<label title="<?php esc_attr_e('If checked every booking must select one or the minimum number of this ticket.','events-manager'); ?>"><?php esc_html_e('Required?','events-manager') ?></label>
<input type="checkbox" value="1" name="em_tickets[<?php echo $col_count; ?>][ticket_required]" <?php if($EM_Ticket->ticket_required) echo 'checked="checked"'; ?> class="ticket_required" />
</div>
<?php endif; ?>
<div class="ticket-type">
<label><?php esc_html_e('Available for','events-manager') ?></label>
<select name="em_tickets[<?php echo $col_count; ?>][ticket_type]" class="ticket_type">
<option value=""><?php _e('Everyone','events-manager'); ?></option>
<option value="members" <?php if($EM_Ticket->ticket_members) echo 'selected="selected"'; ?>><?php esc_html_e('Logged In Users','events-manager'); ?></option>
<option value="guests" <?php if($EM_Ticket->ticket_guests) echo 'selected="selected"'; ?>><?php esc_html_e('Guest Users','events-manager'); ?></option>
</select>
</div>
<div class="ticket-roles" <?php if( !$EM_Ticket->ticket_members ): ?>style="display:none;"<?php endif; ?>>
<label><?php _e('Restrict to','events-manager'); ?></label>
<div>
<?php
$WP_Roles = new WP_Roles();
foreach($WP_Roles->roles as $role => $role_data){ /* @var $WP_Role WP_Role */
?>
<input type="checkbox" name="em_tickets[<?php echo $col_count; ?>][ticket_members_roles][]" value="<?php echo esc_attr($role); ?>" <?php if( in_array($role, $EM_Ticket->ticket_members_roles) ) echo 'checked="checked"' ?> class="ticket_members_roles" /> <?php echo esc_html($role_data['name']); ?><br />
<?php
}
?>
</div>
</div>
<?php do_action('em_ticket_edit_form_fields', $col_count, $EM_Ticket); //do not delete, add your extra fields this way, remember to save them too! ?>
</div>
<div class="ticket-options">
<a href="#" class="ticket-options-advanced show"><span class="show-advanced"><?php esc_html_e('Show Advanced Options','events-manager'); ?></span><span class="hide-advanced" style="display:none;"><?php esc_html_e('Hide Advanced Options','events-manager'); ?></span></a>
</div>
</div>

View File

@ -0,0 +1,200 @@
<?php
global $EM_Event, $post, $allowedposttags, $EM_Ticket, $col_count;
$reschedule_warnings = !empty($EM_Event->event_id) && $EM_Event->is_recurring() && $EM_Event->event_rsvp;
?>
<div id="event-rsvp-box">
<input id="event-rsvp" name='event_rsvp' value='1' type='checkbox' <?php echo ($EM_Event->event_rsvp) ? 'checked="checked"' : ''; ?> />
&nbsp;&nbsp;
<?php _e ( 'Enable registration for this event', 'events-manager')?>
</div>
<div id="event-rsvp-options" style="<?php echo ($EM_Event->event_rsvp) ? '':'display:none;' ?>">
<?php
do_action('em_events_admin_bookings_header', $EM_Event);
//get tickets here and if there are none, create a blank ticket
$EM_Tickets = $EM_Event->get_tickets();
if( count($EM_Tickets->tickets) == 0 ){
$EM_Tickets->tickets[] = new EM_Ticket();
$delete_temp_ticket = true;
}
?>
<div class="event-rsvp-options-tickets <?php if( $reschedule_warnings ) echo 'em-recurrence-reschedule'; ?>">
<?php
//output title
if( get_option('dbem_bookings_tickets_single') && count($EM_Tickets->tickets) == 1 ){
?>
<h4><?php esc_html_e('Ticket Options','events-manager'); ?></h4>
<?php
}else{
?>
<h4><?php esc_html_e('Tickets','events-manager'); ?></h4>
<?php
}
//If this event is a recurring template, we need to warn the user that editing tickets will delete previous bookings
if( $reschedule_warnings ){
?>
<div class="recurrence-reschedule-warning">
<p><?php esc_html_e( 'Modifications to event tickets will cause all bookings to individual recurrences of this event to be deleted.', 'events-manager'); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg(array('scope'=>'all', 'recurrence_id'=>$EM_Event->event_id), em_get_events_admin_url()) ); ?>">
<strong><?php esc_html_e('You can edit individual recurrences and disassociate them with this recurring event.', 'events-manager'); ?></strong>
</a>
</p>
</div>
<?php
}
?>
<div id="em-tickets-form" class="em-tickets-form<?php if( $reschedule_warnings && empty($_REQUEST['recreate_tickets']) ) echo ' reschedule-hidden' ?>">
<?php
//output ticket options
if( get_option('dbem_bookings_tickets_single') && count($EM_Tickets->tickets) == 1 ){
$col_count = 1;
$EM_Ticket = $EM_Tickets->get_first();
include( em_locate_template('forms/ticket-form.php') ); //in future we'll be accessing forms/event/bookings-ticket-form.php directly
}else{
?>
<p><em><?php esc_html_e('You can have single or multiple tickets, where certain tickets become available under certain conditions, e.g. early bookings, group discounts, maximum bookings per ticket, etc.', 'events-manager'); ?> <?php esc_html_e('Basic HTML is allowed in ticket labels and descriptions.','events-manager'); ?></em></p>
<table class="form-table">
<thead>
<tr valign="top">
<th colspan="2"><?php esc_html_e('Ticket Name','events-manager'); ?></th>
<th><?php esc_html_e('Price','events-manager'); ?></th>
<th><?php esc_html_e('Min/Max','events-manager'); ?></th>
<th><?php esc_html_e('Start/End','events-manager'); ?></th>
<th><?php esc_html_e('Avail. Spaces','events-manager'); ?></th>
<th><?php esc_html_e('Booked Spaces','events-manager'); ?></th>
<th>&nbsp;</th>
</tr>
</thead>
<tfoot>
<tr valign="top">
<td colspan="8">
<a href="#" id="em-tickets-add"><?php esc_html_e('Add new ticket','events-manager'); ?></a>
</td>
</tr>
</tfoot>
<?php
$EM_Ticket = new EM_Ticket();
$EM_Ticket->event_id = $EM_Event->event_id;
array_unshift($EM_Tickets->tickets, $EM_Ticket); //prepend template ticket for JS
$col_count = 0;
foreach( $EM_Tickets->tickets as $EM_Ticket){
/* @var $EM_Ticket EM_Ticket */
?>
<tbody id="em-ticket-<?php echo $col_count ?>" <?php if( $col_count == 0 ) echo 'style="display:none;"' ?>>
<tr class="em-tickets-row">
<td class="ticket-status"><span class="<?php if($EM_Ticket->ticket_id && $EM_Ticket->is_available(true, true)){ echo 'ticket_on'; }elseif($EM_Ticket->ticket_id > 0){ echo 'ticket_off'; }else{ echo 'ticket_new'; } ?>"></span></td>
<td class="ticket-name">
<span class="ticket_name"><?php if($EM_Ticket->ticket_members) echo '* ';?><?php echo wp_kses_data($EM_Ticket->ticket_name); ?></span>
<div class="ticket_description"><?php echo wp_kses($EM_Ticket->ticket_description,$allowedposttags); ?></div>
<div class="ticket-actions">
<a href="#" class="ticket-actions-edit"><?php esc_html_e('Edit','events-manager'); ?></a>
<?php if( count($EM_Ticket->get_bookings()->bookings) == 0 ): ?>
| <a href="<?php bloginfo('wpurl'); ?>/wp-load.php" class="ticket-actions-delete"><?php esc_html_e('Delete','events-manager'); ?></a>
<?php else: ?>
| <a href="<?php echo esc_url(add_query_arg('ticket_id', $EM_Ticket->ticket_id, $EM_Event->get_bookings_url())); ?>"><?php esc_html_e('View Bookings','events-manager'); ?></a>
<?php endif; ?>
</div>
</td>
<td class="ticket-price">
<span class="ticket_price"><?php echo ($EM_Ticket->ticket_price) ? esc_html($EM_Ticket->get_price_precise()) : esc_html__('Free','events-manager'); ?></span>
</td>
<td class="ticket-limit">
<span class="ticket_min">
<?php echo ( !empty($EM_Ticket->ticket_min) ) ? esc_html($EM_Ticket->ticket_min):'-'; ?>
</span> /
<span class="ticket_max"><?php echo ( !empty($EM_Ticket->ticket_max) ) ? esc_html($EM_Ticket->ticket_max):'-'; ?></span>
</td>
<td class="ticket-time">
<span class="ticket_start ticket-dates-from-normal"><?php echo ( !empty($EM_Ticket->ticket_start) ) ? date(get_option('dbem_date_format'), $EM_Ticket->start_timestamp):''; ?></span>
<span class="ticket_start_recurring_days ticket-dates-from-recurring"><?php if( !empty($EM_Ticket->ticket_meta['recurrences']) ) echo $EM_Ticket->ticket_meta['recurrences']['start_days']; ?></span>
<span class="ticket_start_recurring_days_text ticket-dates-from-recurring <?php if( !empty($EM_Ticket->ticket_meta['recurrences']) && !is_numeric($EM_Ticket->ticket_meta['recurrences']['start_days']) ) echo 'hidden'; ?>"><?php _e('day(s)','events-manager'); ?></span>
<span class="ticket_start_time"><?php echo ( !empty($EM_Ticket->ticket_start) ) ? date( em_get_hour_format(), $EM_Ticket->start_timestamp):''; ?></span>
<br />
<span class="ticket_end ticket-dates-from-normal"><?php echo ( !empty($EM_Ticket->ticket_end) ) ? date(get_option('dbem_date_format'), $EM_Ticket->end_timestamp):''; ?></span>
<span class="ticket_end_recurring_days ticket-dates-from-recurring"><?php if( !empty($EM_Ticket->ticket_meta['recurrences']) ) echo $EM_Ticket->ticket_meta['recurrences']['end_days']; ?></span>
<span class="ticket_end_recurring_days_text ticket-dates-from-recurring <?php if( !empty($EM_Ticket->ticket_meta['recurrences']) && !is_numeric($EM_Ticket->ticket_meta['recurrences']['end_days']) ) echo 'hidden'; ?>"><?php _e('day(s)','events-manager'); ?></span>
<span class="ticket_end_time"><?php echo ( !empty($EM_Ticket->ticket_end) ) ? date( em_get_hour_format(), $EM_Ticket->end_timestamp):''; ?></span>
</td>
<td class="ticket-qty">
<span class="ticket_available_spaces"><?php echo $EM_Ticket->get_available_spaces(); ?></span>/
<span class="ticket_spaces"><?php echo $EM_Ticket->get_spaces() ? $EM_Ticket->get_spaces() : '-'; ?></span>
</td>
<td class="ticket-booked-spaces">
<span class="ticket_booked_spaces"><?php echo $EM_Ticket->get_booked_spaces(); ?></span>
</td>
<?php do_action('em_event_edit_ticket_td', $EM_Ticket); ?>
</tr>
<tr class="em-tickets-row-form" style="display:none;">
<td colspan="<?php echo apply_filters('em_event_edit_ticket_td_colspan', 7); ?>">
<?php include( em_locate_template('forms/event/bookings-ticket-form.php')); ?>
<div class="em-ticket-form-actions">
<button type="button" class="ticket-actions-edited"><?php esc_html_e('Close Ticket Editor','events-manager')?></button>
</div>
</td>
</tr>
</tbody>
<?php
$col_count++;
}
array_shift($EM_Tickets->tickets);
?>
</table>
<?php
}
?>
</div>
<?php if( $reschedule_warnings ): //If this event is a recurring template, we need to warn the user that editing tickets will delete previous bookings ?>
<div class="recurrence-reschedule-buttons">
<a href="<?php echo esc_url(add_query_arg('recreate_tickets', null)); ?>" class="button-secondary em-button em-reschedule-cancel<?php if( empty($_REQUEST['recreate_tickets']) ) echo ' reschedule-hidden'; ?>" data-target=".em-tickets-form">
<?php esc_html_e('Cancel Ticket Recreation', 'events-manager'); ?>
</a>
<a href="<?php echo esc_url(add_query_arg('recreate_tickets', '1')); ?>" class="em-reschedule-trigger em-button button-secondary<?php if( !empty($_REQUEST['recreate_tickets']) ) echo ' reschedule-hidden'; ?>" data-target=".em-tickets-form">
<?php esc_html_e('Modify Recurring Event Tickets ', 'events-manager'); ?>
</a>
<input type="hidden" name="event_recreate_tickets" class="em-reschedule-value" value="<?php echo empty($_REQUEST['recreate_tickets']) ? 0:1 ?>" />
</div>
<?php endif; ?>
</div>
<div id="em-booking-options" class="em-booking-options">
<?php if( !get_option('dbem_bookings_tickets_single') || count($EM_Ticket->get_event()->get_tickets()->tickets) > 1 ): ?>
<h4><?php esc_html_e('Event Options','events-manager'); ?></h4>
<p>
<label><?php esc_html_e('Total Spaces','events-manager'); ?></label>
<input type="text" name="event_spaces" value="<?php if( $EM_Event->event_spaces > 0 ){ echo $EM_Event->event_spaces; } ?>" /><br />
<em><?php esc_html_e('Individual tickets with remaining spaces will not be available if total booking spaces reach this limit. Leave blank for no limit.','events-manager'); ?></em>
</p>
<p>
<label><?php esc_html_e('Maximum Spaces Per Booking','events-manager'); ?></label>
<input type="text" name="event_rsvp_spaces" value="<?php if( $EM_Event->event_rsvp_spaces > 0 ){ echo $EM_Event->event_rsvp_spaces; } ?>" /><br />
<em><?php esc_html_e('If set, the total number of spaces for a single booking to this event cannot exceed this amount.','events-manager'); ?><?php esc_html_e('Leave blank for no limit.','events-manager'); ?></em>
</p>
<p>
<label><?php esc_html_e('Booking Cut-Off Date','events-manager'); ?></label>
<span class="em-booking-date-normal">
<span class="em-date-single">
<input id="em-bookings-date-loc" class="em-date-input-loc" type="text" />
<input id="em-bookings-date" class="em-date-input" type="hidden" name="event_rsvp_date" value="<?php echo $EM_Event->event_rsvp_date; ?>" />
</span>
</span>
<span class="em-booking-date-recurring">
<input type="text" name="recurrence_rsvp_days" size="3" value="<?php echo absint($EM_Event->recurrence_rsvp_days); ?>" />
<?php _e('day(s)','events-manager'); ?>
<select name="recurrence_rsvp_days_when">
<option value="before" <?php if( !empty($EM_Event->recurrence_rsvp_days) && $EM_Event->recurrence_rsvp_days <= 0) echo 'selected="selected"'; ?>><?php echo sprintf(_x('%s the event starts','before or after','events-manager'),__('Before','events-manager')); ?></option>
<option value="after" <?php if( !empty($EM_Event->recurrence_rsvp_days) && $EM_Event->recurrence_rsvp_days > 0) echo 'selected="selected"'; ?>><?php echo sprintf(_x('%s the event starts','before or after','events-manager'),__('After','events-manager')); ?></option>
</select>
<?php _e('at','events-manager'); ?>
</span>
<input type="text" name="event_rsvp_time" class="em-time-input" maxlength="8" size="8" value="<?php echo date( em_get_hour_format(), $EM_Event->rsvp_end ); ?>" />
<br />
<em><?php esc_html_e('This is the definite date after which bookings will be closed for this event, regardless of individual ticket settings above. Default value will be the event start date.','events-manager'); ?></em>
</p>
<?php endif; ?>
</div>
<?php
if( !empty($delete_temp_ticket) ){
array_pop($EM_Tickets->tickets);
}
do_action('em_events_admin_bookings_footer', $EM_Event);
?>
</div>

View File

@ -0,0 +1,23 @@
<?php
/*
* This file is called by templates/forms/location-editor.php to display fields for uploading images on your event form on your website. This does not affect the admin featured image section.
* You can override this file by copying it to /wp-content/themes/yourtheme/plugins/events-manager/forms/event/ and editing it there.
*/
global $EM_Event;
/* @var $EM_Event EM_Event */
$categories = EM_Categories::get(array('orderby'=>'name','hide_empty'=>0));
?>
<?php if( count($categories) > 0 ): ?>
<div class="event-categories">
<!-- START Categories -->
<label for="event_categories[]"><?php _e ( 'Category:', 'events-manager'); ?></label>
<select name="event_categories[]" multiple size="10">
<?php
$selected = $EM_Event->get_categories()->get_ids();
$walker = new EM_Walker_CategoryMultiselect();
$args_em = array( 'hide_empty' => 0, 'name' => 'event_categories[]', 'hierarchical' => true, 'id' => EM_TAXONOMY_CATEGORY, 'taxonomy' => EM_TAXONOMY_CATEGORY, 'selected' => $selected, 'walker'=> $walker);
echo walk_category_dropdown_tree($categories, 0, $args_em);
?></select>
<!-- END Categories -->
</div>
<?php endif; ?>

View File

@ -0,0 +1,20 @@
<?php
/*
* This file is called by templates/forms/location-editor.php to display fields for uploading images on your event form on your website. This does not affect the admin featured image section.
* You can override this file by copying it to /wp-content/themes/yourtheme/plugins/events-manager/forms/event/ and editing it there.
*/
global $EM_Event;
/* @var $EM_Event EM_Event */
?>
<p id="event-image-img">
<?php if ($EM_Event->get_image_url() != '') : ?>
<img src='<?php echo $EM_Event->get_image_url('medium'); ?>' alt='<?php echo $EM_Event->event_name ?>'/>
<?php else : ?>
<?php _e('No image uploaded for this event yet', 'events-manager') ?>
<?php endif; ?>
</p>
<label for='event_image'><?php _e('Upload/change picture', 'events-manager') ?></label> <input id='event-image' name='event_image' id='event_image' type='file' size='40' />
<br />
<?php if ($EM_Event->get_image_url() != '') : ?>
<label for='event_image_delete'><?php _e('Delete Image?', 'events-manager') ?></label> <input id='event-image-delete' name='event_image_delete' id='event_image_delete' type='checkbox' value='1' />
<?php endif; ?>

View File

@ -0,0 +1,48 @@
<?php
global $EM_Event;
if( !function_exists('bp_is_active') || !bp_is_active('groups') ) return false;
$user_groups = array();
$group_data = groups_get_user_groups(get_current_user_id());
if( !is_super_admin() ){
foreach( $group_data['groups'] as $group_id ){
if( groups_is_user_admin(get_current_user_id(), $group_id) ){
$user_groups[] = groups_get_group( array('group_id'=>$group_id));
}
}
$group_count = count($user_groups);
}else{
$groups = groups_get_groups(array('show_hidden'=>true, 'per_page'=>0));
$user_groups = $groups['groups'];
$group_count = $groups['total'];
}
if( count($user_groups) > 0 ){
?>
<p>
<select name="group_id">
<option value=""><?php _e('Not a Group Event', 'events-manager'); ?></option>
<?php
//in case user isn't a group mod, but can edit other users' events
if( !empty($EM_Event->group_id) && !in_array($EM_Event->group_id, $group_data['groups']) ){
$other_group = groups_get_group( array('group_id'=>$EM_Event->group_id));
?>
<option value="<?php echo $other_group->id; ?>" selected="selected"><?php echo $other_group->name; ?></option>
<?php
}
//show user groups
foreach($user_groups as $BP_Group){
?>
<option value="<?php echo $BP_Group->id; ?>" <?php echo ($BP_Group->id == $EM_Event->group_id) ? 'selected="selected"':''; ?>><?php echo $BP_Group->name; ?></option>
<?php
}
?>
</select>
<br />
<em><?php _e ( 'Select a group you admin to attach this event to it. Note that all other admins of that group can modify the booking.', 'events-manager')?></em>
</p>
<?php if( is_super_admin() ): ?>
<p><em><?php _e ( 'As a site admin, you see all group events, users will only be able to choose groups they are admins of.', 'events-manager')?></em></p>
<?php endif;
}else{
?><p><em><?php _e('No groups defined yet.','events-manager'); ?></em></p><?php
}

View File

@ -0,0 +1,128 @@
<?php
global $EM_Event;
$required = apply_filters('em_required_html','<i>*</i>');
?>
<?php if( !get_option('dbem_require_location') && !get_option('dbem_use_select_for_locations') ): ?>
<div class="em-location-data-nolocation">
<p>
<input type="checkbox" name="no_location" id="no-location" value="1" <?php if( $EM_Event->location_id === '0' || $EM_Event->location_id === 0 ) echo 'checked="checked"'; ?> />
<?php _e('This event does not have a physical location.','events-manager'); ?>
</p>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#no-location').change(function(){
if( $('#no-location').is(':checked') ){
$('#em-location-data').hide();
}else{
$('#em-location-data').show();
}
}).trigger('change');
});
</script>
</div>
<?php endif; ?>
<div id="em-location-data" class="em-location-data">
<div id="location_coordinates" style='display: none;'>
<input id='location-latitude' name='location_latitude' type='text' value='<?php echo esc_attr($EM_Event->get_location()->location_latitude); ?>' size='15' />
<input id='location-longitude' name='location_longitude' type='text' value='<?php echo esc_attr($EM_Event->get_location()->location_longitude); ?>' size='15' />
</div>
<?php if( get_option('dbem_use_select_for_locations') || !$EM_Event->can_manage('edit_locations','edit_others_locations') ) : ?>
<table class="em-location-data">
<tr class="em-location-data-select">
<th><?php esc_html_e('Location:','events-manager') ?> </th>
<td>
<select name="location_id" id='location-select-id' size="1">
<?php if(!get_option('dbem_require_location',true)): ?><option value="0"><?php esc_html_e('No Location','events-manager'); ?></option><?php endif; ?>
<?php
$ddm_args = array('blog'=>false, 'private'=>$EM_Event->can_manage('read_private_locations'));
$ddm_args['owner'] = (is_user_logged_in() && !current_user_can('read_others_locations')) ? get_current_user_id() : false;
$locations = EM_Locations::get($ddm_args);
$selected_location = !empty($EM_Event->location_id) || !empty($EM_Event->event_id) ? $EM_Event->location_id:get_option('dbem_default_location');
foreach($locations as $EM_Location) {
$selected = ($selected_location == $EM_Location->location_id) ? "selected='selected' " : '';
if( $selected ) $found_location = true;
?>
<option value="<?php echo esc_attr($EM_Location->location_id) ?>" title="<?php echo esc_attr("{$EM_Location->location_latitude},{$EM_Location->location_longitude}"); ?>" <?php echo $selected ?>><?php echo esc_html($EM_Location->location_name); ?></option>
<?php
}
if( empty($found_location) && !empty($EM_Event->location_id) ){
$EM_Location = $EM_Event->get_location();
if( $EM_Location->post_id ){
?>
<option value="<?php echo esc_attr($EM_Location->location_id) ?>" title="<?php echo esc_attr("{$EM_Location->location_latitude},{$EM_Location->location_longitude}"); ?>" selected="selected"><?php echo esc_html($EM_Location->location_name); ?></option>
<?php
}
}
?>
</select>
</td>
</tr>
</table>
<?php else : ?>
<table class="em-location-data">
<?php
global $EM_Location;
if( $EM_Event->location_id !== 0 ){
$EM_Location = $EM_Event->get_location();
}elseif(get_option('dbem_default_location') > 0){
$EM_Location = em_get_location(get_option('dbem_default_location'));
}else{
$EM_Location = new EM_Location();
}
?>
<tr class="em-location-data-name">
<th><?php _e ( 'Location Name:', 'events-manager')?></th>
<td>
<input id='location-id' name='location_id' type='hidden' value='<?php echo esc_attr($EM_Location->location_id); ?>' size='15' />
<input id="location-name" type="text" name="location_name" value="<?php echo esc_attr($EM_Location->location_name, ENT_QUOTES); ?>" /><?php echo $required; ?>
<br />
<em id="em-location-search-tip"><?php esc_html_e( 'Create a location or start typing to search a previously created location.', 'events-manager')?></em>
<em id="em-location-reset" style="display:none;"><?php esc_html_e('You cannot edit saved locations here.', 'events-manager'); ?> <a href="#"><?php esc_html_e('Reset this form to create a location or search again.', 'events-manager')?></a></em>
</td>
</tr>
<tr class="em-location-data-address">
<th><?php _e ( 'Address:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-address" type="text" name="location_address" value="<?php echo esc_attr($EM_Location->location_address); ; ?>" /><?php echo $required; ?>
</td>
</tr>
<tr class="em-location-data-town">
<th><?php _e ( 'City/Town:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-town" type="text" name="location_town" value="<?php echo esc_attr($EM_Location->location_town); ?>" /><?php echo $required; ?>
</td>
</tr>
<tr class="em-location-data-state">
<th><?php _e ( 'State/County:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-state" type="text" name="location_state" value="<?php echo esc_attr($EM_Location->location_state); ?>" />
</td>
</tr>
<tr class="em-location-data-postcode">
<th><?php _e ( 'Postcode:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-postcode" type="text" name="location_postcode" value="<?php echo esc_attr($EM_Location->location_postcode); ?>" />
</td>
</tr>
<tr class="em-location-data-region">
<th><?php _e ( 'Region:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-region" type="text" name="location_region" value="<?php echo esc_attr($EM_Location->location_region); ?>" />
</td>
</tr>
<tr class="em-location-data-country">
<th><?php _e ( 'Country:', 'events-manager')?>&nbsp;</th>
<td>
<select id="location-country" name="location_country">
<option value="0" <?php echo ( $EM_Location->location_country == '' && $EM_Location->location_id == '' && get_option('dbem_location_default_country') == '' ) ? 'selected="selected"':''; ?>><?php _e('none selected','events-manager'); ?></option>
<?php foreach(em_get_countries() as $country_key => $country_name): ?>
<option value="<?php echo esc_attr($country_key); ?>" <?php echo ( $EM_Location->location_country == $country_key || ($EM_Location->location_country == '' && $EM_Location->location_id == '' && get_option('dbem_location_default_country')==$country_key) ) ? 'selected="selected"':''; ?>><?php echo esc_html($country_name); ?></option>
<?php endforeach; ?>
</select><?php echo $required; ?>
</td>
</tr>
</table>
<?php endif; ?>
<?php if ( get_option( 'dbem_gmap_is_active' ) ) em_locate_template('forms/map-container.php',true); ?>
<br style="clear:both;" />
</div>

View File

@ -0,0 +1,92 @@
<?php
/* Used by the admin area to display recurring event time-related information - edit with caution */
global $EM_Event;
$days_names = em_get_days_names();
$hours_format = em_get_hour_format();
$classes = array();
?>
<div id="em-form-recurrence" class="event-form-recurrence event-form-when">
<p class="em-time-range">
<?php _e('Events start from','events-manager'); ?>
<input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="event_start_time" value="<?php echo date( $hours_format, $EM_Event->start ); ?>" />
<?php _e('to','events-manager'); ?>
<input id="end-time" class="em-time-input em-time-end" type="text" size="8" maxlength="8" name="event_end_time" value="<?php echo date( $hours_format, $EM_Event->end ); ?>" />
<?php _e('All day','events-manager'); ?> <input type="checkbox" class="em-time-allday" name="event_all_day" id="em-time-all-day" value="1" <?php if(!empty($EM_Event->event_all_day)) echo 'checked="checked"'; ?> />
</p>
<div class="<?php if( !empty($EM_Event->event_id) ) echo 'em-recurrence-reschedule'; ?>">
<?php if( !empty($EM_Event->event_id) ): ?>
<div class="recurrence-reschedule-warning">
<p><em><?php echo sprintf(esc_html__('Current Recurrence Pattern: %s', 'events-manager'), $EM_Event->get_recurrence_description()); ?></em></p>
<p><strong><?php esc_html_e( 'Modifications to event dates will cause all recurrences of this event to be deleted and recreated, previous bookings will be deleted.', 'events-manager'); ?></strong></p>
<p>
<a href="<?php echo esc_url( add_query_arg(array('scope'=>'all', 'recurrence_id'=>$EM_Event->event_id), em_get_events_admin_url()) ); ?>">
<strong><?php esc_html_e('You can edit individual recurrences and disassociate them with this recurring event.', 'events-manager'); ?></strong>
</a>
</p>
</div>
<?php endif; ?>
<div class="event-form-when-wrap <?php if( !empty($EM_Event->event_id) && empty($_REQUEST['reschedule']) ) echo 'reschedule-hidden'; ?>">
<?php _e ( 'This event repeats', 'events-manager'); ?>
<select id="recurrence-frequency" name="recurrence_freq">
<?php
$freq_options = array ("daily" => __ ( 'Daily', 'events-manager'), "weekly" => __ ( 'Weekly', 'events-manager'), "monthly" => __ ( 'Monthly', 'events-manager'), 'yearly' => __('Yearly','events-manager') );
em_option_items ( $freq_options, $EM_Event->recurrence_freq );
?>
</select>
<?php _e ( 'every', 'events-manager')?>
<input id="recurrence-interval" name='recurrence_interval' size='2' value='<?php echo $EM_Event->recurrence_interval ; ?>' />
<span class='interval-desc' id="interval-daily-singular"><?php _e ( 'day', 'events-manager')?></span>
<span class='interval-desc' id="interval-daily-plural"><?php _e ( 'days', 'events-manager') ?></span>
<span class='interval-desc' id="interval-weekly-singular"><?php _e ( 'week on', 'events-manager'); ?></span>
<span class='interval-desc' id="interval-weekly-plural"><?php _e ( 'weeks on', 'events-manager'); ?></span>
<span class='interval-desc' id="interval-monthly-singular"><?php _e ( 'month on the', 'events-manager')?></span>
<span class='interval-desc' id="interval-monthly-plural"><?php _e ( 'months on the', 'events-manager')?></span>
<span class='interval-desc' id="interval-yearly-singular"><?php _e ( 'year', 'events-manager')?></span>
<span class='interval-desc' id="interval-yearly-plural"><?php _e ( 'years', 'events-manager') ?></span>
<p class="alternate-selector" id="weekly-selector">
<?php
$saved_bydays = ($EM_Event->is_recurring() && $EM_Event->recurrence_byday != '' ) ? explode ( ",", $EM_Event->recurrence_byday ) : array();
em_checkbox_items ( 'recurrence_bydays[]', $days_names, $saved_bydays );
?>
</p>
<p class="alternate-selector" id="monthly-selector" style="display:inline;">
<select id="monthly-modifier" name="recurrence_byweekno">
<?php
$weekno_options = array ("1" => __ ( 'first', 'events-manager'), '2' => __ ( 'second', 'events-manager'), '3' => __ ( 'third', 'events-manager'), '4' => __ ( 'fourth', 'events-manager'), '5' => __ ( 'fifth', 'events-manager'), '-1' => __ ( 'last', 'events-manager') );
em_option_items ( $weekno_options, $EM_Event->recurrence_byweekno );
?>
</select>
<select id="recurrence-weekday" name="recurrence_byday">
<?php em_option_items ( $days_names, $EM_Event->recurrence_byday ); ?>
</select>
<?php _e('of each month','events-manager'); ?>
&nbsp;
</p>
<div class="event-form-recurrence-when">
<p class="em-date-range">
<?php _e ( 'Recurrences span from ', 'events-manager'); ?>
<input class="em-date-start em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_start_date" value="<?php echo $EM_Event->event_start_date ?>" />
<?php _e('to','events-manager'); ?>
<input class="em-date-end em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_end_date" value="<?php echo $EM_Event->event_end_date ?>" />
</p>
<p class="em-duration-range">
<?php echo sprintf(__('Each event spans %s day(s)','events-manager'), '<input id="end-days" type="text" size="8" maxlength="8" name="recurrence_days" value="'. $EM_Event->recurrence_days .'" />'); ?>
</p>
<p class="em-range-description"><em><?php _e( 'For a recurring event, a one day event will be created on each recurring date within this date range.', 'events-manager'); ?></em></p>
</div>
</div>
<?php if( !empty($EM_Event->event_id) ): ?>
<div class="recurrence-reschedule-buttons">
<a href="<?php echo esc_url(add_query_arg('reschedule', null)); ?>" class="button-secondary em-button em-reschedule-cancel<?php if( empty($_REQUEST['reschedule']) ) echo ' reschedule-hidden'; ?>" data-target=".event-form-when-wrap">
<?php esc_html_e('Cancel Reschedule', 'events-manager'); ?>
</a>
<a href="<?php echo esc_url(add_query_arg('reschedule', '1')); ?>" class="em-reschedule-trigger em-button button-secondary<?php if( !empty($_REQUEST['reschedule']) ) echo ' reschedule-hidden'; ?>" data-target=".event-form-when-wrap">
<?php esc_html_e('Reschedule Recurring Event', 'events-manager'); ?>
</a>
<input type="hidden" name="event_reschedule" class="em-reschedule-value" value="<?php echo empty($_REQUEST['reschedule']) ? 0:1 ?>" />
</div>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,88 @@
<?php
/* Used by the buddypress and front-end editors to display event time-related information */
global $EM_Event;
$days_names = em_get_days_names();
$hours_format = em_get_hour_format();
$admin_recurring = is_admin() && $EM_Event->is_recurring();
?>
<!-- START recurrence postbox -->
<div id="em-form-with-recurrence" class="event-form-with-recurrence event-form-when">
<p><?php _e('This is a recurring event.', 'events-manager'); ?> <input type="checkbox" id="em-recurrence-checkbox" name="recurring" value="1" <?php if($EM_Event->is_recurring()) echo 'checked' ?> /></p>
<p class="em-date-range">
<span class="em-recurring-text"><?php _e ( 'Recurrences span from ', 'events-manager'); ?></span>
<span class="em-event-text"><?php _e ( 'From ', 'events-manager'); ?></span>
<input class="em-date-start em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_start_date" value="<?php echo $EM_Event->event_start_date ?>" />
<span class="em-recurring-text"><?php _e('to','events-manager'); ?></span>
<span class="em-event-text"><?php _e('to','events-manager'); ?></span>
<input class="em-date-end em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_end_date" value="<?php echo $EM_Event->event_end_date ?>" />
</p>
<p>
<span class="em-recurring-text"><?php _e('Events start from','events-manager'); ?></span>
<span class="em-event-text"><?php _e('Event starts at','events-manager'); ?></span>
<input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="event_start_time" value="<?php echo date( $hours_format, $EM_Event->start ); ?>" />
<?php _e('to','events-manager'); ?>
<input id="end-time" class="em-time-input em-time-end" type="text" size="8" maxlength="8" name="event_end_time" value="<?php echo date( $hours_format, $EM_Event->end ); ?>" />
<?php _e('All day','events-manager'); ?> <input type="checkbox" class="em-time-allday" name="event_all_day" id="em-time-all-day" value="1" <?php if(!empty($EM_Event->event_all_day)) echo 'checked="checked"'; ?> />
</p>
<div class="em-recurring-text">
<p>
<?php _e ( 'This event repeats', 'events-manager'); ?>
<select id="recurrence-frequency" name="recurrence_freq">
<?php
$freq_options = array ("daily" => __ ( 'Daily', 'events-manager'), "weekly" => __ ( 'Weekly', 'events-manager'), "monthly" => __ ( 'Monthly', 'events-manager'), 'yearly' => __('Yearly','events-manager') );
em_option_items ( $freq_options, $EM_Event->recurrence_freq );
?>
</select>
<?php _e ( 'every', 'events-manager')?>
<input id="recurrence-interval" name='recurrence_interval' size='2' value='<?php echo $EM_Event->recurrence_interval ; ?>' />
<span class='interval-desc' id="interval-daily-singular"><?php _e ( 'day', 'events-manager')?></span>
<span class='interval-desc' id="interval-daily-plural"><?php _e ( 'days', 'events-manager') ?></span>
<span class='interval-desc' id="interval-weekly-singular"><?php _e ( 'week on', 'events-manager'); ?></span>
<span class='interval-desc' id="interval-weekly-plural"><?php _e ( 'weeks on', 'events-manager'); ?></span>
<span class='interval-desc' id="interval-monthly-singular"><?php _e ( 'month on the', 'events-manager')?></span>
<span class='interval-desc' id="interval-monthly-plural"><?php _e ( 'months on the', 'events-manager')?></span>
<span class='interval-desc' id="interval-yearly-singular"><?php _e ( 'year', 'events-manager')?></span>
<span class='interval-desc' id="interval-yearly-plural"><?php _e ( 'years', 'events-manager') ?></span>
</p>
<p class="alternate-selector" id="weekly-selector">
<?php
$saved_bydays = ($EM_Event->is_recurring()) ? explode ( ",", $EM_Event->recurrence_byday ) : array();
em_checkbox_items ( 'recurrence_bydays[]', $days_names, $saved_bydays );
?>
</p>
<p class="alternate-selector" id="monthly-selector" style="display:inline;">
<select id="monthly-modifier" name="recurrence_byweekno">
<?php
$weekno_options = array ("1" => __ ( 'first', 'events-manager'), '2' => __ ( 'second', 'events-manager'), '3' => __ ( 'third', 'events-manager'), '4' => __ ( 'fourth', 'events-manager'), '-1' => __ ( 'last', 'events-manager') );
em_option_items ( $weekno_options, $EM_Event->recurrence_byweekno );
?>
</select>
<select id="recurrence-weekday" name="recurrence_byday">
<?php em_option_items ( $days_names, $EM_Event->recurrence_byday ); ?>
</select>
<?php _e('of each month','events-manager'); ?>
</p>
<p class="em-duration-range">
<?php echo sprintf(__('Each event spans %s day(s)','events-manager'), '<input id="end-days" type="text" size="8" maxlength="8" name="recurrence_days" value="'. $EM_Event->recurrence_days .'" />'); ?>
</p>
<p class="em-range-description"><em><?php _e( 'For a recurring event, a one day event will be created on each recurring date within this date range.', 'events-manager'); ?></em></p>
</div>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function($) {
$('#em-recurrence-checkbox').change(function(){
if( $('#em-recurrence-checkbox').is(':checked') ){
$('.em-recurring-text').show();
$('.em-event-text').hide();
}else{
$('.em-recurring-text').hide();
$('.em-event-text').show();
}
});
$('#em-recurrence-checkbox').trigger('change');
});
//]]>
</script>
</div>

View File

@ -0,0 +1,28 @@
<?php
global $EM_Event, $post;
$hours_format = em_get_hour_format();
$required = apply_filters('em_required_html','<i>*</i>');
?>
<div class="event-form-when" id="em-form-when">
<p class="em-date-range">
<?php _e ( 'From ', 'events-manager'); ?>
<input class="em-date-start em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_start_date" value="<?php echo $EM_Event->event_start_date ?>" />
<?php _e('to','events-manager'); ?>
<input class="em-date-end em-date-input-loc" type="text" />
<input class="em-date-input" type="hidden" name="event_end_date" value="<?php echo $EM_Event->event_end_date ?>" />
</p>
<p class="em-time-range">
<span class="em-event-text"><?php _e('Event starts at','events-manager'); ?></span>
<input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="event_start_time" value="<?php echo date( $hours_format, $EM_Event->start ); ?>" />
<?php _e('to','events-manager'); ?>
<input id="end-time" class="em-time-input em-time-end" type="text" size="8" maxlength="8" name="event_end_time" value="<?php echo date( $hours_format, $EM_Event->end ); ?>" />
<?php _e('All day','events-manager'); ?> <input type="checkbox" class="em-time-all-day" name="event_all_day" id="em-time-all-day" value="1" <?php if(!empty($EM_Event->event_all_day)) echo 'checked="checked"'; ?> />
</p>
<span id='event-date-explanation'>
<?php _e( 'This event spans every day between the beginning and end date, with start/end times applying to each day.', 'events-manager'); ?>
</span>
</div>
<?php if( false && get_option('dbem_recurrence_enabled') && $EM_Event->is_recurrence() ) : //in future, we could enable this and then offer a detach option alongside, which resets the recurrence id and removes the attachment to the recurrence set ?>
<input type="hidden" name="recurrence_id" value="<?php echo $EM_Event->recurrence_id; ?>" />
<?php endif;

View File

@ -0,0 +1,70 @@
<?php
/* WARNING! This file may change in the near future as we intend to add features to the location editor. If at all possible, try making customizations using CSS, jQuery, or using our hooks and filters. - 2012-02-14 */
/*
* To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
* You also must keep the _wpnonce hidden field in this form too.
*/
global $EM_Location, $EM_Notices;
//check that user can access this page
if( is_object($EM_Location) && !$EM_Location->can_manage('edit_locations','edit_others_locations') ){
?>
<div class="wrap"><h2><?php esc_html_e('Unauthorized Access','events-manager'); ?></h2><p><?php echo sprintf(__('You do not have the rights to manage this %s.','events-manager'),__('location','events-manager')); ?></p></div>
<?php
return false;
}elseif( !is_object($EM_Location) ){
$EM_Location = new EM_Location();
}
if(!is_admin()) echo $EM_Notices;
?>
<form enctype='multipart/form-data' id='location-form' method='post' action='<?php echo esc_url(add_query_arg(array('success'=>null))); ?>'>
<input type='hidden' name='action' value='location_save' />
<input type='hidden' name='_wpnonce' value='<?php echo wp_create_nonce('location_save'); ?>' />
<input type='hidden' name='location_id' value='<?php echo $EM_Location->location_id ?>'/>
<?php do_action('em_front_location_form_header'); ?>
<h3 class="location-form-name"><?php esc_html_e( 'Location Name', 'events-manager'); ?></h3>
<div class="inside location-form-name">
<input name='location_name' id='location-name' type='text' value='<?php echo esc_attr($EM_Location->location_name, ENT_QUOTES); ?>' size='40' />
<br />
<?php esc_html_e('The name of the location', 'events-manager') ?>
</div>
<h3 class="location-form-where"><?php esc_html_e( 'Location', 'events-manager'); ?></h3>
<div class="inside location-form-where">
<?php em_locate_template('forms/location/where.php','events-manager'); ?>
</div>
<h3 class="location-form-details"><?php esc_html_e( 'Details', 'events-manager'); ?></h3>
<div class="inside location-form-details">
<?php if( get_option('dbem_events_form_editor') && function_exists('wp_editor') ): ?>
<?php wp_editor($EM_Location->post_content, 'em-editor-content', array('textarea_name'=>'content') ); ?>
<?php else: ?>
<textarea name="content" rows="10" style="width:100%"><?php echo $EM_Location->post_content; ?></textarea>
<br />
<?php esc_html_e( 'Details about the location.', 'events-manager')?> <?php esc_html_e( 'HTML Allowed.', 'events-manager')?>
<?php endif; ?>
</div>
<?php if(get_option('dbem_location_attributes_enabled')){ em_locate_template('forms/location/attributes-public.php',true); } ?>
<?php if( $EM_Location->can_manage('upload_event_images','upload_event_images') ): ?>
<h3 class="location-form-image"><?php esc_html_e( 'Location Image', 'events-manager'); ?></h3>
<div class="inside location-form-image" style="padding:10px;">
<?php em_locate_template('forms/location/featured-image-public.php',true); ?>
</div>
<?php endif; ?>
<?php do_action('em_front_location_form_footer'); ?>
<?php if( !empty($_REQUEST['redirect_to']) ): ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($_REQUEST['redirect_to']); ?>" />
<?php endif; ?>
<p class='submit'>
<?php if( empty($EM_Location->location_id) ): ?>
<input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Submit %s','events-manager'), __('Location','events-manager') )); ?>' />
<?php else: ?>
<input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Update %s','events-manager'), __('Location','events-manager') )); ?>' />
<?php endif; ?>
</p>
</form>

View File

@ -0,0 +1,30 @@
<?php
/*
* This file is called by templates/forms/location-editor.php to display attribute fields on your location form on your website.
* You can override this file by copying it to /wp-content/themes/yourtheme/plugins/events-manager/forms/location/ and editing it there.
*/
global $EM_Location;
/* @var $EM_Location EM_Location */
$attributes = em_get_attributes(true); //lattributes only
$has_deprecated = false;
?>
<?php if( count( $attributes['names'] ) > 0 ) : ?>
<?php foreach( $attributes['names'] as $name) : ?>
<div class="location-attributes">
<label for="em_attributes[<?php echo $name ?>]"><?php echo $name ?></label>
<?php if( count($attributes['values'][$name]) > 1 ): ?>
<select name="em_attributes[<?php echo $name ?>]">
<?php foreach($attributes['values'][$name] as $attribute_val): ?>
<?php if( is_array($EM_Location->location_attributes) && array_key_exists($name, $EM_Location->location_attributes) && $EM_Location->location_attributes[$name]==$attribute_val ): ?>
<option selected="selected"><?php echo $attribute_val; ?></option>
<?php else: ?>
<option><?php echo $attribute_val; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php else: ?>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Location->location_attributes) ? esc_attr($EM_Location->location_attributes[$name], ENT_QUOTES):''; ?>" />
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -0,0 +1,89 @@
<?php
global $EM_Location;
$attributes = em_get_attributes(true); //get Lattributes
$has_deprecated = false;
?>
<div id="location-attributes">
<?php if( !empty($attributes['names']) && count( $attributes['names'] ) > 0 ) : ?>
<table class="form-table">
<thead>
<tr valign="top">
<td><strong>Attribute Name</strong></td>
<td><strong>Value</strong></td>
</tr>
</thead>
<tbody id="mtm_body">
<?php
$count = 1;
foreach( $attributes['names'] as $name){
?>
<tr valign="top" id="em_attribute_<?php echo $count ?>">
<td scope="row"><?php echo $name ?></td>
<td>
<?php if( count($attributes['values'][$name]) > 1 ): ?>
<select name="em_attributes[<?php echo $name ?>]">
<?php foreach($attributes['values'][$name] as $attribute_val): ?>
<?php if( array_key_exists($name, $EM_Location->location_attributes) && $EM_Location->location_attributes[$name]==$attribute_val ): ?>
<option selected="selected"><?php echo $attribute_val; ?></option>
<?php else: ?>
<option><?php echo $attribute_val; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php else: ?>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Location->location_attributes) ? esc_attr($EM_Location->location_attributes[$name], ENT_QUOTES):''; ?>" />
<?php endif; ?>
</td>
</tr>
<?php
$count++;
}
if($count == 1){
?>
<tr><td colspan="2"><?php echo sprintf(__("You don't have any custom attributes defined in any of your Locations Manager template settings. Please add them the <a href='%s'>settings page</a>",'events-manager'),EM_ADMIN_URL ."&amp;page=locations-manager-options"); ?></td></tr>
<?php
}
?>
</tbody>
</table>
<?php if( count(array_diff(array_keys($EM_Location->location_attributes), $attributes['names'])) > 0 ): ?>
<p><strong><?php _e('Deprecated Attributes', 'events-manager')?></strong></p>
<p><em><?php _e("If you see any attributes under here, that means they're not used in Locations Manager formats. To add them, you need to add the custom attribute again to a formatting option in the settings page. To remove any of these deprecated attributes, give it a blank value and save.",'events-manager') ?></em></p>
<table class="form-table">
<thead>
<tr valign="top">
<td><strong>Attribute Name</strong></td>
<td><strong>Value</strong></td>
</tr>
</thead>
<tbody id="mtm_body">
<?php
if( is_array($EM_Location->location_attributes) and count($EM_Location->location_attributes) > 0){
foreach( $EM_Location->location_attributes as $name => $value){
if( is_array($value) ) $value = serialize($value);
if( !in_array($name, $attributes['names']) ){
?>
<tr valign="top" id="em_attribute_<?php echo $count ?>">
<td scope="row"><?php echo $name ?></td>
<td>
<input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo esc_attr($value, ENT_QUOTES); ?>" />
</td>
</tr>
<?php
$count++;
}
}
}
?>
</tbody>
</table>
<?php endif; ?>
<?php else : ?>
<p>
<?php _e('In order to use attributes, you must define some in your templates, otherwise they\'ll never show. Go to Events > Settings > General to add attribute placeholders.', 'events-manager'); ?>
</p>
<script>
jQuery(document).ready(function($){ $('#location_attributes').addClass('closed'); });
</script>
<?php endif; ?>
</div>

View File

@ -0,0 +1,20 @@
<?php
/*
* This file is called by templates/forms/location-editor.php to display fields for uploading images on your location form on your website. This does not affect the admin featured image section.
* You can override this file by copying it to /wp-content/themes/yourtheme/plugins/events-manager/forms/location/ and editing it there.
*/
global $EM_Location;
/* @var $EM_Location EM_Location */
?>
<p id="location-image-img">
<?php if ($EM_Location->get_image_url() != '') : ?>
<img src='<?php echo $EM_Location->get_image_url('medium'); ?>' alt='<?php echo $EM_Location->location_name ?>'/>
<?php else : ?>
<?php _e('No image uploaded for this location yet', 'events-manager') ?>
<?php endif; ?>
</p>
<label for='location_image'><?php _e('Upload/change picture', 'events-manager') ?></label> <input id='location-image' name='location_image' id='location_image' type='file' size='40' />
<br />
<?php if ($EM_Location->get_image_url() != '') : ?>
<label for='location_image_delete'><?php _e('Delete Image?', 'events-manager') ?></label> <input id='location-image-delete' name='location_image_delete' id='location_image_delete' type='checkbox' value='1' />
<?php endif; ?>

View File

@ -0,0 +1,58 @@
<?php
global $EM_Location, $post;
$required = apply_filters('em_required_html','<i>*</i>');
?>
<?php if ( get_option( 'dbem_gmap_is_active' ) ): ?>
<p class="em-location-data-maps-tip"><?php _e("If you're using the Google Maps, the more detail you provide, the more accurate Google can be at finding your location. If your address isn't being found, please <a href='http://maps.google.com'>try it on maps.google.com</a> by adding all the fields below separated by commas.",'events-manager')?></p>
<?php endif; ?>
<div id="em-location-data" class="em-location-data">
<table class="em-location-data">
<tr class="em-location-data-address">
<th><?php _e ( 'Address:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-address" type="text" name="location_address" value="<?php echo esc_attr($EM_Location->location_address, ENT_QUOTES); ; ?>" /> <?php echo $required; ?>
</td>
</tr>
<tr class="em-location-data-town">
<th><?php _e ( 'City/Town:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-town" type="text" name="location_town" value="<?php echo esc_attr($EM_Location->location_town, ENT_QUOTES); ?>" /> <?php echo $required; ?>
</td>
</tr>
<tr class="em-location-data-state">
<th><?php _e ( 'State/County:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-state" type="text" name="location_state" value="<?php echo esc_attr($EM_Location->location_state, ENT_QUOTES); ?>" />
</td>
</tr>
<tr class="em-location-data-postcode">
<th><?php _e ( 'Postcode:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-postcode" type="text" name="location_postcode" value="<?php echo esc_attr($EM_Location->location_postcode, ENT_QUOTES); ?>" />
</td>
</tr>
<tr class="em-location-data-region">
<th><?php _e ( 'Region:', 'events-manager')?>&nbsp;</th>
<td>
<input id="location-region" type="text" name="location_region" value="<?php echo esc_attr($EM_Location->location_region, ENT_QUOTES); ?>" />
<input id="location-region-wpnonce" type="hidden" value="<?php echo wp_create_nonce('search_regions'); ?>" />
</td>
</tr>
<tr class="em-location-data-country">
<th><?php _e ( 'Country:', 'events-manager')?>&nbsp;</th>
<td>
<select id="location-country" name="location_country">
<?php foreach(em_get_countries(__('none selected','events-manager')) as $country_key => $country_name): ?>
<option value="<?php echo $country_key; ?>" <?php echo ( $EM_Location->location_country === $country_key || ($EM_Location->location_country == '' && $EM_Location->location_id == '' && get_option('dbem_location_default_country')==$country_key) ) ? 'selected="selected"':''; ?>><?php echo $country_name; ?></option>
<?php endforeach; ?>
</select> <?php echo $required; ?>
</td>
</tr>
</table>
<?php if ( get_option( 'dbem_gmap_is_active' ) ) em_locate_template('forms/map-container.php',true); ?>
<br style="clear:both; " />
<div id="location_coordinates" style='display: none;'>
<input id='location-latitude' name='location_latitude' type='text' value='<?php echo $EM_Location->location_latitude; ?>' size='15' />
<input id='location-longitude' name='location_longitude' type='text' value='<?php echo $EM_Location->location_longitude; ?>' size='15' />
</div>
</div>

View File

@ -0,0 +1,6 @@
<div class="em-location-map-container">
<div id='em-map-404' class="em-location-map-404">
<p><em><?php _e ( 'Location not found', 'events-manager'); ?></em></p>
</div>
<div id='em-map' class="em-location-map-content" style='display: none;'></div>
</div>

View File

@ -0,0 +1,13 @@
This folder contains specific forms used throughout EM.
CAREFUL!! If you do override these files, make sure you keep form IDs, actions, filters and other php code of that nature.
Doing this could prevent the form from working properly.
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/forms/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,3 @@
<?php
//DEPRECATED, MODIFY THE INCLUDED TEMPLATE INSTEAD
em_locate_template('forms/event/bookings-ticket-form.php', true);

View File

@ -0,0 +1,2 @@
<?php
//DEPRECATED, now only using event/bookings-ticket-form.php

View File

@ -0,0 +1,20 @@
<?php
/* @var $EM_Event EM_Event */
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
?>
<ul class="event-attendees">
<?php
foreach( $EM_Bookings as $EM_Booking){ /* @var $EM_Booking EM_Booking */
if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
$people[] = $EM_Booking->get_person()->ID;
echo '<li>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</li>';
}elseif($EM_Booking->booking_status == 1 && $EM_Booking->is_no_user() ){
echo '<li>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</li>';
}
}
?>
</ul>
<?php
}

View File

@ -0,0 +1,20 @@
<?php
/* @var $EM_Event EM_Event */
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
?>
<ul class="event-attendees">
<?php
foreach( $EM_Bookings as $EM_Booking){ /* @var $EM_Booking EM_Booking */
if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
$people[] = $EM_Booking->get_person()->ID;
echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
}elseif($EM_Booking->booking_status == 1 && $EM_Booking->is_no_user() ){
echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
}
}
?>
</ul>
<?php
}

View File

@ -0,0 +1,20 @@
<?php
/* @var $EM_Event EM_Event */
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
?>
<ul class="event-attendees">
<?php
foreach( $EM_Bookings as $EM_Booking){ /* @var $EM_Booking EM_Booking */
if( $EM_Booking->is_pending() && !in_array($EM_Booking->get_person()->ID, $people) ){
$people[] = $EM_Booking->get_person()->ID;
echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
}elseif( $EM_Booking->is_pending() && $EM_Booking->is_no_user() ){
echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
}
}
?>
</ul>
<?php
}

View File

@ -0,0 +1,34 @@
<?php
/*
* You can override this by copying this file to wp-content/themesyourthemefolder/plugins/events-manager/placeholders/ and modifying it however you need.
* There are a few variables made available to you:
*
* $EM_Event - EM_Event object
*/
$notice_full = get_option('dbem_booking_button_msg_full');
$button_text = get_option('dbem_booking_button_msg_book');
$button_already_booked = get_option('dbem_booking_button_msg_already_booked');
$button_closed = get_option('dbem_booking_button_msg_closed');
$button_cancel = get_option('dbem_booking_button_msg_cancel');
/* @var $EM_Event EM_Event */
?>
<?php
if( is_user_logged_in() ){ //only show this to logged in users
ob_start();
$EM_Booking = $EM_Event->get_bookings()->has_booking();
if( is_object($EM_Booking) && $EM_Booking->booking_status != 3 && get_option('dbem_bookings_user_cancellation') ){
?><a id="em-cancel-button_<?php echo $EM_Booking->booking_id; ?>_<?php echo wp_create_nonce('booking_cancel'); ?>" class="button em-cancel-button" href="#"><?php echo $button_cancel; ?></a><?php
}elseif( $EM_Event->get_bookings()->is_open() ){
if( !is_object($EM_Booking) ){
?><a id="em-booking-button_<?php echo $EM_Event->event_id; ?>_<?php echo wp_create_nonce('booking_add_one'); ?>" class="button em-booking-button" href="#"><?php echo $button_text; ?></a><?php
}else{
?><span class="em-booked-button"><?php echo $button_already_booked ?></span><?php
}
}elseif( $EM_Event->get_bookings()->get_available_spaces() <= 0 ){
?><span class="em-full-button"><?php echo $notice_full ?></span><?php
}else{
?><span class="em-closed-button"><?php echo $button_closed ?></span><?php
}
echo apply_filters( 'em_booking_button', ob_get_clean(), $EM_Event );
};
?>

View File

@ -0,0 +1,108 @@
<?php
/*
* This is where the booking form is generated.
* For non-advanced users, It's SERIOUSLY NOT recommended you edit this form directly if avoidable, as you can change booking form settings in various less obtrusive and upgrade-safe ways:
* - check your booking form options panel in the Booking Options tab in your settings.
* - use CSS or jQuery to change the look of your booking forms
* - edit the files in the forms/bookingform folder individually instead of this file, to make it more upgrade-safe
* - hook into WP action/filters below to modify/generate information
* Again, even if you're an advanced user, consider NOT editing this form and using other methods instead.
*/
/* @var $EM_Event EM_Event */
global $EM_Notices;
//count tickets and available tickets
$tickets_count = count($EM_Event->get_bookings()->get_tickets()->tickets);
$available_tickets_count = count($EM_Event->get_bookings()->get_available_tickets());
//decide whether user can book, event is open for bookings etc.
$can_book = is_user_logged_in() || (get_option('dbem_bookings_anonymous') && !is_user_logged_in());
$is_open = $EM_Event->get_bookings()->is_open(); //whether there are any available tickets right now
$show_tickets = true;
//if user is logged out, check for member tickets that might be available, since we should ask them to log in instead of saying 'bookings closed'
if( !$is_open && !is_user_logged_in() && $EM_Event->get_bookings()->is_open(true) ){
$is_open = true;
$can_book = false;
$show_tickets = get_option('dbem_bookings_tickets_show_unavailable') && get_option('dbem_bookings_tickets_show_member_tickets');
}
?>
<div id="em-booking" class="em-booking <?php if( get_option('dbem_css_rsvp') ) echo 'css-booking'; ?>">
<?php
// We are firstly checking if the user has already booked a ticket at this event, if so offer a link to view their bookings.
$EM_Booking = $EM_Event->get_bookings()->has_booking();
?>
<?php if( is_object($EM_Booking) && !get_option('dbem_bookings_double') ): //Double bookings not allowed ?>
<p>
<?php echo get_option('dbem_bookings_form_msg_attending'); ?>
<a href="<?php echo em_get_my_bookings_url(); ?>"><?php echo get_option('dbem_bookings_form_msg_bookings_link'); ?></a>
</p>
<?php elseif( !$EM_Event->event_rsvp ): //bookings not enabled ?>
<p><?php echo get_option('dbem_bookings_form_msg_disabled'); ?></p>
<?php elseif( $EM_Event->get_bookings()->get_available_spaces() <= 0 ): ?>
<p><?php echo get_option('dbem_bookings_form_msg_full'); ?></p>
<?php elseif( !$is_open ): //event has started ?>
<p><?php echo get_option('dbem_bookings_form_msg_closed'); ?></p>
<?php else: ?>
<?php echo $EM_Notices; ?>
<?php if( $tickets_count > 0) : ?>
<?php //Tickets exist, so we show a booking form. ?>
<form class="em-booking-form" name='booking-form' method='post' action='<?php echo apply_filters('em_booking_form_action_url',''); ?>#em-booking'>
<input type='hidden' name='action' value='booking_add'/>
<input type='hidden' name='event_id' value='<?php echo $EM_Event->get_bookings()->event_id; ?>'/>
<input type='hidden' name='_wpnonce' value='<?php echo wp_create_nonce('booking_add'); ?>'/>
<?php
// Tickets Form
if( $show_tickets && ($can_book || get_option('dbem_bookings_tickets_show_loggedout')) && ($tickets_count > 1 || get_option('dbem_bookings_tickets_single_form')) ){ //show if more than 1 ticket, or if in forced ticket list view mode
do_action('em_booking_form_before_tickets', $EM_Event); //do not delete
//Show multiple tickets form to user, or single ticket list if settings enable this
//If logged out, can be allowed to see this in settings witout the register form
em_locate_template('forms/bookingform/tickets-list.php',true, array('EM_Event'=>$EM_Event));
do_action('em_booking_form_after_tickets', $EM_Event); //do not delete
$show_tickets = false;
}
?>
<?php if( $can_book ): ?>
<div class='em-booking-form-details'>
<?php
if( $show_tickets && $available_tickets_count == 1 && !get_option('dbem_bookings_tickets_single_form') ){
do_action('em_booking_form_before_tickets', $EM_Event); //do not delete
//show single ticket form, only necessary to show to users able to book (or guests if enabled)
$EM_Ticket = $EM_Event->get_bookings()->get_available_tickets()->get_first();
em_locate_template('forms/bookingform/ticket-single.php',true, array('EM_Event'=>$EM_Event, 'EM_Ticket'=>$EM_Ticket));
do_action('em_booking_form_after_tickets', $EM_Event); //do not delete
}
?>
<?php
do_action('em_booking_form_before_user_details', $EM_Event);
if( has_action('em_booking_form_custom') ){
//Pro Custom Booking Form. You can create your own custom form by hooking into this action and setting the option above to true
do_action('em_booking_form_custom', $EM_Event); //do not delete
}else{
//If you just want to modify booking form fields, you could do so here
em_locate_template('forms/bookingform/booking-fields.php',true, array('EM_Event'=>$EM_Event));
}
do_action('em_booking_form_after_user_details', $EM_Event);
?>
<?php do_action('em_booking_form_footer', $EM_Event); //do not delete ?>
<div class="em-booking-buttons">
<?php if( preg_match('/https?:\/\//',get_option('dbem_bookings_submit_button')) ): //Settings have an image url (we assume). Use it here as the button.?>
<input type="image" src="<?php echo get_option('dbem_bookings_submit_button'); ?>" class="em-booking-submit" id="em-booking-submit" />
<?php else: //Display normal submit button ?>
<input type="submit" class="em-booking-submit" id="em-booking-submit" value="<?php echo esc_attr(get_option('dbem_bookings_submit_button')); ?>" />
<?php endif; ?>
</div>
<?php do_action('em_booking_form_footer_after_buttons', $EM_Event); //do not delete ?>
</div>
<?php else: ?>
<p class="em-booking-form-details"><?php echo get_option('dbem_booking_feedback_log_in'); ?></p>
<?php endif; ?>
</form>
<?php
if( !is_user_logged_in() && get_option('dbem_bookings_login_form') ){
//User is not logged in, show login form (enabled on settings page)
em_locate_template('forms/bookingform/login.php',true, array('EM_Event'=>$EM_Event));
}
?>
<br class="clear" style="clear:left;" />
<?php endif; ?>
<?php endif; ?>
</div>

View File

@ -0,0 +1,14 @@
<?php
/* @var $EM_Event EM_Event */
$count_cats = count($EM_Event->get_categories()->categories) > 0;
if( $count_cats > 0 ){
?>
<ul class="event-categories">
<?php foreach($EM_Event->get_categories() as $EM_Category): ?>
<li><?php echo $EM_Category->output("#_CATEGORYLINK"); ?></li>
<?php endforeach; ?>
</ul>
<?php
}else{
echo get_option ( 'dbem_no_categories_message' );
}

View File

@ -0,0 +1,20 @@
<?php
/* @var $EM_Event EM_Event */
$count_cats = count($EM_Event->get_categories()->categories) > 0;
if( $count_cats > 0 ){
$one_image = false;
?>
<ul class="event-categories-images">
<?php foreach($EM_Event->get_categories() as $EM_Category): /* @var $EM_Category EM_Category */ ?>
<?php if( $EM_Category->get_image_url() != '' ): ?>
<li><?php echo $EM_Category->output('<a href="#_CATEGORYURL" title="#_CATEGORYNAME">#_CATEGORYIMAGE</a>'); $one_image = true; ?></li>
<?php endif; ?>
<?php endforeach; ?>
<?php if (!$one_image): ?>
<li><?php echo get_option ( 'dbem_no_categories_message' ); ?></li>
<?php endif; ?>
</ul>
<?php
}else{
echo get_option ( 'dbem_no_categories_message' );
}

View File

@ -0,0 +1,12 @@
<?php
/* @var $EM_Event EM_Event */
$tags = get_the_terms($EM_Event->post_id, EM_TAXONOMY_TAG);
if( is_array($tags) && count($tags) > 0 ){
$tags_list = array();
foreach($tags as $tag){
$link = get_term_link($tag->slug, EM_TAXONOMY_TAG);
if ( is_wp_error($link) ) $link = '';
$tags_list[] = '<a href="'. $link .'">'. $tag->name .'</a>';
}
echo implode(', ', $tags_list);
}

View File

@ -0,0 +1,36 @@
<?php
/*
* This file contains the HTML generated for a single location Google map. You can copy this file to yourthemefolder/plugins/events/templates and modify it in an upgrade-safe manner.
*
* There is one argument passed to you, which is the $args variable. This contains the arguments you could pass into shortcodes, template tags or functions like EM_Events::get().
*
* In this template, we encode the $args array into JSON for javascript to easily parse and request the locations from the server via AJAX.
*/
/* @var $EM_Location EM_Location */
if ( get_option('dbem_gmap_is_active') && ( is_object($EM_Location) && $EM_Location->location_latitude != 0 && $EM_Location->location_longitude != 0 ) ) {
//get dimensions with px or % added in
$width = (!empty($args['width'])) ? $args['width']:get_option('dbem_map_default_width','400px');
$width = preg_match('/(px)|%/', $width) ? $width:$width.'px';
$height = (!empty($args['height'])) ? $args['height']:get_option('dbem_map_default_height','300px');
$height = preg_match('/(px)|%/', $height) ? $height:$height.'px';
//assign random number for element id reference
$rand = substr(md5(rand().rand()),0,5);
?>
<div class="em-location-map-container" style='position:relative; background: #CDCDCD; width: <?php echo $width ?>; height: <?php echo $height ?>;'>
<div class='em-location-map' id='em-location-map-<?php echo $rand ?>' style="width: 100%; height: 100%;">
<?php _e('Loading Map....', 'events-manager'); ?>
</div>
</div>
<div class='em-location-map-info' id='em-location-map-info-<?php echo $rand ?>' style="display:none; visibility:hidden;">
<div class="em-map-balloon" style="font-size:12px;">
<div class="em-map-balloon-content" ><?php echo $EM_Location->output(get_option('dbem_location_baloon_format')); ?></div>
</div>
</div>
<div class='em-location-map-coords' id='em-location-map-coords-<?php echo $rand ?>' style="display:none; visibility:hidden;">
<span class="lat"><?php echo $EM_Location->location_latitude; ?></span>
<span class="lng"><?php echo $EM_Location->location_longitude; ?></span>
</div>
<?php
}elseif( is_object($EM_Location) && $EM_Location->location_latitude == 0 && $EM_Location->location_longitude == 0 ){
echo '<i>'. __('Map Unavailable', 'events-manager') .'</i>';
}

View File

@ -0,0 +1,12 @@
This folder has files containing some of the more complex placeholders output information.
Files in this folder are loaded automatically by the corresponding object and make certain variables available to them (see individual files for examples).
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/placeholders/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,16 @@
This folder has files containing various templates which events manager uses to output its information.
Almost every aspect of the public interface (and some parts of the admin interface!) can be modified. Please individual folders for more information
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to "wp-content/themes/yourtheme/plugins/events-manager/filepath within this folder/" and edit as needed.
For example:
copy templates/events-single.php
to wp-content/themes/yourtheme/plugins/events-manager/templates/events-single.php
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,180 @@
<?php
//TODO Simplify panel for events, use form flags to detect certain actions (e.g. submitted, etc)
global $wpdb, $bp, $EM_Notices;
/* @var $args array */
/* @var $EM_Events array */
/* @var $events_count int */
/* @var $future_count int */
/* @var $past_count int */
/* @var $pending_count int */
/* @var $url string */
/* @var $show_add_new bool */
/* @var $limit int */
//add new button will only appear if called from em_event_admin template tag, or if the $show_add_new var is set
?>
<div class="em-events-admin-list">
<?php
echo $EM_Notices;
if(!empty($show_add_new) && current_user_can('edit_events')) echo '<a class="em-button button add-new-h2" href="'.em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null)).'">'.__('Add New','events-manager').'</a>';
?>
<form id="posts-filter" action="" method="get">
<div class="subsubsub">
<?php $default_params = array('scope'=>null,'status'=>null,'em_search'=>null,'pno'=>null); //template for cleaning the link for each view below ?>
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], $default_params + array('view'=>'future')); ?>' <?php echo ( !isset($_GET['view']) ) ? 'class="current"':''; ?>><?php _e ( 'Upcoming', 'events-manager'); ?> <span class="count">(<?php echo $future_count; ?>)</span></a> &nbsp;|&nbsp;
<?php if( $pending_count > 0 ): ?>
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], $default_params + array('view'=>'pending')); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'pending' ) ? 'class="current"':''; ?>><?php _e ( 'Pending', 'events-manager'); ?> <span class="count">(<?php echo $pending_count; ?>)</span></a> &nbsp;|&nbsp;
<?php endif; ?>
<?php if( $draft_count > 0 ): ?>
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], $default_params + array('view'=>'draft')); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'draft' ) ? 'class="current"':''; ?>><?php _e ( 'Draft', 'events-manager'); ?> <span class="count">(<?php echo $draft_count; ?>)</span></a> &nbsp;|&nbsp;
<?php endif; ?>
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], $default_params + array('view'=>'past')); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'past' ) ? 'class="current"':''; ?>><?php _e ( 'Past Events', 'events-manager'); ?> <span class="count">(<?php echo $past_count; ?>)</span></a>
</div>
<p class="search-box">
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Events','events-manager'); ?>:</label>
<input type="text" id="post-search-input" name="em_search" value="<?php echo (!empty($_REQUEST['em_search'])) ? esc_attr($_REQUEST['em_search']):''; ?>" />
<?php if( !empty($_REQUEST['view']) ): ?>
<input type="hidden" name="view" value="<?php echo esc_attr($_REQUEST['view']); ?>" />
<?php endif; ?>
<input type="submit" value="<?php _e('Search Events','events-manager'); ?>" class="button" />
</p>
<div class="tablenav">
<?php
if ( $events_count >= $limit ) {
$events_nav = em_admin_paginate( $events_count, $limit, $page);
echo $events_nav;
}
?>
<br class="clear" />
</div>
<?php
if ( empty($EM_Events) ) {
echo get_option ( 'dbem_no_events_message' );
} else {
?>
<table class="widefat events-table">
<thead>
<tr>
<?php /*
<th class='manage-column column-cb check-column' scope='col'>
<input class='select-all' type="checkbox" value='1' />
</th>
*/ ?>
<th><?php _e ( 'Name', 'events-manager'); ?></th>
<th>&nbsp;</th>
<th><?php _e ( 'Location', 'events-manager'); ?></th>
<th colspan="2"><?php _e ( 'Date and time', 'events-manager'); ?></th>
</tr>
</thead>
<tbody>
<?php
$rowno = 0;
foreach ( $EM_Events as $EM_Event ) {
/* @var $EM_Event EM_Event */
$rowno++;
$class = ($rowno % 2) ? 'alternate' : '';
// FIXME set to american
$localised_start_date = date_i18n(get_option('dbem_date_format'), $EM_Event->start);
$localised_end_date = date_i18n(get_option('dbem_date_format'), $EM_Event->end);
$style = "";
$today = current_time('timestamp');
$location_summary = "<b>" . esc_html($EM_Event->get_location()->location_name) . "</b><br/>" . esc_html($EM_Event->get_location()->location_address) . " - " . esc_html($EM_Event->get_location()->location_town);
if ($EM_Event->start < $today && $EM_Event->end < $today){
$class .= " past";
}
//Check pending approval events
if ( !$EM_Event->get_status() ){
$class .= " pending";
}
?>
<tr class="event <?php echo trim($class); ?>" <?php echo $style; ?> id="event_<?php echo $EM_Event->event_id ?>">
<?php /*
<td>
<input type='checkbox' class='row-selector' value='<?php echo $EM_Event->event_id; ?>' name='events[]' />
</td>
*/ ?>
<td>
<strong>
<?php echo esc_html($EM_Event->event_name); ?>
<!--<a class="row-title" href="<?php echo esc_url($EM_Event->get_edit_url()); ?>"><?php echo esc_html($EM_Event->event_name); ?></a>-->
</strong>
<?php
if( get_option('dbem_rsvp_enabled') == 1 && $EM_Event->event_rsvp == 1 ){
?>
<br/>
<a href="<?php echo $EM_Event->get_bookings_url(); ?>"><?php esc_html_e("Bookings",'events-manager'); ?></a> &ndash;
<?php esc_html_e("Booked",'events-manager'); ?>: <?php echo $EM_Event->get_bookings()->get_booked_spaces()."/".$EM_Event->get_spaces(); ?>
<?php if( get_option('dbem_bookings_approval') == 1 ): ?>
| <?php _e("Pending",'events-manager') ?>: <?php echo $EM_Event->get_bookings()->get_pending_spaces(); ?>
<?php endif;
}
?>
<div class="row-actions">
<?php if( current_user_can('delete_events')) : ?>
<span class="trash"><a href="<?php echo esc_url(add_query_arg(array('action'=>'event_delete', 'event_id'=>$EM_Event->event_id, '_wpnonce'=> wp_create_nonce('event_delete_'.$EM_Event->event_id)))); ?>" class="em-event-delete"><?php _e('Delete','events-manager'); ?></a></span>
<?php endif; ?>
</div>
</td>
<td>
<a href="<?php echo $EM_Event->duplicate_url(); ?>" title="<?php _e ( 'Duplicate this event', 'events-manager'); ?>">
<strong>+</strong>
</a>
</td>
<td>
<?php echo $location_summary; ?>
</td>
<td>
<?php echo $localised_start_date; ?>
<?php echo ($localised_end_date != $localised_start_date) ? " - $localised_end_date":'' ?>
<br />
<?php
if(!$EM_Event->event_all_day){
echo date_i18n(get_option('time_format'), $EM_Event->start) . " - " . date_i18n(get_option('time_format'), $EM_Event->end);
}else{
echo get_option('dbem_event_all_day_message');
}
?>
</td>
<td>
<?php
if ( $EM_Event->is_recurrence() ) {
$recurrence_delete_confirm = __('WARNING! You will delete ALL recurrences of this event, including booking history associated with any event in this recurrence. To keep booking information, go to the relevant single event and save it to detach it from this recurrence series.','events-manager');
?>
<strong>
<?php echo $EM_Event->get_recurrence_description(); ?> <br />
<a href="<?php echo esc_url($EM_Event->get_edit_reschedule_url()); ?>"><?php _e ( 'Edit Recurring Events', 'events-manager'); ?></a>
<?php if( current_user_can('delete_events')) : ?>
<span class="trash"><a href="<?php echo esc_url(add_query_arg(array('action'=>'event_delete', 'event_id'=>$EM_Event->recurrence_id, '_wpnonce'=> wp_create_nonce('event_delete_'.$EM_Event->recurrence_id)))); ?>" class="em-event-rec-delete" onclick ="if( !confirm('<?php echo $recurrence_delete_confirm; ?>') ){ return false; }"><?php _e('Delete','events-manager'); ?></a></span>
<?php endif; ?>
</strong>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} // end of table
?>
<div class='tablenav'>
<div class="alignleft actions">
<br class='clear' />
</div>
<?php if ( $events_count >= $limit ) : ?>
<div class="tablenav-pages">
<?php
echo $events_nav;
?>
</div>
<?php endif; ?>
<br class='clear' />
</div>
</form>
</div>

View File

@ -0,0 +1,94 @@
<?php
global $wpdb, $EM_Notices;
//add new button will only appear if called from em_location_admin template tag, or if the $show_add_new var is set
if(!empty($show_add_new) && current_user_can('edit_locations')) echo '<a class="em-button button add-new-h2" href="'.em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'location_id'=>null)).'">'.__('Add New','events-manager').'</a>';
?>
<div class="em-locations-admin-list">
<?php if(!is_admin()) echo $EM_Notices; ?>
<form id='locations-filter' method='post' action=''>
<input type='hidden' name='pno' value='<?php echo esc_attr($page) ?>' />
<div class="subsubsub">
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], array('view'=>null, 'pno'=>null)); ?>' <?php echo ( empty($_REQUEST['view']) ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'My %s', 'events-manager'), __('Locations','events-manager')); ?> <span class="count">(<?php echo $locations_mine_count; ?>)</span></a>
<?php if( current_user_can('read_others_locations') ): ?>
&nbsp;|&nbsp;
<a href='<?php echo em_add_get_params($_SERVER['REQUEST_URI'], array('view'=>'others', 'pno'=>null)); ?>' <?php echo ( !empty($_REQUEST['view']) && $_REQUEST['view'] == 'others' ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'All %s', 'events-manager'), __('Locations','events-manager')); ?><span class="count">(<?php echo $locations_all_count; ?>)</span></a>
<?php endif; ?>
</div>
<?php if ( $locations_count > 0 ) : ?>
<div class='tablenav'>
<?php if( (empty($_REQUEST['view']) && current_user_can('delete_events')) || (!empty($_REQUEST['view']) && $_REQUEST['view'] == 'others' && current_user_can('delete_others_events')) ): ?>
<div class="alignleft actions">
<select name="action">
<option value="" selected="selected"><?php _e ( 'Bulk Actions', 'events-manager'); ?></option>
<?php if( empty($_REQUEST['view']) && current_user_can('delete_events') ) : ?>
<option value="location_delete"><?php _e ( 'Delete selected','events-manager'); ?></option>
<?php endif; ?>
</select>
<input type="submit" value="<?php _e ( 'Apply' ); ?>" id="doaction2" class="button-secondary action" />
</div>
<?php else: $hide_checkboxes = true; /* @todo this and the first condition of this if statement will need to change when other bulk actions are added */ ?>
<?php endif; ?>
<?php
if ( $locations_count >= $limit ) {
$locations_nav = em_admin_paginate( $locations_count, $limit, $page );
echo $locations_nav;
}
?>
</div>
<table class='widefat'>
<thead>
<tr>
<?php if(empty($hide_checkboxes)): ?>
<th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>
<?php endif; ?>
<th><?php _e('Name', 'events-manager') ?></th>
<th><?php _e('Address', 'events-manager') ?></th>
<th><?php _e('State', 'events-manager') ?></th>
<th><?php _e('Country', 'events-manager') ?></th>
</tr>
</thead>
<tfoot>
<tr>
<?php if(empty($hide_checkboxes)): ?>
<th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>
<?php endif; ?>
<th><?php _e('Name', 'events-manager') ?></th>
<th><?php _e('Address', 'events-manager') ?></th>
<th><?php _e('State', 'events-manager') ?></th>
<th><?php _e('Country', 'events-manager') ?></th>
</tr>
</tfoot>
<tbody>
<?php $rowno = 0; ?>
<?php foreach ($locations as $EM_Location) : ?>
<?php
$class = ($rowno % 2) ? 'alternate' : '';
$rowno++;
?>
<tr class="<?php echo $class; ?>">
<?php if(empty($hide_checkboxes)): ?>
<td><input type='checkbox' class ='row-selector' value='<?php echo $EM_Location->location_id ?>' name='locations[]'/></td>
<?php endif; ?>
<td>
<?php if( $EM_Location->can_manage('edit_events','edit_others_events') ): ?>
<a href='<?php echo esc_url($EM_Location->get_edit_url()); ?>'><?php echo esc_html($EM_Location->location_name); ?></a>
<?php else: ?>
<strong><?php echo esc_html($EM_Location->location_name) ?></strong> -
<a href='<?php echo $EM_Location->output('#_LOCATIONURL'); ?>'><?php esc_html_e('View') ?></a>
<?php endif; ?>
</td>
<td><?php echo esc_html(implode(', ', array($EM_Location->location_address,$EM_Location->location_town,$EM_Location->location_postcode))); ?></td>
<td><?php echo esc_html($EM_Location->location_state) ?></td>
<td><?php echo $EM_Location->get_country() ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<br class="clear" />
<p><?php esc_html_e('No locations have been inserted yet!', 'events-manager') ?></p>
<?php endif; ?>
<?php if ( !empty($locations_nav) ) echo $locations_nav; ?>
</form>
</div>

View File

@ -0,0 +1,10 @@
This folder has files containing table output layouts, such as event and location admin tables for the public pages.
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/tables/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,55 @@
<?php
/*
* This page displays a printable view of bookings for a single event.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* Here you can assume that $EM_Event is globally available with the right EM_Event object.
*/
global $EM_Event;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php echo sprintf(__('Bookings for %s','events-manager'), $EM_Event->name); ?></title>
<link rel="stylesheet" href="<?php echo bloginfo('wpurl') ?>/wp-content/plugins/events-manager/includes/css/events_manager.css" type="text/css" media="screen" />
</head>
<body id="printable">
<div id="container">
<h1><?php echo sprintf(__('Bookings for %s','events-manager'), $EM_Event->name); ?></h1>
<p><?php echo $EM_Event->output("#d #M #Y"); ?></p>
<p><?php echo $EM_Event->output("#_LOCATION, #_ADDRESS, #_TOWN"); ?></p>
<h2><?php _e('Bookings data', 'events-manager');?></h2>
<table id="bookings-table">
<tr>
<th scope='col'><?php _e('Name', 'events-manager')?></th>
<th scope='col'><?php _e('E-mail', 'events-manager')?></th>
<th scope='col'><?php _e('Phone number', 'events-manager')?></th>
<th scope='col'><?php _e('Spaces', 'events-manager')?></th>
<th scope='col'><?php _e('Comment', 'events-manager')?></th>
</tr>
<?php foreach($EM_Event->get_bookings()->bookings as $EM_Booking) {
if( $EM_Booking->status == 1){
?>
<tr>
<td><?php echo $EM_Booking->person->get_name() ?></td>
<td><?php echo $EM_Booking->person->user_email ?></td>
<td><?php echo $EM_Booking->person->phone ?></td>
<td class='spaces-number'><?php echo $EM_Booking->get_spaces() ?></td>
<td><?php echo $EM_Booking->booking_comment ?></td>
</tr>
<?php }} ?>
<tr id='booked-spaces'>
<td colspan='3'>&nbsp;</td>
<td class='total-label'><?php _e('Booked', 'events-manager')?>:</td>
<td class='spaces-number'><?php echo $EM_Event->get_bookings()->get_booked_spaces(); ?></td>
</tr>
<tr id='available-spaces'>
<td colspan='3'>&nbsp;</td>
<td class='total-label'><?php _e('Available', 'events-manager')?>:</td>
<td class='spaces-number'><?php echo $EM_Event->get_bookings()->get_available_spaces(); ?></td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,20 @@
<?php
/*
* Default Calendar day
* This page displays a list of events or single event for a specific calendar day, called during the em_content() if this is an calendar day page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*
*/
$args['scope'] = $_REQUEST['calendar_day'];
$events_count = EM_Events::count( apply_filters('em_content_calendar_day_args', $args) ); //Get events first, so we know how many there are in advance
if ( $events_count > 1 || get_option('dbem_display_calendar_day_single') == 1 ) {
em_locate_template('templates/events-list.php', true, array('args' => apply_filters('em_content_calendar_day_output_args', $args)) );
} elseif( $events_count == 1 ) {
$args['format'] = get_option('dbem_single_event_format');
echo EM_Events::output(apply_filters('em_content_calendar_day_output_args', $args));
} else {
echo get_option('dbem_no_events_message');
}

View File

@ -0,0 +1,61 @@
<?php
/*
* This file contains the HTML generated for full calendars. You can copy this file to yourthemefolder/plugins/events-manager/templates and modify it in an upgrade-safe manner.
*
* There are two variables made available to you:
*
* $calendar - contains an array of information regarding the calendar and is used to generate the content
* $args - the arguments passed to EM_Calendar::output()
*
* Note that leaving the class names for the previous/next links will keep the AJAX navigation working.
*/
$cal_count = count($calendar['cells']); //to prevent an extra tr
$col_count = $tot_count = 1; //this counts collumns in the $calendar_array['cells'] array
$col_max = count($calendar['row_headers']); //each time this collumn number is reached, we create a new collumn, the number of cells should divide evenly by the number of row_headers
?>
<table class="em-calendar fullcalendar">
<thead>
<tr>
<td><a class="em-calnav full-link em-calnav-prev" href="<?php echo esc_url($calendar['links']['previous_url']); ?>">&lt;&lt;</a></td>
<td class="month_name" colspan="5"><?php echo esc_html(date_i18n(get_option('dbem_full_calendar_month_format'), $calendar['month_start'])); ?></td>
<td><a class="em-calnav full-link em-calnav-next" href="<?php echo esc_url($calendar['links']['next_url']); ?>">&gt;&gt;</a></td>
</tr>
</thead>
<tbody>
<tr class="days-names">
<td><?php echo implode('</td><td>',$calendar['row_headers']); ?></td>
</tr>
<tr>
<?php
foreach($calendar['cells'] as $date => $cell_data ){
$class = ( !empty($cell_data['events']) && count($cell_data['events']) > 0 ) ? 'eventful':'eventless';
if(!empty($cell_data['type'])){
$class .= "-".$cell_data['type'];
}
//In some cases (particularly when long events are set to show here) long events and all day events are not shown in the right order. In these cases,
//if you want to sort events cronologically on each day, including all day events at top and long events within the right times, add define('EM_CALENDAR_SORTTIME', true); to your wp-config.php file
if( defined('EM_CALENDAR_SORTTIME') && EM_CALENDAR_SORTTIME ) ksort($cell_data['events']); //indexes are timestamps
?>
<td class="<?php echo esc_attr($class); ?>">
<?php if( !empty($cell_data['events']) && count($cell_data['events']) > 0 ): ?>
<a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>"><?php echo esc_html(date('j',$cell_data['date'])); ?></a>
<ul>
<?php echo EM_Events::output($cell_data['events'],array('format'=>get_option('dbem_full_calendar_event_format'))); ?>
<?php if( $args['limit'] && $cell_data['events_count'] > $args['limit'] && get_option('dbem_display_calendar_events_limit_msg') != '' ): ?>
<li><a href="<?php echo esc_url($cell_data['link']); ?>"><?php echo get_option('dbem_display_calendar_events_limit_msg'); ?></a></li>
<?php endif; ?>
</ul>
<?php else:?>
<?php echo esc_html(date('j',$cell_data['date'])); ?>
<?php endif; ?>
</td>
<?php
//create a new row once we reach the end of a table collumn
$col_count= ($col_count == $col_max ) ? 1 : $col_count+1;
echo ($col_count == 1 && $tot_count < $cal_count) ? '</tr><tr>':'';
$tot_count ++;
}
?>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,52 @@
<?php
/*
* This file contains the HTML generated for small calendars. You can copy this file to yourthemefolder/plugins/events-manager/templates and modify it in an upgrade-safe manner.
*
* There are two variables made available to you:
*
* $calendar - contains an array of information regarding the calendar and is used to generate the content
* $args - the arguments passed to EM_Calendar::output()
*
* Note that leaving the class names for the previous/next links will keep the AJAX navigation working.
*/
?>
<table class="em-calendar">
<thead>
<tr>
<td><a class="em-calnav em-calnav-prev" href="<?php echo esc_url($calendar['links']['previous_url']); ?>" rel="nofollow">&lt;&lt;</a></td>
<td class="month_name" colspan="5"><?php echo esc_html(date_i18n(get_option('dbem_small_calendar_month_format'), $calendar['month_start'])); ?></td>
<td><a class="em-calnav em-calnav-next" href="<?php echo esc_url($calendar['links']['next_url']); ?>" rel="nofollow">&gt;&gt;</a></td>
</tr>
</thead>
<tbody>
<tr class="days-names">
<td><?php echo implode('</td><td>',$calendar['row_headers']); ?></td>
</tr>
<tr>
<?php
$cal_count = count($calendar['cells']);
$col_count = $count = 1; //this counts collumns in the $calendar_array['cells'] array
$col_max = count($calendar['row_headers']); //each time this collumn number is reached, we create a new collumn, the number of cells should divide evenly by the number of row_headers
foreach($calendar['cells'] as $date => $cell_data ){
$class = ( !empty($cell_data['events']) && count($cell_data['events']) > 0 ) ? 'eventful':'eventless';
if(!empty($cell_data['type'])){
$class .= "-".$cell_data['type'];
}
?>
<td class="<?php echo esc_attr($class); ?>">
<?php if( !empty($cell_data['events']) && count($cell_data['events']) > 0 ): ?>
<a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>"><?php echo esc_html(date('j',$cell_data['date'])); ?></a>
<?php else:?>
<?php echo esc_html(date('j',$cell_data['date'])); ?>
<?php endif; ?>
</td>
<?php
//create a new row once we reach the end of a table collumn
$col_count= ($col_count == $col_max ) ? 1 : $col_count+1;
echo ($col_count == 1 && $count < $cal_count) ? '</tr><tr>':'';
$count ++;
}
?>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,17 @@
<?php
/*
* Default Categories List Template
* This page displays a list of locations, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display locations (or whatever) however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Categories::output()
*
*/
$args = apply_filters('em_content_categories_args', $args);
if( get_option('dbem_css_catlist') ) echo "<div class='css-cats-list'>";
echo EM_Categories::output( $args );
if( get_option('dbem_css_catlist') ) echo "</div>";

View File

@ -0,0 +1,12 @@
<?php
/*
* This page displays a single event, called during the em_content() if this is an event page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*/
global $EM_Category;
/* @var $EM_Category EM_Category */
echo $EM_Category->output_single();
?>

View File

@ -0,0 +1,17 @@
<?php
/*
* Remember that this file is only used if you have chosen to override event pages with formats in your event settings!
* You can also override the single event page completely in any case (e.g. at a level where you can control sidebars etc.), as described here - http://codex.wordpress.org/Post_Types#Template_Files
* Your file would be named single-event.php
*/
/*
* This page displays a single event, called during the the_content filter if this is an event page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*/
global $EM_Event;
/* @var $EM_Event EM_Event */
echo $EM_Event->output_single();
?>

View File

@ -0,0 +1,13 @@
<?php
/*
* Default Events List Template
* This page displays a list of events, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*
*/
$args['full'] = 1;
$args['long_events'] = get_option('dbem_full_calendar_long_events');
echo EM_Calendar::output( apply_filters('em_content_calendar_args', $args) );

View File

@ -0,0 +1,17 @@
<?php
/*
* Default Events List Template
* This page displays a list of events, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*
*/
$args = apply_filters('em_content_events_args', $args);
if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
echo EM_Events::output_grouped($args); //note we're grabbing the content, not em_get_events_list_grouped function
if( get_option('dbem_css_evlist') ) echo "</div>";

View File

@ -0,0 +1,17 @@
<?php
/*
* Default Events List Template
* This page displays a list of events, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*
*/
$args = apply_filters('em_content_events_args', $args);
print_r($args);
if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
echo EM_Events::output( $args );
if( get_option('dbem_css_evlist') ) echo "</div>";

View File

@ -0,0 +1,69 @@
<?php
/* WARNING!!! (2013-07-10) We intend to add a few more fields into this search form over the coming weeks/months.
* Overriding shouldn't hinder functionality at all but these new search options won't appear on your form!
*/
/*
* By modifying this in your theme folder within plugins/events-manager/templates/events-search.php, you can change the way the search form will look.
* To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
* You also have an $args array available to you with search options passed on by your EM settings or shortcode
*/
$args = !empty($args) ? $args:array(); /* @var $args array */
?>
<div class="em-search-wrapper">
<div class="em-events-search em-search <?php if( !empty($args['main_classes']) ) echo esc_attr(implode(' ', $args['main_classes'])); ?>">
<form action="<?php echo !empty($args['search_url']) ? esc_url($args['search_url']) : EM_URI; ?>" method="post" class="em-events-search-form em-search-form">
<input type="hidden" name="action" value="<?php echo esc_attr($args['search_action']); ?>" />
<?php if( $args['show_main'] ): //show the 'main' search form ?>
<div class="em-search-main">
<?php do_action('em_template_events_search_form_header'); //hook in here to add extra fields, text etc. ?>
<?php
//search text
if( !empty($args['search_term']) ) em_locate_template('templates/search/search.php',true,array('args'=>$args));
if( !empty($args['search_geo']) ) em_locate_template('templates/search/geo.php',true,array('args'=>$args));
?>
<?php if( !empty($args['css']) ) : //show the button here if we're using the default styling, if you still want to use this and use custom CSS, then you have to override our rules ?>
<button type="submit" class="em-search-submit loading">
<?php //before you ask, this hack is necessary thanks to stupid IE7 ?>
<!--[if IE 7]><span><![endif]-->
<img src="<?php echo EM_DIR_URI; ?>includes/images/search-mag.png" alt="<?php esc_attr_e('Search', 'events-manager'); ?>" />
<!--[if IE 7]></span><![endif]-->
</button>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if( !empty($args['show_advanced']) ): //show advanced fields, collapesed if the main form is shown, inline if not ?>
<div class="em-search-advanced" <?php if( !empty($args['advanced_hidden']) ) echo 'style="display:none"'; ?>>
<?php
//date range (scope)
if( !empty($args['search_scope']) ) em_locate_template('templates/search/scope.php',true,array('args'=>$args));
//categories
if( get_option('dbem_categories_enabled') && !empty($args['search_categories']) ) em_locate_template('templates/search/categories.php',true,array('args'=>$args));
//Location data
em_locate_template('templates/search/location.php',true, array('args'=>$args));
if( !empty($args['search_geo_units']) ) em_locate_template('templates/search/geo-units.php',true, array('args'=>$args));
?>
<?php do_action('em_template_events_search_form_footer'); //hook in here to add extra fields, text etc. ?>
<?php if( !$args['show_main'] || empty($args['css']) ): //show button if it wasn't shown further up ?>
<input type="submit" value="<?php echo esc_attr($args['search_button']); ?>" class="em-search-submit" />
<?php endif; ?>
</div>
<?php endif; ?>
<?php if( !empty($args['advanced_hidden']) && !empty($args['show_advanced']) ): //show the advanced search toggle if advanced fields are collapsed ?>
<div class="em-search-options">
<a href="#" class="em-toggle" rel=".em-search-advanced:.em-search-form">
<span class="hide-advanced" style="display:none;"><?php echo esc_html($args['search_text_hide']); ?></span>
<span class="show-advanced"><?php echo esc_html($args['search_text_show']); ?></span>
</a>
</div>
<?php endif; ?>
<?php if( (empty($args['show_advanced']) || empty($args['search_countries'])) && !empty($args['country']) ): //show country in hidden field for geo searching ?>
<input type="hidden" name="country" value="<?php echo esc_attr($args['country']) ?>" />
<?php endif; ?>
<?php if( empty($args['show_advanced']) || empty($args['search_geo_units']) ): //show country in hidden field for geo searching ?>
<?php if( !empty($args['near_distance']) ) : ?><input name="near_distance" type="hidden" value="<?php echo $args['near_distance']; ?>" /><?php endif; ?>
<?php if( !empty($args['near_unit']) ) : ?><input name="near_unit" type="hidden" value="<?php echo $args['near_unit']; ?>" /><?php endif; ?>
<?php endif; ?>
</form>
</div>
<?php if( !empty($args['ajax']) ): ?><div class='em-search-ajax'></div><?php endif; ?>
</div>

View File

@ -0,0 +1,135 @@
<?php
//define and clean up formats for display
$summary_format = str_replace ( ">", "&gt;", str_replace ( "<", "&lt;", get_option ( 'dbem_ical_description_format' ) ) );
$description_format = str_replace ( ">", "&gt;", str_replace ( "<", "&lt;", get_option ( 'dbem_ical_real_description_format') ) );
$location_format = str_replace ( ">", "&gt;", str_replace ( "<", "&lt;", get_option ( 'dbem_ical_location_format' ) ) );
$parsed_url = parse_url(get_bloginfo('url'));
$site_domain = preg_replace('/^www./', '', $parsed_url['host']);
//figure out limits
$ical_limit = get_option('dbem_ical_limit');
$page_limit = $ical_limit > 50 || !$ical_limit ? 50:$ical_limit; //set a limit of 50 to output at a time, unless overall limit is lower
//get passed on $args and merge with defaults
$args = !empty($args) ? $args:array(); /* @var $args array */
$args = array_merge(array('limit'=>$page_limit, 'page'=>'1', 'owner'=>false, 'orderby'=>'event_start_date', 'scope' => get_option('dbem_ical_scope') ), $args);
$args = apply_filters('em_calendar_template_args',$args);
//get first round of events to show, we'll start adding more via the while loop
$EM_Events = EM_Events::get( $args );
//calendar header
$output = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//wp-events-plugin.com//".EM_VERSION."//EN";
echo preg_replace("/([^\r])\n/", "$1\r\n", $output);
//loop through events
$count = 0;
while ( count($EM_Events) > 0 ){
foreach ( $EM_Events as $EM_Event ) {
/* @var $EM_Event EM_Event */
if( $ical_limit != 0 && $count > $ical_limit ) break; //we've reached our maximum
//calculate the times along with timezone offsets
if($EM_Event->event_all_day){
$dateStart = ';VALUE=DATE:'.date('Ymd',$EM_Event->start); //all day
$dateEnd = ';VALUE=DATE:'.date('Ymd',$EM_Event->end + 86400); //add one day
}else{
$dateStart = ':'.get_gmt_from_date(date('Y-m-d H:i:s', $EM_Event->start), 'Ymd\THis\Z');
$dateEnd = ':'.get_gmt_from_date(date('Y-m-d H:i:s', $EM_Event->end), 'Ymd\THis\Z');
}
if( !empty($EM_Event->event_date_modified) && $EM_Event->event_date_modified != '0000-00-00 00:00:00' ){
$dateModified = get_gmt_from_date($EM_Event->event_date_modified, 'Ymd\THis\Z');
}else{
$dateModified = get_gmt_from_date($EM_Event->post_modified, 'Ymd\THis\Z');
}
//formats
$summary = em_mb_ical_wordwrap('SUMMARY:'.$EM_Event->output($summary_format,'ical'));
$description = em_mb_ical_wordwrap('DESCRIPTION:'.$EM_Event->output($description_format,'ical'));
$url = 'URL:'.$EM_Event->get_permalink();
$url = wordwrap($url, 74, "\n ", true);
$location = $geo = $apple_geo = $apple_location = $apple_location_title = $apple_structured_location = $categories = false;
if( $EM_Event->location_id ){
$location = em_mb_ical_wordwrap('LOCATION:'.$EM_Event->output($location_format, 'ical'));
if( $EM_Event->get_location()->location_latitude || $EM_Event->get_location()->location_longitude ){
$geo = 'GEO:'.$EM_Event->get_location()->location_latitude.";".$EM_Event->get_location()->location_longitude;
}
if( !defined('EM_ICAL_APPLE_STRUCT') || !EM_ICAL_APPLE_STRUCT ){
$apple_location = $EM_Event->output('#_LOCATIONFULLLINE, #_LOCATIONCOUNTRY', 'ical');
$apple_location_title = $EM_Event->output('#_LOCATIONNAME', 'ical');
$apple_geo = !empty($geo) ? $EM_Event->get_location()->location_latitude.",".$EM_Event->get_location()->location_longitude:'0,0';
$apple_structured_location = "X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS={$apple_location};X-APPLE-RADIUS=100;X-TITLE={$apple_location_title}:geo:{$apple_geo}";
$apple_structured_location = str_replace('"', '\"', $apple_structured_location); //google chucks a wobbly with these on this line
$apple_structured_location = em_mb_ical_wordwrap($apple_structured_location);
}
}
$categories = array();
foreach( $EM_Event->get_categories() as $EM_Category ){ /* @var EM_Category $EM_Category */
$categories[] = $EM_Category->name;
}
$image = $EM_Event->get_image_url();
//create a UID, make it unique and update independent
$UID = $EM_Event->event_id . '@' . $site_domain;
if( is_multisite() ) $UID = absint($EM_Event->blog_id) . '-' . $UID;
$UID = wordwrap("UID:".$UID, 74, "\r\n ", true);
//output ical item
$output = "\r\n"."BEGIN:VEVENT
{$UID}
DTSTART{$dateStart}
DTEND{$dateEnd}
DTSTAMP:{$dateModified}
{$url}
{$summary}";
//Description if available
if( $description ){
$output .= "\r\n" . $description;
}
//add featured image if exists
if( $image ){
$image = wordwrap("ATTACH;FMTTYPE=image/jpeg:".esc_url_raw($image), 74, "\n ", true);
$output .= "
{$image}";
}
//add categories if there are any
if( !empty($categories) ){
$categories = wordwrap("CATEGORIES:".implode(',', $categories), 74, "\n ", true);
$output .= "
{$categories}";
}
//Location if there is one
if( $location ){
$output .= "
{$location}";
//geo coordinates if they exist
if( $geo ){
$output .= "
{$geo}";
}
//create apple-compatible feature for locations
if( !empty($apple_structured_location) ){
$output .= "
{$apple_structured_location}";
}
}
//end the event
$output .= "
END:VEVENT";
//clean up new lines, rinse and repeat
echo preg_replace("/([^\r])\n/", "$1\r\n", $output);
$count++;
}
if( $ical_limit != 0 && $count >= $ical_limit ){
//we've reached our limit, or showing one event only
break;
}else{
//get next page of results
$args['page']++;
$EM_Events = EM_Events::get( $args );
}
}
//calendar footer
$output = "\r\n"."END:VCALENDAR";
echo preg_replace("/([^\r])\n/", "$1\r\n", $output);

View File

@ -0,0 +1,17 @@
<?php
/*
* Remember that this file is only used if you have chosen to override location pages with formats in your events manager settings!
* You can also override the single location page completely in any case (e.g. at a level where you can control sidebars etc.), as described here - http://codex.wordpress.org/Post_Types#Template_Files
* Your file would be named single-location.php
*/
/*
* This page displays a single event, called during the em_content() if this is an event page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*/
global $EM_Location;
/* @var $EM_Location EM_Location */
echo $EM_Location->output_single();
?>

View File

@ -0,0 +1,17 @@
<?php
/*
* Default Location List Template
* This page displays a list of locations, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display locations (or whatever) however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Locations::output()
*
*/
$args = apply_filters('em_content_locations_args', $args);
if( get_option('dbem_css_loclist') ) echo "<div class='css-locations-list'>";
echo EM_Locations::output( $args );
if( get_option('dbem_css_loclist') ) echo "</div>";

View File

@ -0,0 +1,14 @@
<?php
/* WARNING!!! (2013-07-10) We intend to add a few more fields into this search form over the coming weeks/months.
* Overriding shouldn't hinder functionality at all but these new search options won't appear on your form!
*/
/*
* By modifying this in your theme folder within plugins/events-manager/templates/events-search.php, you can change the way the search form will look.
* To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
* You also have an $args array available to you with search options passed on by your EM settings or shortcode
*/
/* @var $args array */
$args['search_action'] = 'search_locations';
$args['search_url'] = get_option('dbem_locations_page') ? get_permalink(get_option('dbem_locations_page')):EM_URI;
em_locate_template('templates/events-search.php', true, array('args'=>$args));
?>

View File

@ -0,0 +1,26 @@
<?php
/*
* This file contains the HTML generated for maps. You can copy this file to yourthemefolder/plugins/events/templates and modify it in an upgrade-safe manner.
*
* There is one argument passed to you, which is the $args variable. This contains the arguments you could pass into shortcodes, template tags or functions like EM_Events::get().
*
* In this template, we encode the $args array into JSON for javascript to easily parse and request the locations from the server via AJAX.
*/
if (get_option('dbem_gmap_is_active') == '1') {
?>
<div class="em-location-map-container" style='position:relative; background: #CDCDCD; width: <?php echo $args['width'] ?>; height: <?php echo $args['height'] ?>;'>
<div class='em-locations-map' id='em-locations-map-<?php echo $args['random_id']; ?>' style="width:100%; height:100%"><em><?php _e('Loading Map....', 'events-manager'); ?></em></div>
<div class='em-locations-map-coords' id='em-locations-map-coords-<?php echo $args['random_id']; ?>' style="display:none; visibility:hidden;"><?php echo EM_Object::json_encode($args); ?></div>
<?php if( !empty($map_json_style) ): ?>
<script type="text/javascript">
if( typeof EM == 'object'){
if( typeof EM.google_map_id_styles != 'object' ) EM.google_map_id_styles = [];
EM.google_map_id_styles['<?php echo $args['random_id']; ?>'] = <?php echo $map_json_style; ?>;
}
</script>
<?php endif; ?>
</div>
<?php
}
?>

View File

@ -0,0 +1,97 @@
<?php do_action('em_template_my_bookings_header'); ?>
<?php
global $wpdb, $current_user, $EM_Notices, $EM_Person;
if( is_user_logged_in() ):
$EM_Person = new EM_Person( get_current_user_id() );
$EM_Bookings = $EM_Person->get_bookings();
$bookings_count = count($EM_Bookings->bookings);
if($bookings_count > 0){
//Get events here in one query to speed things up
$event_ids = array();
foreach($EM_Bookings as $EM_Booking){
$event_ids[] = $EM_Booking->event_id;
}
}
$limit = ( !empty($_GET['limit']) ) ? $_GET['limit'] : 20;//Default limit
$page = ( !empty($_GET['pno']) ) ? $_GET['pno']:1;
$offset = ( $page > 1 ) ? ($page-1)*$limit : 0;
echo $EM_Notices;
?>
<div class='em-my-bookings'>
<?php if ( $bookings_count >= $limit ) : ?>
<div class='tablenav'>
<?php
if ( $bookings_count >= $limit ) {
$link = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%'), false); //don't html encode, so em_paginate does its thing
$bookings_nav = em_paginate( $link, $bookings_count, $limit, $page);
echo $bookings_nav;
}
?>
<div class="clear"></div>
</div>
<?php endif; ?>
<div class="clear"></div>
<?php if( $bookings_count > 0 ): ?>
<div class='table-wrap'>
<table id='dbem-bookings-table' class='widefat post fixed'>
<thead>
<tr>
<th class='manage-column' scope='col'><?php _e('Event', 'events-manager'); ?></th>
<th class='manage-column' scope='col'><?php _e('Date', 'events-manager'); ?></th>
<th class='manage-column' scope='col'><?php _e('Spaces', 'events-manager'); ?></th>
<th class='manage-column' scope='col'><?php _e('Status', 'events-manager'); ?></th>
<th class='manage-column' scope='col'>&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$rowno = 0;
$event_count = 0;
$nonce = wp_create_nonce('booking_cancel');
foreach ($EM_Bookings as $EM_Booking) {
/* @var $EM_Booking EM_Booking */
$EM_Event = $EM_Booking->get_event();
if( ($rowno < $limit || empty($limit)) && ($event_count >= $offset || $offset === 0) ) {
$rowno++;
?>
<tr>
<td><?php echo $EM_Event->output("#_EVENTLINK"); ?></td>
<td><?php echo date_i18n( get_option('dbem_date_format'), $EM_Event->start ); ?></td>
<td><?php echo $EM_Booking->get_spaces() ?></td>
<td>
<?php echo $EM_Booking->get_status(); ?>
</td>
<td>
<?php
$cancel_link = '';
if( !in_array($EM_Booking->booking_status, array(2,3)) && get_option('dbem_bookings_user_cancellation') && $EM_Event->get_bookings()->has_open_time() ){
$cancel_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'booking_cancel', 'booking_id'=>$EM_Booking->booking_id, '_wpnonce'=>$nonce));
$cancel_link = '<a class="em-bookings-cancel" href="'.$cancel_url.'" onclick="if( !confirm(EM.booking_warning_cancel) ){ return false; }">'.__('Cancel','events-manager').'</a>';
}
echo apply_filters('em_my_bookings_booking_actions', $cancel_link, $EM_Booking);
?>
</td>
</tr>
<?php
}
do_action('em_my_bookings_booking_loop',$EM_Booking);
$event_count++;
}
?>
</tbody>
</table>
</div>
<?php else: ?>
<?php _e('You do not have any bookings.', 'events-manager'); ?>
<?php endif; ?>
<?php if( !empty($bookings_nav) && $bookings_count >= $limit ) : ?>
<div class='tablenav'>
<?php echo $bookings_nav; ?>
<div class="clear"></div>
</div>
<?php endif; ?>
</div>
<?php do_action('em_template_my_bookings_footer', $EM_Bookings); ?>
<?php else: ?>
<p><?php echo sprintf(__('Please <a href="%s">Log In</a> to view your bookings.','events-manager'),site_url('wp-login.php?redirect_to=' . urlencode(get_permalink()), 'login'))?></p>
<?php endif; ?>

View File

@ -0,0 +1,10 @@
This folder has files containing various templates used by events manager. The file names are quite descriptive as to their functions.
Any of these files in this folder can be individually overriden in your theme folder, making it upgrade safe without having to hack core plugin files directly.
To override a file, copy (not move) the file to wp-content/themes/yourtheme/plugins/events-manager/templates/ and edit as needed.
If the file is within a subfolder of this directory, create that subdirectory in your theme path above and copy the file there.
Whilst we intend to keep changes to a minimum, it may be inevitable that we need to update these files to add new features or fix a
reported bug, please keep this in mind when updating.

View File

@ -0,0 +1,57 @@
<?php
/*
* RSS Page
* This page handles the even RSS feed.
* You can override this file by and copying it to yourthemefolder/plugins/events-manager/templates/ and modifying as necessary.
*
*/
header ( "Content-type: application/rss+xml; charset=UTF-8" );
echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><?php echo esc_html(get_option ( 'dbem_rss_main_title' )); ?></title>
<link><?php echo EM_URI; ?></link>
<description><?php echo esc_html(get_option('dbem_rss_main_description')); ?></description>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<pubDate><?php echo date('D, d M Y H:i:s +0000', get_option('em_last_modified', current_time('timestamp',true))); ?></pubDate>
<atom:link href="<?php echo esc_attr(EM_RSS_URI); ?>" rel="self" type="application/rss+xml" />
<?php
$description_format = str_replace ( ">", "&gt;", str_replace ( "<", "&lt;", get_option ( 'dbem_rss_description_format' ) ) );
$rss_limit = get_option('dbem_rss_limit');
$page_limit = $rss_limit > 50 || !$rss_limit ? 50 : $rss_limit; //set a limit of 50 to output at a time, unless overall limit is lower
$args = !empty($args) ? $args:array(); /* @var $args array */
$args = array_merge(array('scope'=>get_option('dbem_rss_scope'), 'owner'=>false, 'limit'=>$page_limit, 'page'=>1, 'order'=>get_option('dbem_rss_order'), 'orderby'=>get_option('dbem_rss_orderby')), $args);
$args = apply_filters('em_rss_template_args',$args);
$EM_Events = EM_Events::get( $args );
$count = 0;
while( count($EM_Events) > 0 ){
foreach ( $EM_Events as $EM_Event ) {
/* @var $EM_Event EM_Event */
$description = $EM_Event->output( get_option ( 'dbem_rss_description_format' ), "rss");
$description = ent2ncr(convert_chars($description)); //Some RSS filtering
$event_url = $EM_Event->output('#_EVENTURL');
?>
<item>
<title><?php echo $EM_Event->output( get_option('dbem_rss_title_format'), "rss" ); ?></title>
<link><?php echo $event_url; ?></link>
<guid><?php echo $event_url; ?></guid>
<pubDate><?php echo get_gmt_from_date(date('Y-m-d H:i:s', $EM_Event->start), 'D, d M Y H:i:s +0000'); ?></pubDate>
<description><![CDATA[<?php echo $description; ?>]]></description>
</item>
<?php
$count++;
}
if( $rss_limit != 0 && $count >= $rss_limit ){
//we've reached our limit, or showing one event only
break;
}else{
//get next page of results
$args['page']++;
$EM_Events = EM_Events::get( $args );
}
}
?>
</channel>
</rss>

View File

@ -0,0 +1,23 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START Category Search -->
<div class="em-search-category em-search-field">
<label>
<span><?php echo esc_html($args['category_label']); ?></span>
<?php
EM_Object::ms_global_switch(); //in case in global tables mode of MultiSite, grabs main site categories, if not using MS Global, nothing happens
wp_dropdown_categories(array(
'hide_empty' => 0,
'orderby' =>'name',
'name' => 'category',
'hierarchical' => true,
'taxonomy' => EM_TAXONOMY_CATEGORY,
'selected' => $args['category'],
'show_option_none' => $args['categories_label'],
'option_none_value'=> 0,
'class'=>'em-events-search-category'
));
EM_Object::ms_global_switch_back(); //if switched above, switch back
?>
</label>
</div>
<!-- END Category Search -->

View File

@ -0,0 +1,20 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START Geo Units Search -->
<div class="em-search-geo-units em-search-field" <?php if( empty($args['geo']) || empty($args['near']) ): ?>style="display:none;"<?php endif; /* show location fields if no geo search is made */ ?>>
<label>
<span><?php echo esc_html($args['geo_units_label']); ?></span>
<select name="near_distance" class="em-search-geo-distance">
<?php foreach( $args['geo_distance_values'] as $unit ) : ?>
<option value="<?php echo $unit; ?>" <?php if($args['near_distance'] == $unit) echo 'selected="selected"' ?>><?php echo $unit; ?></option>
<?php endforeach; ?>
</select>
</label>
<label>
<span class="screen-reader-text"><?php echo esc_html(__('distance units','events-manager')); ?></span>
<select name="near_unit" class="em-search-geo-unit">
<option value="mi">mi</option>
<option value="km" <?php if($args['near_unit'] == 'km') echo 'selected="selected"' ?>>km</option>
</select>
</label>
</div>
<!-- END Geo Units Search -->

View File

@ -0,0 +1,100 @@
function em_geo_search_init(){
jQuery('input.em-search-geo').each(function(i){
var input = /** @type {HTMLInputElement} */ jQuery(this);
var wrapper = input.closest('div.em-search-geo');
var autocomplete = new google.maps.places.Autocomplete(input[0]);
var geo_coords = wrapper.find("input.em-search-geo-coords");
var geo_field_status = function( status ){
wrapper.data('status',status);
var em_search = wrapper.closest('.em-search');
if( status == 'on' ){
wrapper.css('background-image', wrapper.css('background-image').replace('search-geo.png', 'search-geo-on.png').replace('search-geo-off.png', 'search-geo-on.png'));
em_search.find('select.em-search-country option:first-child').prop('selected','selected').trigger('change');
em_search.find('.em-search-location').slideUp();
em_search.find('.em-search-geo-units').slideDown();
}else{
if( status == 'off' ){
wrapper.css('background-image', wrapper.css('background-image').replace('search-geo.png', 'search-geo-off.png').replace('search-geo-on.png', 'search-geo-off.png'));
}else{
wrapper.css('background-image', wrapper.css('background-image').replace('search-geo-off.png', 'search-geo.png').replace('search-geo-on.png', 'search-geo.png'));
}
geo_coords.val('');
em_search.find('.em-search-location').slideDown();
em_search.find('.em-search-geo-units').slideUp();
}
};
var ac_listener = function( place ) {
var place = autocomplete.getPlace();
if( !place || !place.geometry ){ //place not found
if( input.val() == '' || input.val() == EM.geo_placeholder ){
geo_field_status(false);
}else{
if( wrapper.data('last-search') == input.val() ){
geo_field_status('on');
geo_coords.val( wrapper.data('last-coords') );
return;
}
//do a nearest match suggestion as last resort
if( input.val().length >= 2 ){
geo_field_status(false);
autocompleteService = new google.maps.places.AutocompleteService();
autocompleteService.getPlacePredictions( {'input': input.val(), 'offset': input.val().length }, function listentoresult(list, status) {
if(list != null && list.length != 0) {
placesService = new google.maps.places.PlacesService(document.getElementById('em-search-geo-attr'));
placesService.getDetails( {'reference': list[0].reference}, function detailsresult(detailsResult, placesServiceStatus) {
//we have a match, ask the user
wrapper.data('last-search', detailsResult.formatted_address );
wrapper.data('last-coords', detailsResult.geometry.location.lat() + ',' + detailsResult.geometry.location.lng());
if( input.val() == detailsResult.formatted_address || confirm(EM.geo_alert_guess.replace('%s', '"'+detailsResult.formatted_address+'"')) ){
geo_coords.val( detailsResult.geometry.location.lat() + ',' + detailsResult.geometry.location.lng() );
geo_field_status('on');
input.val(detailsResult.formatted_address);
}else{
input.data('last-key',false);
geo_field_status('off');
}
});
}else{ geo_field_status('off'); }
});
}else{ geo_field_status('off'); }
}
wrapper.data('last-search', input.val() );
wrapper.data('last-coords', geo_coords.val());
return;
}
geo_coords.val( place.geometry.location.lat() + ',' + place.geometry.location.lng() );
geo_field_status('on');
wrapper.data('last-search', input.val() );
wrapper.data('last-coords', geo_coords.val());
};
google.maps.event.addListener(autocomplete, 'place_changed', ac_listener);
if( geo_coords.val() != '' ){
geo_field_status('on');
wrapper.data('last-search', input.val() );
wrapper.data('last-coords', geo_coords.val() );
}
input.keypress( function(e) {
//if enter is pressed once during 'near' input, don't do anything so Google can select location, otherwise let behavior (form submittal) proceed
if( e.which == 13 ) {
if( input.data('last-key') != 13 || wrapper.data('status') != 'on' ){
e.preventDefault();
}
}else{
geo_field_status(false);
}
}).keyup( function(e) {
if( this.value == '' ){ geo_field_status(false); }
else if( wrapper.data('last-search') != this.value ){ geo_field_status('off'); }
input.data('last-key', e.which);
}).blur( function(e){ //create HTML 5 placeholder effect if not HTML 5
if( this.value == '' && !('placeholder' in document.createElement('input')) ) this.value = EM.geo_placeholder;
}).focus( function(e){
if( this.value == EM.geo_placeholder ) this.value='';
input.data('last-key', 13);
}).attr('placeholder', EM.geo_placeholder);
});
}
jQuery(document).bind('em_maps_loaded', function(){ em_geo_search_init(); });

View File

@ -0,0 +1,23 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START General Search -->
<div class="em-search-geo em-search-field">
<?php
/* This general search will find matches within event_name, event_notes, and the location_name, address, town, state and country. */
?>
<label>
<span class="screen-reader-text"><?php echo esc_html($args['geo_label']); ?></span>
<input type="text" name="geo" class="em-search-geo" value="<?php echo esc_attr($args['geo']); ?>"/>
</label>
<input type="hidden" name="near" class="em-search-geo-coords" value="<?php echo esc_attr($args['near']); ?>" />
<div id="em-search-geo-attr" ></div>
<script type="text/javascript">
EM.geo_placeholder = '<?php echo esc_attr($args['geo_label']); ?>';
EM.geo_alert_guess = '<?php esc_attr_e('We are going to use %s for searching.','events-manager'); ?> \n\n <?php esc_attr_e('If this is incorrect, click cancel and try a more specific address.','events-manager') ?>';
<?php
//include separately, which allows you to just modify the html or completely override the JS
em_locate_template('templates/search/geo.js',true);
?>
</script>
</div>
<!-- END General Search -->

View File

@ -0,0 +1,27 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START Country Search -->
<div class="em-search-country em-search-field">
<label>
<span><?php echo esc_html($args['country_label']); ?></span>
<select name="country" class="em-search-country em-events-search-country">
<option value=''><?php echo esc_html($args['countries_label']); ?></option>
<?php
//get the counties from locations table
global $wpdb;
$countries = em_get_countries();
$em_countries = $wpdb->get_results("SELECT DISTINCT location_country FROM ".EM_LOCATIONS_TABLE." WHERE location_country IS NOT NULL AND location_country != '' AND location_status=1 ORDER BY location_country ASC", ARRAY_N);
$ddm_countries = array();
//filter out location countries so they're valid records (hence no sanitization)
foreach($em_countries as $em_country){
$ddm_countries[$em_country[0]] = $countries[$em_country[0]];
}
asort($ddm_countries);
foreach( $ddm_countries as $country_code => $country_name ):
//we're not using esc_ functions here because values are hard-coded within em_get_countries()
?>
<option value="<?php echo $country_code; ?>"<?php echo (!empty($args['country']) && $args['country'] == $country_code) ? ' selected="selected"':''; ?>><?php echo $country_name; ?></option>
<?php endforeach; ?>
</select>
</label>
</div>
<!-- END Country Search -->

View File

@ -0,0 +1,24 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START Region Search -->
<div class="em-search-region em-search-field">
<label>
<span><?php echo esc_html($args['region_label']); ?></span>
<select name="region" class="em-search-region em-events-search-region">
<option value=''><?php echo esc_html(get_option('dbem_search_form_regions_label')); ?></option>
<?php
global $wpdb;
$em_states = $cond = array();
if( !empty($args['country']) ) $cond[] = $wpdb->prepare("AND location_country=%s", $args['country']);
if( !empty($cond) || empty($args['search_countries']) ){ //get specific country regions or all regions if no country fields exists
$em_states = $wpdb->get_results("SELECT DISTINCT location_region FROM ".EM_LOCATIONS_TABLE." WHERE location_region IS NOT NULL AND location_region != '' AND location_status=1 ".implode(' ', $cond)." ORDER BY location_region", ARRAY_N);
}
foreach($em_states as $region){
?>
<option<?php echo (!empty($args['region']) && $args['region'] == $region[0]) ? ' selected="selected"':''; ?>><?php echo esc_html($region[0]); ?></option>
<?php
}
?>
</select>
</label>
</div>
<!-- END Region Search -->

View File

@ -0,0 +1,25 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START State/County Search -->
<div class="em-search-state em-search-field">
<label>
<span><?php echo esc_html($args['state_label']); ?></span>
<select name="state" class="em-search-state em-events-search-state">
<option value=''><?php echo esc_html(get_option('dbem_search_form_states_label')); ?></option>
<?php
global $wpdb;
$em_states = $cond = array();
if( !empty($args['country']) ) $cond[] = $wpdb->prepare("AND location_country=%s", $args['country']);
if( !empty($args['region']) ) $cond[] = $wpdb->prepare("AND location_region=%s", $args['region']);
if( !empty($cond) || empty($args['search_countries']) ){ //get specific states, whether restricted by country/region or all states if no country field is displayed
$em_states = $wpdb->get_results("SELECT DISTINCT location_state FROM ".EM_LOCATIONS_TABLE." WHERE location_state IS NOT NULL AND location_state != '' AND location_status=1 ".implode(' ', $cond)." ORDER BY location_state", ARRAY_N);
}
foreach($em_states as $state){
?>
<option<?php echo (!empty($args['state']) && $args['state'] == $state[0]) ? ' selected="selected"':''; ?>><?php echo esc_html($state[0]); ?></option>
<?php
}
?>
</select>
</label>
</div>
<!-- END State/County Search -->

View File

@ -0,0 +1,26 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START City Search -->
<div class="em-search-town em-search-field">
<label>
<span><?php echo esc_html($args['town_label']); ?></span>
<select name="town" class="em-search-town em-events-search-town">
<option value=''><?php echo esc_html(get_option('dbem_search_form_towns_label')); ?></option>
<?php
global $wpdb;
$em_towns = $cond = array();
if( !empty($args['country']) ) $cond[] = $wpdb->prepare("AND location_country=%s", $args['country']);
if( !empty($args['region']) ) $cond[] = $wpdb->prepare("AND location_region=%s", $args['region']);
if( !empty($args['state']) ) $cond[] = $wpdb->prepare(" AND location_state=%s ", $args['state']);
if( !empty($cond) || empty($args['search_countries']) ){ //get specific towns, whether restricted by country/region/state or all towns if no country field is displayed
$em_towns = $wpdb->get_results("SELECT DISTINCT location_town FROM ".EM_LOCATIONS_TABLE." WHERE location_town IS NOT NULL AND location_town != '' AND location_status=1 ".implode(' ', $cond)." ORDER BY location_town", ARRAY_N);
}
foreach($em_towns as $town){
?>
<option<?php echo (!empty($args['town']) && $args['town'] == $town[0]) ? ' selected="selected"':''; ?>><?php echo esc_html($town[0]); ?></option>
<?php
}
?>
</select>
</label>
</div>
<!-- END City Search -->

View File

@ -0,0 +1,18 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<div class="em-search-location" <?php if( !empty($args['search_geo']) && !empty($args['geo']) && !empty($args['near']) ): ?>style="display:none;"<?php endif; /* show location fields if no geo search is made */ ?>>
<?php
//figure out if we have a default country or one submitted via search
if( !empty($args['search_countries']) ){
em_locate_template('templates/search/location-countries.php',true,array('args'=>$args));
}else{
?><input type="hidden" name="country" value="<?php echo esc_attr($args['country']); ?>" /><?php
}
?>
<div class="em-search-location-meta" <?php if( empty($args['country']) && !empty($args['search_countries']) ): ?>style="display:none;"<?php endif; /* show location meta if country field has value or not shown */ ?>>
<?php
if( !empty($args['search_regions']) ) em_locate_template('templates/search/location-regions.php',true,array('args'=>$args));
if( !empty($args['search_states']) ) em_locate_template('templates/search/location-states.php',true,array('args'=>$args));
if( !empty($args['search_towns']) ) em_locate_template('templates/search/location-towns.php',true,array('args'=>$args));
?>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php $args = !empty($args) ? $args:array(); /* @var $args array */ ?>
<!-- START Date Search -->
<div class="em-search-scope em-search-field">
<span class="em-search-scope em-events-search-dates em-date-range">
<label>
<span><?php echo esc_html($args['scope_label']); ?></span>
<input type="text" class="em-date-input-loc em-date-start" />
<input type="hidden" class="em-date-input" name="scope[0]" value="<?php echo esc_attr($args['scope'][0]); ?>" />
</label>
<label>
<?php echo esc_html($args['scope_seperator']); ?>
<input type="text" class="em-date-input-loc em-date-end" />
<input type="hidden" class="em-date-input" name="scope[1]" value="<?php echo esc_attr($args['scope'][1]); ?>" />
</label>
</span>
</div>
<!-- END Date Search -->

View File

@ -0,0 +1,15 @@
<?php
/* This general search will find matches within event_name, event_notes, and the location_name, address, town, state and country. */
$args = !empty($args) ? $args:array(); /* @var $args array */
?>
<!-- START General Search -->
<div class="em-search-text em-search-field">
<script type="text/javascript">
EM.search_term_placeholder = '<?php echo esc_attr($args['search_term_label']); ?>';
</script>
<label>
<span class="screen-reader-text"><?php echo esc_html($args['search_term_label']); ?></span>
<input type="text" name="em_search" class="em-events-search-text em-search-text" value="<?php echo esc_attr($args['search']); ?>" />
</label>
</div>
<!-- END General Search -->

View File

@ -0,0 +1,12 @@
<?php
/*
* This page displays a single event, called during the em_content() if this is an event page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*/
global $EM_Tag;
/* @var $EM_Tag EM_Tag */
echo $EM_Tag->output_single();
?>

View File

@ -0,0 +1,17 @@
<?php
/*
* Default tags List Template
* This page displays a list of locations, called during the em_content() if this is an events list page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display locations (or whatever) however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Locations::output()
*
*/
$args = apply_filters('em_content_tags_args', $args);
if( get_option('dbem_css_taglist') ) echo "<div class='css-tags-list'>";
echo EM_Tags::output( $args );
if( get_option('dbem_css_taglist') ) echo "</div>";

View File

@ -1,5 +1,5 @@
/*
Theme Name: Your Theme Name
Theme Name: Leon Corre Theme
Theme URI: https://yourwebsite.com
Author: Your Name
Author URI: https://yourwebsite.com
@ -10,4 +10,50 @@
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags:
Text Domain: twentyseventeen-child
*/
*/
@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab');
body,
button,
input,
select,
textarea {
color: #333;
/*font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif;*/
font-family:"Roboto Slab",arial !important;
font-size: 15px;
font-size: 0.9375rem;
font-weight: 400;
line-height: 1.66;
}
p {
font-family:"Roboto",arial !important;
text-align:justify !important;
}
p.site-description {text-align:center !important;}
select {width:100%;}
ul,
ol {padding: 0 50px; }
li {padding:5px;}
.elementor-widget-heading .elementor-heading-title {color:#000 !important;}
/*.wrap {padding:30px !important;}*/
.page.page-one-column .entry-header, .twentyseventeen-front-page.page-one-column .entry-header, .archive.page-one-column:not(.has-sidebar) .page-header {margin-bottom:1em !important;}
.custom-logo {width:200px !important;height:auto !important;max-height:1000px !important;}
.main-navigation a:hover,
a
{ color:#008000;}
.page .panel-content .entry-title, .page-title, body.page:not(.twentyseventeen-front-page) .entry-title
{color: #000000;
font-family:"Libre Franklin", "Helvetica Neue", helvetica;
}
.elementor-divider-separator {border:2px solid #008000 !important;}
strong {color:#008000;}
button, input[type="button"], input[type="submit"]
{background-color:#008000;}
h2 {font-weight:500;color:#008000;}
.navigation-top {bottom:auto !important; top:0 !important; }

View File

@ -0,0 +1,32 @@
<?php
/**
* Displays footer widgets if assigned
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<?php
if ( is_active_sidebar( 'sidebar-2' ) ||
is_active_sidebar( 'sidebar-3' ) ) :
?>
<aside class="widget-area" role="complementary">
<?php
if ( is_active_sidebar( 'sidebar-2' ) ) { ?>
<div class="widget-column footer-widget-1">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div>
<?php }
if ( is_active_sidebar( 'sidebar-3' ) ) { ?>
<div class="widget-column footer-widget-2">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div>
<?php } ?>
</aside><!-- .widget-area -->
<?php endif; ?>

View File

@ -0,0 +1,14 @@
<?php
/**
* Displays footer site info
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<div class="site-info">
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyseventeen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyseventeen' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->

View File

@ -0,0 +1,20 @@
<?php
/**
* Displays header media
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<div class="custom-header">
<div class="custom-header-media">
<?php the_custom_header_markup(); ?>
</div>
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</div><!-- .custom-header -->

View File

@ -0,0 +1,38 @@
<?php
/**
* Displays header site branding
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<div class="site-branding">
<div class="wrap">
<div class="site-branding-logo" style="text-align:center;">
<?php the_custom_logo(); ?>
</div>
<div class="site-branding-text" style="text-align:center;width:100%;">
<?php if ( is_front_page() ) : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif; ?>
<?php
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $description; ?></p>
<?php endif; ?>
</div><!-- .site-branding-text -->
<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && ! has_nav_menu( 'top' ) ) : ?>
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
<?php endif; ?>
</div><!-- .wrap -->
</div><!-- .site-branding -->

View File

@ -0,0 +1,29 @@
<?php
/**
* Displays top navigation
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'twentyseventeen' ); ?>">
<button class="menu-toggle" aria-controls="top-menu" aria-expanded="false">
<?php
echo twentyseventeen_get_svg( array( 'icon' => 'bars' ) );
echo twentyseventeen_get_svg( array( 'icon' => 'close' ) );
_e( 'Menu', 'twentyseventeen' );
?>
</button>
<?php wp_nav_menu( array(
'theme_location' => 'top',
'menu_id' => 'top-menu',
) ); ?>
<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?>
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
<?php endif; ?>
</nav><!-- #site-navigation -->

View File

@ -0,0 +1,79 @@
<?php
/**
* Template part for displaying pages on front page
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
global $twentyseventeencounter;
?>
<article id="panel<?php echo $twentyseventeencounter; ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> >
<?php if ( has_post_thumbnail() ) :
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
// Calculate aspect ratio: h / w * 100%.
$ratio = $thumbnail[2] / $thumbnail[1] * 100;
?>
<div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);">
<div class="panel-image-prop" style="padding-top: <?php echo esc_attr( $ratio ); ?>%"></div>
</div><!-- .panel-image -->
<?php endif; ?>
<span id="<?php echo get_post()->post_name; ?>" style="margin-bottom:20px;"></span>
<div class="panel-content">
<div class="wrap">
<header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php twentyseventeen_edit_link( get_the_ID() ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
?>
</div><!-- .entry-content -->
<?php
// Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int).
if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : ?>
<?php // Show four most recent posts.
$recent_posts = new WP_Query( array(
'posts_per_page' => 3,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'no_found_rows' => true,
) );
?>
<?php if ( $recent_posts->have_posts() ) : ?>
<div class="recent-posts">
<?php
while ( $recent_posts->have_posts() ) : $recent_posts->the_post();
get_template_part( 'template-parts/post/content', 'excerpt' );
endwhile;
wp_reset_postdata();
?>
</div><!-- .recent-posts -->
<?php endif; ?>
<?php endif; ?>
</div><!-- .wrap -->
</div><!-- .panel-content -->
</article><!-- #post-## -->

View File

@ -0,0 +1,53 @@
<?php
/**
* Displays content for front page
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> >
<?php if ( has_post_thumbnail() ) :
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
// Calculate aspect ratio: h / w * 100%.
$ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100;
?>
<div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);">
<div class="panel-image-prop" style="padding-top: <?php echo esc_attr( $ratio ); ?>%"></div>
</div><!-- .panel-image -->
<?php endif; ?>
<div class="panel-content">
<div class="wrap">
<header class="entry-header" style="">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php twentyseventeen_edit_link( get_the_ID() ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
?>
</div><!-- .entry-content -->
</div><!-- .wrap -->
</div><!-- .panel-content -->
</article><!-- #post-## -->

View File

@ -0,0 +1,30 @@
<?php
/**
* Template part for displaying page content in page.php
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php twentyseventeen_edit_link( get_the_ID() ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->

View File

@ -0,0 +1,105 @@
<?php
/**
* Template part for displaying audio posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() && is_home() ) {
echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
}
?>
<header class="entry-header">
<?php
if ( 'post' === get_post_type() ) {
echo '<div class="entry-meta">';
if ( is_single() ) {
twentyseventeen_posted_on();
} else {
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
};
echo '</div><!-- .entry-meta -->';
};
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}
?>
</header><!-- .entry-header -->
<?php
$content = apply_filters( 'the_content', get_the_content() );
$audio = false;
// Only get audio from the content if a playlist isn't present.
if ( false === strpos( $content, 'wp-playlist-script' ) ) {
$audio = get_media_embedded_in_content( $content, array( 'audio' ) );
}
?>
<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
</a>
</div><!-- .post-thumbnail -->
<?php endif; ?>
<div class="entry-content">
<?php
if ( ! is_single() ) {
// If not a single post, highlight the audio file.
if ( ! empty( $audio ) ) {
foreach ( $audio as $audio_html ) {
echo '<div class="entry-audio">';
echo $audio_html;
echo '</div><!-- .entry-audio -->';
}
};
};
if ( is_single() || empty( $audio ) ) {
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
'after' => '</div>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
) );
};
?>
</div><!-- .entry-content -->
<?php
if ( is_single() ) {
twentyseventeen_entry_footer();
}
?>
</article><!-- #post-## -->

View File

@ -0,0 +1,46 @@
<?php
/**
* Template part for displaying posts with excerpts
*
* Used in Search Results and for Recent Posts in Front Page panels.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
?>
</div><!-- .entry-meta -->
<?php elseif ( 'page' === get_post_type() && get_edit_post_link() ) : ?>
<div class="entry-meta">
<?php twentyseventeen_edit_link(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php if ( is_front_page() && ! is_home() ) {
// The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
} else {
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
} ?>
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
</article><!-- #post-## -->

View File

@ -0,0 +1,92 @@
<?php
/**
* Template part for displaying gallery posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() && is_home() ) {
echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
}
?>
<header class="entry-header">
<?php
if ( 'post' === get_post_type() ) {
echo '<div class="entry-meta">';
if ( is_single() ) {
twentyseventeen_posted_on();
} else {
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
};
echo '</div><!-- .entry-meta -->';
};
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}
?>
</header><!-- .entry-header -->
<?php if ( '' !== get_the_post_thumbnail() && ! is_single() && ! get_post_gallery() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
</a>
</div><!-- .post-thumbnail -->
<?php endif; ?>
<div class="entry-content">
<?php
if ( ! is_single() ) {
// If not a single post, highlight the gallery.
if ( get_post_gallery() ) {
echo '<div class="entry-gallery">';
echo get_post_gallery();
echo '</div>';
};
};
if ( is_single() || ! get_post_gallery() ) {
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
'after' => '</div>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
) );
};
?>
</div><!-- .entry-content -->
<?php
if ( is_single() ) {
twentyseventeen_entry_footer();
}
?>
</article><!-- #post-## -->

View File

@ -0,0 +1,81 @@
<?php
/**
* Template part for displaying image posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() && is_home() ) {
echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
}
?>
<header class="entry-header">
<?php
if ( 'post' === get_post_type() ) {
echo '<div class="entry-meta">';
if ( is_single() ) {
twentyseventeen_posted_on();
} else {
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
};
echo '</div><!-- .entry-meta -->';
};
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}
?>
</header><!-- .entry-header -->
<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
</a>
</div><!-- .post-thumbnail -->
<?php endif; ?>
<div class="entry-content">
<?php if ( is_single() || '' === get_the_post_thumbnail() ) {
// Only show content if is a single post, or if there's no featured image.
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
'after' => '</div>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
) );
};
?>
</div><!-- .entry-content -->
<?php
if ( is_single() ) {
twentyseventeen_entry_footer();
}
?>
</article><!-- #post-## -->

View File

@ -0,0 +1,33 @@
<?php
/**
* Template part for displaying a message that posts cannot be found
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Nothing Found', 'twentyseventeen' ); ?></h1>
</header>
<div class="page-content">
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyseventeen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyseventeen' ); ?></p>
<?php
get_search_form();
endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -0,0 +1,103 @@
<?php
/**
* Template part for displaying video posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.2
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() && is_home() ) {
echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
}
?>
<header class="entry-header">
<?php
if ( 'post' === get_post_type() ) {
echo '<div class="entry-meta">';
if ( is_single() ) {
twentyseventeen_posted_on();
} else {
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
}
echo '</div><!-- .entry-meta -->';
};
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}
?>
</header><!-- .entry-header -->
<?php
$content = apply_filters( 'the_content', get_the_content() );
$video = false;
// Only get video from the content if a playlist isn't present.
if ( false === strpos( $content, 'wp-playlist-script' ) ) {
$video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
}
?>
<?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
</a>
</div><!-- .post-thumbnail -->
<?php endif; ?>
<div class="entry-content">
<?php
if ( ! is_single() ) {
// If not a single post, highlight the video file.
if ( ! empty( $video ) ) {
foreach ( $video as $video_html ) {
echo '<div class="entry-video">';
echo $video_html;
echo '</div>';
}
};
};
if ( is_single() || empty( $video ) ) {
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
) );
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
'after' => '</div>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
) );
};
?>
</div><!-- .entry-content -->
<?php
if ( is_single() ) {
twentyseventeen_entry_footer();
}
?>
</article><!-- #post-## -->

Some files were not shown because too many files have changed in this diff Show More