コード例 #1
0
ファイル: em-booking.php プロジェクト: aivar11/events-manager
 function output($format, $target = "html")
 {
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $format, $placeholders);
     foreach ($this->get_tickets() as $EM_Ticket) {
         /* @var $EM_Ticket EM_Ticket */
         break;
     }
     //Get first ticket for single ticket placeholders
     $output_string = $format;
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_BOOKINGID':
                 $replace = $this->booking_id;
                 break;
             case '#_RESPNAME':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGNAME':
                 $replace = $this->get_person()->get_name();
                 break;
             case '#_RESPEMAIL':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGEMAIL':
                 $replace = $this->get_person()->user_email;
                 break;
             case '#_RESPPHONE':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGPHONE':
                 $replace = $this->get_person()->phone;
                 break;
             case '#_BOOKINGSPACES':
                 $replace = $this->get_spaces();
                 break;
             case '#_BOOKINGDATE':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_date_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGTIME':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_time_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGDATETIME':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_date_format') . ' ' . get_option('dbem_time_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGLISTURL':
                 $replace = em_get_my_bookings_url();
                 break;
             case '#_COMMENT':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGCOMMENT':
                 $replace = $this->booking_comment;
                 break;
                 $replace = $this->get_price(true);
                 //if there's tax, it'll be added here
                 break;
             case '#_BOOKINGPRICEWITHOUTTAX':
                 $replace = $this->format_price($this->get_price() - $this->get_price_taxes());
                 break;
             case '#_BOOKINGPRICETAX':
                 $replace = $this->get_price_taxes(true);
                 break;
             case '#_BOOKINGPRICEWITHTAX':
             case '#_BOOKINGPRICE':
                 $replace = $this->get_price(true);
                 break;
             case '#_BOOKINGTICKETNAME':
                 $replace = $EM_Ticket->name;
                 break;
             case '#_BOOKINGTICKETDESCRIPTION':
                 $replace = $EM_Ticket->description;
                 break;
             case '#_BOOKINGTICKETPRICEWITHTAX':
                 $replace = $this->format_price($EM_Ticket->get_price_without_tax() * (1 + $this->get_tax_rate() / 100));
                 break;
             case '#_BOOKINGTICKETPRICEWITHOUTTAX':
                 $replace = $EM_Ticket->get_price_without_tax(true);
                 break;
             case '#_BOOKINGTICKETTAX':
                 $replace = $this->format_price($EM_Ticket->get_price_without_tax() * ($this->get_tax_rate() / 100));
                 break;
             case '#_BOOKINGTICKETPRICE':
                 $replace = $EM_Ticket->get_price(true);
                 break;
             case '#_BOOKINGTICKETS':
                 ob_start();
                 em_locate_template('emails/bookingtickets.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             case '#_BOOKINGSUMMARY':
                 ob_start();
                 em_locate_template('emails/bookingsummary.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             default:
                 $replace = $full_result;
                 break;
         }
         $replaces[$full_result] = apply_filters('em_booking_output_placeholder', $replace, $this, $full_result, $target);
     }
     //sort out replacements so that during replacements shorter placeholders don't overwrite longer varieties.
     krsort($replaces);
     foreach ($replaces as $full_result => $replacement) {
         $output_string = str_replace($full_result, $replacement, $output_string);
     }
     //run event output too, since this is never run from within events and will not infinitely loop
     $output_string = $this->get_event()->output($output_string, $target);
     return apply_filters('em_booking_output', $output_string, $this, $format, $target);
 }
コード例 #2
0
ファイル: bookingform.php プロジェクト: pcco/portal-redesign
// 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>
コード例 #3
0
ファイル: em-install.php プロジェクト: sajjadalisiddiqui/cms
function em_add_options()
{
    global $wp_locale;
    $decimal_point = !empty($wp_locale->number_format['decimal_point']) ? $wp_locale->number_format['decimal_point'] : '.';
    $thousands_sep = !empty($wp_locale->number_format['thousands_sep']) ? $wp_locale->number_format['thousands_sep'] : ',';
    $email_footer = '<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com';
    $respondent_email_body_localizable = __("Dear #_BOOKINGNAME, <br/>You have successfully reserved #_BOOKINGSPACES space/spaces for #_EVENTNAME.<br/>When : #_EVENTDATES @ #_EVENTTIMES<br/>Where : #_LOCATIONNAME - #_LOCATIONFULLLINE<br/>Yours faithfully,<br/>#_CONTACTNAME", 'dbem') . $email_footer;
    $respondent_email_pending_body_localizable = __("Dear #_BOOKINGNAME, <br/>You have requested #_BOOKINGSPACES space/spaces for #_EVENTNAME.<br/>When : #_EVENTDATES @ #_EVENTTIMES<br/>Where : #_LOCATIONNAME - #_LOCATIONFULLLINE<br/>Your booking is currently pending approval by our administrators. Once approved you will receive an automatic confirmation.<br/>Yours faithfully,<br/>#_CONTACTNAME", 'dbem') . $email_footer;
    $respondent_email_rejected_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_EVENTNAME on #_EVENTDATES has been rejected.<br/>Yours faithfully,<br/>#_CONTACTNAME", 'dbem') . $email_footer;
    $respondent_email_cancelled_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_EVENTNAME on #_EVENTDATES has been cancelled.<br/>Yours faithfully,<br/>#_CONTACTNAME", 'dbem') . $email_footer;
    $event_approved_email_body = __("Dear #_CONTACTNAME, <br/>Your event #_EVENTNAME on #_EVENTDATES has been approved.<br/>You can view your event here: #_EVENTURL", 'dbem') . $email_footer;
    $event_submitted_email_body = __("A new event has been submitted by #_CONTACTNAME.<br/>Name : #_EVENTNAME <br/>Date : #_EVENTDATES <br/>Time : #_EVENTTIMES <br/>Please visit #_EDITEVENTURL to review this event for approval.", 'dbem') . $email_footer;
    $event_submitted_email_body = str_replace('#_EDITEVENTURL', admin_url() . 'post.php?action=edit&post=#_EVENTPOSTID', $event_submitted_email_body);
    $event_published_email_body = __("A new event has been published by #_CONTACTNAME.<br/>Name : #_EVENTNAME <br/>Date : #_EVENTDATES <br/>Time : #_EVENTTIMES <br/>Edit this event - #_EDITEVENTURL <br/> View this event - #_EVENTURL", 'dbem') . $email_footer;
    $event_published_email_body = str_replace('#_EDITEVENTURL', admin_url() . 'post.php?action=edit&post=#_EVENTPOSTID', $event_published_email_body);
    $event_resubmitted_email_body = __("A previously published event has been modified by #_CONTACTNAME, and this event is now unpublished and pending your approval.<br/>Name : #_EVENTNAME <br/>Date : #_EVENTDATES <br/>Time : #_EVENTTIMES <br/>Please visit #_EDITEVENTURL to review this event for approval.", 'dbem') . $email_footer;
    $event_resubmitted_email_body = str_replace('#_EDITEVENTURL', admin_url() . 'post.php?action=edit&post=#_EVENTPOSTID', $event_resubmitted_email_body);
    //event admin emails - new format to the above, standard format plus one unique line per booking status at the top of the body and subject line
    $contact_person_email_body_template = '#_EVENTNAME - #_EVENTDATES @ #_EVENTTIMES' . '<br/>' . __('Now there are #_BOOKEDSPACES spaces reserved, #_AVAILABLESPACES are still available.', 'dbem') . '<br/>' . strtoupper(__('Booking Details', 'dbem')) . '<br/>' . __('Name', 'dbem') . ' : #_BOOKINGNAME' . "\n" . __('Email', 'dbem') . ' : #_BOOKINGEMAIL' . '<br/>' . '#_BOOKINGSUMMARY' . '<br/>' . '<br/>Powered by Events Manager - http://wp-events-plugin.com';
    $contact_person_emails['confirmed'] = sprintf(__('The following booking is %s :', 'dbem'), strtolower(__('Confirmed', 'dbem'))) . '<br/>' . $contact_person_email_body_template;
    $contact_person_emails['pending'] = sprintf(__('The following booking is %s :', 'dbem'), strtolower(__('Pending', 'dbem'))) . '<br/>' . $contact_person_email_body_template;
    $contact_person_emails['cancelled'] = sprintf(__('The following booking is %s :', 'dbem'), strtolower(__('Cancelled', 'dbem'))) . '<br/>' . $contact_person_email_body_template;
    $contact_person_emails['rejected'] = sprintf(__('The following booking is %s :', 'dbem'), strtolower(__('Rejected', 'dbem'))) . '<br/>' . $contact_person_email_body_template;
    //registration email content
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    $booking_registration_email_subject = sprintf(__('[%s] Your username and password', 'dbem'), $blogname);
    $booking_registration_email_body = sprintf(__('You have successfully created an account at %s', 'dbem'), $blogname) . '<br/>' . sprintf(__('You can log into our site here : %s', 'dbem'), get_bloginfo('wpurl') . '/wp-login.php') . '<br/>' . __('Username', 'dbem') . ' : %username%' . '<br/>' . __('Password', 'dbem') . ' : %password%' . '<br/>' . sprintf(__('To view your bookings, please visit %s after logging in.', 'dbem'), em_get_my_bookings_url());
    //all the options
    $dbem_options = array('dbem_time_format' => get_option('time_format'), 'dbem_date_format' => 'd/m/Y', 'dbem_date_format_js' => 'dd/mm/yy', 'dbem_dates_separator' => ' - ', 'dbem_times_separator' => ' - ', 'dbem_default_category' => 0, 'dbem_default_location' => 0, 'dbem_events_default_orderby' => 'event_start_date,event_start_time,event_name', 'dbem_events_default_order' => 'ASC', 'dbem_events_default_limit' => 10, 'dbem_search_form_submit' => __('Search', 'dbem'), 'dbem_search_form_advanced' => 1, 'dbem_search_form_advanced_hidden' => 1, 'dbem_search_form_advanced_show' => __('Show Advanced Search', 'dbem'), 'dbem_search_form_advanced_hide' => __('Hide Advanced Search', 'dbem'), 'dbem_search_form_text' => 1, 'dbem_search_form_text_label' => __('Search', 'dbem'), 'dbem_search_form_geo' => 1, 'dbem_search_form_geo_label' => __('Near...', 'dbem'), 'dbem_search_form_geo_units' => 1, 'dbem_search_form_geo_units_label' => __('Within', 'dbem'), 'dbem_search_form_geo_unit_default' => 'mi', 'dbem_search_form_geo_distance_default' => 25, 'dbem_search_form_geo_distance_options' => '5,10,25,50,100', 'dbem_search_form_dates' => 1, 'dbem_search_form_dates_label' => __('Dates', 'dbem'), 'dbem_search_form_dates_separator' => __('and', 'dbem'), 'dbem_search_form_categories' => 1, 'dbem_search_form_categories_label' => __('All Categories', 'dbem'), 'dbem_search_form_category_label' => __('Category', 'dbem'), 'dbem_search_form_countries' => 1, 'dbem_search_form_default_country' => get_option('dbem_location_default_country', ''), 'dbem_search_form_countries_label' => __('All Countries', 'dbem'), 'dbem_search_form_country_label' => __('Country', 'dbem'), 'dbem_search_form_regions' => 1, 'dbem_search_form_regions_label' => __('All Regions', 'dbem'), 'dbem_search_form_region_label' => __('Region', 'dbem'), 'dbem_search_form_states' => 1, 'dbem_search_form_states_label' => __('All States', 'dbem'), 'dbem_search_form_state_label' => __('State/County', 'dbem'), 'dbem_search_form_towns' => 0, 'dbem_search_form_towns_label' => __('All Cities/Towns', 'dbem'), 'dbem_search_form_town_label' => __('City/Town', 'dbem'), 'dbem_events_form_editor' => 1, 'dbem_events_form_reshow' => 1, 'dbem_events_form_result_success' => __('You have successfully submitted your event, which will be published pending approval.', 'dbem'), 'dbem_events_form_result_success_updated' => __('You have successfully updated your event, which will be republished pending approval.', 'dbem'), 'dbem_events_anonymous_submissions' => 0, 'dbem_events_anonymous_user' => 0, 'dbem_events_anonymous_result_success' => __('You have successfully submitted your event, which will be published pending approval.', 'dbem'), 'dbem_event_submitted_email_admin' => '', 'dbem_event_submitted_email_subject' => __('Submitted Event Awaiting Approval', 'dbem'), 'dbem_event_submitted_email_body' => str_replace("<br/>", "\n\r", $event_submitted_email_body), 'dbem_event_resubmitted_email_subject' => __('Re-Submitted Event Awaiting Approval', 'dbem'), 'dbem_event_resubmitted_email_body' => str_replace("<br/>", "\n\r", $event_resubmitted_email_body), 'dbem_event_published_email_subject' => __('Published Event', 'dbem') . ' - #_EVENTNAME', 'dbem_event_published_email_body' => str_replace("<br/>", "\n\r", $event_published_email_body), 'dbem_event_approved_email_subject' => __("Event Approved", 'dbem') . " - #_EVENTNAME", 'dbem_event_approved_email_body' => str_replace("<br/>", "\n\r", $event_approved_email_body), 'dbem_event_reapproved_email_subject' => __("Event Approved", 'dbem') . " - #_EVENTNAME", 'dbem_event_reapproved_email_body' => str_replace("<br/>", "\n\r", $event_approved_email_body), 'dbem_events_page_title' => __('Events', 'dbem'), 'dbem_events_page_scope' => 'future', 'dbem_events_page_search_form' => 1, 'dbem_event_list_item_format_header' => '<table cellpadding="0" cellspacing="0" class="events-table" >
    <thead>
        <tr>
			<th class="event-time" width="150">' . __('Date/Time', 'dbem') . '</th>
			<th class="event-description" width="*">' . __('Event', 'dbem') . '</th>
		</tr>
   	</thead>
    <tbody>', 'dbem_event_list_item_format' => '<tr>
			<td>
                #_EVENTDATES<br/>
                #_EVENTTIMES
            </td>
            <td>
                #_EVENTLINK
                {has_location}<br/><i>#_LOCATIONNAME, #_LOCATIONTOWN #_LOCATIONSTATE</i>{/has_location}
            </td>
        </tr>', 'dbem_event_list_item_format_footer' => '</tbody></table>', 'dbem_event_list_groupby' => 0, 'dbem_event_list_groupby_format' => '', 'dbem_event_list_groupby_header_format' => '<h2>#s</h2>', 'dbem_display_calendar_in_events_page' => 0, 'dbem_single_event_format' => '<div style="float:right; margin:0px 0px 15px 15px;">#_LOCATIONMAP</div>
<p>
	<strong>' . __('Date/Time', 'dbem') . '</strong><br/>
	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
</p>
{has_location}
<p>
	<strong>' . __('Location', 'dbem') . '</strong><br/>
	#_LOCATIONLINK
</p>
{/has_location}
<p>
	<strong>' . __('Categories', 'dbem') . '</strong>
	#_CATEGORIES
</p>
<br style="clear:both" />
#_EVENTNOTES
{has_bookings}
<h3>Bookings</h3>
#_BOOKINGFORM
{/has_bookings}', 'dbem_event_excerpt_format' => '#_EVENTDATES @ #_EVENTTIMES - #_EVENTEXCERPT', 'dbem_event_excerpt_alt_format' => '#_EVENTDATES @ #_EVENTTIMES - #_EVENTEXCERPT{55}', 'dbem_event_page_title_format' => '#_EVENTNAME', 'dbem_event_all_day_message' => __('All Day', 'dbem'), 'dbem_no_events_message' => sprintf(__('No %s', 'dbem'), __('Events', 'dbem')), 'dbem_locations_default_orderby' => 'location_name', 'dbem_locations_default_order' => 'ASC', 'dbem_locations_default_limit' => 10, 'dbem_locations_page_title' => __('Event', 'dbem') . " " . __('Locations', 'dbem'), 'dbem_locations_page_search_form' => 1, 'dbem_no_locations_message' => sprintf(__('No %s', 'dbem'), __('Locations', 'dbem')), 'dbem_location_default_country' => '', 'dbem_location_list_item_format_header' => '<ul class="em-locations-list">', 'dbem_location_list_item_format' => '<li>#_LOCATIONLINK<ul><li>#_LOCATIONFULLLINE</li></ul></li>', 'dbem_location_list_item_format_footer' => '</ul>', 'dbem_location_page_title_format' => '#_LOCATIONNAME', 'dbem_single_location_format' => '<div style="float:right; margin:0px 0px 15px 15px;">#_LOCATIONMAP</div>
<p>
	<strong>' . __('Address', 'dbem') . '</strong><br/>
	#_LOCATIONADDRESS<br/>
	#_LOCATIONTOWN<br/>
	#_LOCATIONSTATE<br/>
	#_LOCATIONREGION<br/>
	#_LOCATIONPOSTCODE<br/>
	#_LOCATIONCOUNTRY
</p>
<br style="clear:both" />
#_LOCATIONNOTES

<h3>' . __('Upcoming Events', 'dbem') . '</h3>
<p>#_LOCATIONNEXTEVENTS</p>', 'dbem_location_excerpt_format' => '#_LOCATIONEXCERPT', 'dbem_location_excerpt_alt_format' => '#_LOCATIONEXCERPT{55}', 'dbem_location_no_events_message' => '<li>' . __('No events in this location', 'dbem') . '</li>', 'dbem_location_event_list_item_header_format' => "<ul>", 'dbem_location_event_list_item_format' => "<li>#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES</li>", 'dbem_location_event_list_item_footer_format' => "</ul>", 'dbem_location_event_list_limit' => 20, 'dbem_location_event_single_format' => '#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES', 'dbem_location_no_event_message' => __('No events in this location', 'dbem'), 'dbem_categories_default_limit' => 10, 'dbem_categories_default_orderby' => 'name', 'dbem_categories_default_order' => 'ASC', 'dbem_categories_list_item_format_header' => '<ul class="em-categories-list">', 'dbem_categories_list_item_format' => '<li>#_CATEGORYLINK</li>', 'dbem_categories_list_item_format_footer' => '</ul>', 'dbem_no_categories_message' => sprintf(__('No %s', 'dbem'), __('Categories', 'dbem')), 'dbem_category_page_title_format' => '#_CATEGORYNAME', 'dbem_category_page_format' => '#_CATEGORYNOTES<h3>' . __('Upcoming Events', 'dbem') . '</h3>#_CATEGORYNEXTEVENTS', 'dbem_category_no_events_message' => '<li>' . __('No events in this category', 'dbem') . '</li>', 'dbem_category_event_list_item_header_format' => '<ul>', 'dbem_category_event_list_item_format' => "<li>#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES</li>", 'dbem_category_event_list_item_footer_format' => '</ul>', 'dbem_category_event_list_limit' => 20, 'dbem_category_event_single_format' => '#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES', 'dbem_category_no_event_message' => __('No events in this category', 'dbem'), 'dbem_category_default_color' => '#a8d144', 'dbem_tags_default_limit' => 10, 'dbem_tags_default_orderby' => 'name', 'dbem_tags_default_order' => 'ASC', 'dbem_tags_list_item_format_header' => '<ul class="em-tags-list">', 'dbem_tags_list_item_format' => '<li>#_TAGLINK</li>', 'dbem_tags_list_item_format_footer' => '</ul>', 'dbem_no_tags_message' => sprintf(__('No %s', 'dbem'), __('Tags', 'dbem')), 'dbem_tag_page_title_format' => '#_TAGNAME', 'dbem_tag_page_format' => '<h3>' . __('Upcoming Events', 'dbem') . '</h3>#_TAGNEXTEVENTS', 'dbem_tag_no_events_message' => '<li>' . __('No events with this tag', 'dbem') . '</li>', 'dbem_tag_event_list_item_header_format' => '<ul class="em-tags-list">', 'dbem_tag_event_list_item_format' => "<li>#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES</li>", 'dbem_tag_event_list_item_footer_format' => '</ul>', 'dbem_tag_event_single_format' => '#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES', 'dbem_tag_no_event_message' => __('No events with this tag', 'dbem'), 'dbem_tag_event_list_limit' => 20, 'dbem_rss_limit' => 0, 'dbem_rss_scope' => 'future', 'dbem_rss_main_title' => get_bloginfo('title') . " - " . __('Events', 'dbem'), 'dbem_rss_main_description' => get_bloginfo('description') . " - " . __('Events', 'dbem'), 'dbem_rss_description_format' => "#_EVENTDATES - #_EVENTTIMES <br/>#_LOCATIONNAME <br/>#_LOCATIONADDRESS <br/>#_LOCATIONTOWN", 'dbem_rss_title_format' => "#_EVENTNAME", 'dbem_rss_scope' => 'future', 'dbem_rss_order' => get_option('dbem_events_default_order', 'ASC'), 'dbem_rss_orderby' => get_option('dbem_events_default_orderby', 'event_start_date,event_start_time,event_name'), 'em_rss_pubdate' => date('D, d M Y H:i:s +0000'), 'dbem_ical_limit' => 0, 'dbem_ical_scope' => "future", 'dbem_ical_description_format' => "#_EVENTNAME - #_LOCATIONNAME - #_EVENTDATES - #_EVENTTIMES", 'dbem_ical_real_description_format' => "#_EVENTEXCERPT", 'dbem_ical_location_format' => "#_LOCATION", 'dbem_gmap_is_active' => 1, 'dbem_map_default_width' => '400px', 'dbem_map_default_height' => '300px', 'dbem_location_baloon_format' => '<strong>#_LOCATIONNAME</strong><br/>#_LOCATIONADDRESS - #_LOCATIONTOWN<br/><a href="#_LOCATIONPAGEURL">' . __('Events', 'dbem') . '</a>', 'dbem_map_text_format' => '<strong>#_LOCATIONNAME</strong><p>#_LOCATIONADDRESS</p><p>#_LOCATIONTOWN</p>', 'dbem_email_disable_registration' => 0, 'dbem_rsvp_mail_port' => 465, 'dbem_smtp_host' => 'localhost', 'dbem_mail_sender_name' => '', 'dbem_rsvp_mail_send_method' => 'wp_mail', 'dbem_rsvp_mail_SMTPAuth' => 1, 'dbem_smtp_html' => 1, 'dbem_smtp_html_br' => 1, 'dbem_image_max_width' => 700, 'dbem_image_max_height' => 700, 'dbem_image_min_width' => 50, 'dbem_image_min_height' => 50, 'dbem_image_max_size' => 204800, 'dbem_list_date_title' => __('Events', 'dbem') . ' - #j #M #y', 'dbem_full_calendar_month_format' => 'M Y', 'dbem_full_calendar_event_format' => '<li>#_EVENTLINK</li>', 'dbem_full_calendar_long_events' => '0', 'dbem_full_calendar_initials_length' => 0, 'dbem_full_calendar_abbreviated_weekdays' => true, 'dbem_display_calendar_day_single_yes' => 1, 'dbem_small_calendar_month_format' => 'M Y', 'dbem_small_calendar_event_title_format' => "#_EVENTNAME", 'dbem_small_calendar_event_title_separator' => ", ", 'dbem_small_calendar_initials_length' => 1, 'dbem_small_calendar_abbreviated_weekdays' => false, 'dbem_small_calendar_long_events' => '0', 'dbem_display_calendar_order' => 'ASC', 'dbem_display_calendar_orderby' => 'event_name,event_start_time', 'dbem_display_calendar_events_limit' => get_option('dbem_full_calendar_events_limit', 3), 'dbem_display_calendar_events_limit_msg' => __('more...', 'dbem'), 'dbem_calendar_direct_links' => 1, 'dbem_require_location' => 0, 'dbem_locations_enabled' => 1, 'dbem_use_select_for_locations' => 0, 'dbem_attributes_enabled' => 1, 'dbem_recurrence_enabled' => 1, 'dbem_rsvp_enabled' => 1, 'dbem_categories_enabled' => 1, 'dbem_tags_enabled' => 1, 'dbem_placeholders_custom' => '', 'dbem_location_attributes_enabled' => 1, 'dbem_location_placeholders_custom' => '', 'dbem_bookings_registration_disable' => 0, 'dbem_bookings_registration_disable_user_emails' => 0, 'dbem_bookings_registration_user' => '', 'dbem_bookings_approval' => 1, 'dbem_bookings_approval_reserved' => 0, 'dbem_bookings_approval_overbooking' => 0, 'dbem_bookings_double' => 0, 'dbem_bookings_user_cancellation' => 1, 'dbem_bookings_currency' => 'USD', 'dbem_bookings_currency_decimal_point' => $decimal_point, 'dbem_bookings_currency_thousands_sep' => $thousands_sep, 'dbem_bookings_currency_format' => '@#', 'dbem_bookings_tax' => 0, 'dbem_bookings_tax_auto_add' => 0, 'dbem_bookings_submit_button' => __('Send your booking', 'dbem'), 'dbem_bookings_login_form' => 1, 'dbem_bookings_anonymous' => 1, 'dbem_bookings_form_max' => 20, 'dbem_bookings_form_msg_disabled' => __('Online bookings are not available for this event.', 'dbem'), 'dbem_bookings_form_msg_closed' => __('Bookings are closed for this event.', 'dbem'), 'dbem_bookings_form_msg_full' => __('This event is fully booked.', 'dbem'), 'dbem_bookings_form_msg_attending' => __('You are currently attending this event.', 'dbem'), 'dbem_bookings_form_msg_bookings_link' => __('Manage my bookings', 'dbem'), 'dbem_booking_warning_cancel' => __('Are you sure you want to cancel your booking?', 'dbem'), 'dbem_booking_feedback_cancelled' => sprintf(__('Booking %s', 'dbem'), __('Cancelled', 'dbem')), 'dbem_booking_feedback_pending' => __('Booking successful, pending confirmation (you will also receive an email once confirmed).', 'dbem'), 'dbem_booking_feedback' => __('Booking successful.', 'dbem'), 'dbem_booking_feedback_full' => __('Booking cannot be made, not enough spaces available!', 'dbem'), 'dbem_booking_feedback_log_in' => __('You must log in or register to make a booking.', 'dbem'), 'dbem_booking_feedback_nomail' => __('However, there were some problems whilst sending confirmation emails to you and/or the event contact person. You may want to contact them directly and letting them know of this error.', 'dbem'), 'dbem_booking_feedback_error' => __('Booking could not be created', 'dbem') . ':', 'dbem_booking_feedback_email_exists' => __('This email already exists in our system, please log in to register to proceed with your booking.', 'dbem'), 'dbem_booking_feedback_new_user' => __('A new user account has been created for you. Please check your email for access details.', 'dbem'), 'dbem_booking_feedback_reg_error' => __('There was a problem creating a user account, please contact a website administrator.', 'dbem'), 'dbem_booking_feedback_already_booked' => __('You already have booked a seat at this event.', 'dbem'), 'dbem_booking_feedback_min_space' => __('You must request at least one space to book an event.', 'dbem'), 'dbem_booking_feedback_spaces_limit' => __('You cannot book more than %d spaces for this event.', 'dbem'), 'dbem_booking_button_msg_book' => __('Book Now', 'dbem'), 'dbem_booking_button_msg_booking' => __('Booking...', 'dbem'), 'dbem_booking_button_msg_booked' => sprintf(__('%s Submitted', 'dbem'), __('Booking', 'dbem')), 'dbem_booking_button_msg_already_booked' => __('Already Booked', 'dbem'), 'dbem_booking_button_msg_error' => sprintf(__('%s Error. Try again?', 'dbem'), __('Booking', 'dbem')), 'dbem_booking_button_msg_full' => __('Sold Out', 'dbem'), 'dbem_booking_button_msg_cancel' => __('Cancel', 'dbem'), 'dbem_booking_button_msg_canceling' => __('Canceling...', 'dbem'), 'dbem_booking_button_msg_cancelled' => __('Cancelled', 'dbem'), 'dbem_booking_button_msg_cancel_error' => sprintf(__('%s Error. Try again?', 'dbem'), __('Cancellation', 'dbem')), 'dbem_bookings_notify_admin' => 0, 'dbem_bookings_contact_email' => 1, 'dbem_bookings_contact_email_pending_subject' => __("Booking Pending", 'dbem'), 'dbem_bookings_contact_email_pending_body' => str_replace("<br/>", "\n\r", $contact_person_emails['pending']), 'dbem_bookings_contact_email_confirmed_subject' => __('Booking Confirmed', 'dbem'), 'dbem_bookings_contact_email_confirmed_body' => str_replace("<br/>", "\n\r", $contact_person_emails['confirmed']), 'dbem_bookings_contact_email_rejected_subject' => __("Booking Rejected", 'dbem'), 'dbem_bookings_contact_email_rejected_body' => str_replace("<br/>", "\n\r", $contact_person_emails['rejected']), 'dbem_bookings_contact_email_cancelled_subject' => __("Booking Cancelled", 'dbem'), 'dbem_bookings_contact_email_cancelled_body' => str_replace("<br/>", "\n\r", $contact_person_emails['cancelled']), 'dbem_bookings_email_pending_subject' => __("Booking Pending", 'dbem'), 'dbem_bookings_email_pending_body' => str_replace("<br/>", "\n\r", $respondent_email_pending_body_localizable), 'dbem_bookings_email_rejected_subject' => __("Booking Rejected", 'dbem'), 'dbem_bookings_email_rejected_body' => str_replace("<br/>", "\n\r", $respondent_email_rejected_body_localizable), 'dbem_bookings_email_confirmed_subject' => __('Booking Confirmed', 'dbem'), 'dbem_bookings_email_confirmed_body' => str_replace("<br/>", "\n\r", $respondent_email_body_localizable), 'dbem_bookings_email_cancelled_subject' => __('Booking Cancelled', 'dbem'), 'dbem_bookings_email_cancelled_body' => str_replace("<br/>", "\n\r", $respondent_email_cancelled_body_localizable), 'dbem_bookings_email_registration_subject' => $booking_registration_email_subject, 'dbem_bookings_email_registration_body' => str_replace("<br/>", "\n\r", $booking_registration_email_body), 'dbem_bookings_tickets_orderby' => 'ticket_price DESC, ticket_name ASC', 'dbem_bookings_tickets_priority' => 0, 'dbem_bookings_tickets_show_unavailable' => 0, 'dbem_bookings_tickets_show_loggedout' => 1, 'dbem_bookings_tickets_single' => 0, 'dbem_bookings_tickets_single_form' => 0, 'dbem_bookings_my_title_format' => __('My Bookings', 'dbem'), 'dbem_hello_to_user' => 1, 'dbem_bp_events_list_format_header' => '<ul class="em-events-list">', 'dbem_bp_events_list_format' => '<li>#_EVENTLINK - #_EVENTDATES - #_EVENTTIMES<ul><li>#_LOCATIONLINK - #_LOCATIONADDRESS, #_LOCATIONTOWN</li></ul></li>', 'dbem_bp_events_list_format_footer' => '</ul>', 'dbem_bp_events_list_none_format' => '<p class="em-events-list">' . __('No Events', 'dbem') . '</p>', 'dbem_css_editors' => 1, 'dbem_css_rsvp' => 1, 'dbem_css_rsvpadmin' => 1, 'dbem_css_evlist' => 1, 'dbem_css_search' => 1, 'dbem_css_loclist' => 1, 'dbem_css_catlist' => 1, 'dbem_css_taglist' => 1, 'dbem_cp_events_slug' => 'events', 'dbem_cp_locations_slug' => 'locations', 'dbem_taxonomy_category_slug' => 'events/categories', 'dbem_taxonomy_tag_slug' => 'events/tags', 'dbem_cp_events_template' => '', 'dbem_cp_events_body_class' => '', 'dbem_cp_events_post_class' => '', 'dbem_cp_events_formats' => 1, 'dbem_cp_events_has_archive' => 1, 'dbem_events_default_archive_orderby' => '_start_ts', 'dbem_events_default_archive_order' => 'ASC', 'dbem_events_archive_scope' => 'past', 'dbem_cp_events_archive_formats' => 1, 'dbem_cp_events_excerpt_formats' => 1, 'dbem_cp_events_search_results' => 0, 'dbem_cp_events_custom_fields' => 0, 'dbem_cp_events_comments' => 1, 'dbem_cp_locations_template' => '', 'dbem_cp_locations_body_class' => '', 'dbem_cp_locations_post_class' => '', 'dbem_cp_locations_formats' => 1, 'dbem_cp_locations_has_archive' => 1, 'dbem_locations_default_archive_orderby' => 'title', 'dbem_locations_default_archive_order' => 'ASC', 'dbem_cp_locations_archive_formats' => 1, 'dbem_cp_locations_excerpt_formats' => 1, 'dbem_cp_locations_search_results' => 0, 'dbem_cp_locations_custom_fields' => 0, 'dbem_cp_locations_comments' => 1, 'dbem_cp_categories_formats' => 1, 'dbem_categories_default_archive_orderby' => 'event_start_date,event_start_time,event_name', 'dbem_categories_default_archive_order' => 'ASC', 'dbem_cp_tags_formats' => 1, 'dbem_tags_default_archive_orderby' => 'event_start_date,event_start_time,event_name', 'dbem_tags_default_archive_order' => 'ASC', 'dbem_disable_thumbnails' => false, 'dbem_feedback_reminder' => time());
    //do date js according to locale:
    $locale_code = substr(get_locale(), 0, 2);
    $locale_dates = array('nl' => 'dd/mm/yy', 'af' => 'dd/mm/yy', 'ar' => 'dd/mm/yy', 'az' => 'dd.mm.yy', 'bg' => 'dd.mm.yy', 'bs' => 'dd.mm.yy', 'cs' => 'dd.mm.yy', 'da' => 'dd-mm-yy', 'de' => 'dd.mm.yy', 'el' => 'dd/mm/yy', 'en-GB' => 'dd/mm/yy', 'eo' => 'dd/mm/yy', 'et' => 'dd.mm.yy', 'eu' => 'yy/mm/dd', 'fa' => 'yy/mm/dd', 'fo' => 'dd-mm-yy', 'fr' => 'dd.mm.yy', 'fr' => 'dd/mm/yy', 'he' => 'dd/mm/yy', 'hu' => 'yy.mm.dd.', 'hr' => 'dd.mm.yy.', 'ja' => 'yy/mm/dd', 'ro' => 'dd.mm.yy', 'sk' => 'dd.mm.yy', 'sq' => 'dd.mm.yy', 'sr' => 'dd/mm/yy', 'sr' => 'dd/mm/yy', 'sv' => 'yy-mm-dd', 'ta' => 'dd/mm/yy', 'th' => 'dd/mm/yy', 'vi' => 'dd/mm/yy', 'zh' => 'yy/mm/dd', 'es' => 'dd/mm/yy', 'it' => 'dd/mm/yy');
    if (array_key_exists($locale_code, $locale_dates)) {
        $dbem_options['dbem_date_format_js'] = $locale_dates[$locale_code];
    }
    //add new options
    foreach ($dbem_options as $key => $value) {
        add_option($key, $value);
    }
    if (!get_option('dbem_version')) {
        add_option('dbem_credits', 1);
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5) {
        //make events, cats and locs pages
        update_option('dbem_cp_events_template_page', 1);
        update_option('dbem_cp_locations_template_page', 1);
        //reset orderby, or convert fields to new fieldnames
        $EM_Event = new EM_Event();
        $orderbyvals = explode(',', get_option('dbem_events_default_orderby'));
        $orderby = array();
        foreach ($orderbyvals as $val) {
            if (array_key_exists('event_' . $val, $EM_Event->fields)) {
                $orderby[] = 'event_' . $val;
            }
        }
        $orderby = count($orderby) > 0 ? implode(',', $orderby) : $dbem_options['dbem_events_default_orderby'];
        update_option('dbem_events_default_orderby', $orderby);
        //Locations and categories weren't controlled in v4, so just reset them
        update_option('dbem_locations_default_orderby', 'location_name');
        update_option('dbem_categories_default_orderby', 'name');
        //Update the slugs if necessary
        $events_page_id = get_option('dbem_events_page');
        $events_page = get_post($events_page_id);
        update_option('dbem_cp_events_slug', $events_page->post_name);
        update_option('dbem_taxonomy_tag_slug', $events_page->post_name . '/tags');
        if (defined('EM_LOCATIONS_SLUG') && EM_LOCATIONS_SLUG != 'locations') {
            update_option('dbem_cp_locations_slug', EM_LOCATIONS_SLUG);
        }
        if (defined('EM_CATEGORIES_SLUG') && EM_CATEGORIES_SLUG != 'categories') {
            update_option('dbem_taxonomy_category_slug', $events_page->post_name . '/' . EM_CATEGORIES_SLUG);
        }
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.19) {
        update_option('dbem_event_reapproved_email_subject', get_option('dbem_event_approved_email_subject'));
        update_option('dbem_event_reapproved_email_body', get_option('dbem_event_approved_email_body'));
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') <= 5.21) {
        //just remove all rsvp cut-off info
        global $wpdb;
        $wpdb->query("UPDATE " . $wpdb->postmeta . " SET meta_value = NULL WHERE meta_key IN ('_event_rsvp_date','_event_rsvp_time') AND post_id IN (SELECT post_id FROM " . EM_EVENTS_TABLE . " WHERE recurrence_id > 0)");
        $wpdb->query("UPDATE " . EM_EVENTS_TABLE . " SET event_rsvp_time = NULL, event_rsvp_date = NULL WHERE recurrence_id > 0");
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.364) {
        if (get_option('dbem_cp_events_template_page')) {
            update_option('dbem_cp_events_template', 'page');
            delete_option('dbem_cp_events_template_page');
        }
        if (get_option('dbem_cp_locations_template_page')) {
            update_option('dbem_cp_locations_template', 'page');
            delete_option('dbem_cp_locations_template_page');
        }
        update_option('dbem_events_archive_scope', get_option('dbem_events_page_scope'));
        update_option('em_last_modified', current_time('timestamp', true));
        update_option('dbem_category_event_single_format', get_option('dbem_category_event_list_item_header_format') . get_option('dbem_category_event_list_item_format') . get_option('dbem_category_event_list_item_footer_format'));
        update_option('dbem_category_no_event_message', get_option('dbem_category_event_list_item_header_format') . get_option('dbem_category_no_events_message') . get_option('dbem_category_event_list_item_footer_format'));
        update_option('dbem_location_event_single_format', get_option('dbem_location_event_list_item_header_format') . get_option('dbem_location_event_list_item_format') . get_option('dbem_location_event_list_item_footer_format'));
        update_option('dbem_location_no_event_message', get_option('dbem_location_event_list_item_header_format') . get_option('dbem_location_no_events_message') . get_option('dbem_location_event_list_item_footer_format'));
        update_option('dbem_tag_event_single_format', get_option('dbem_tag_event_list_item_header_format') . get_option('dbem_tag_event_list_item_format') . get_option('dbem_tag_event_list_item_footer_format'));
        update_option('dbem_tag_no_event_message', get_option('dbem_tag_event_list_item_header_format') . get_option('dbem_tag_no_events_message') . get_option('dbem_tag_event_list_item_footer_format'));
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.38) {
        update_option('dbem_dates_separator', get_option('dbem_dates_Seperator', get_option('dbem_dates_seperator', ' - ')));
        update_option('dbem_times_separator', get_option('dbem_times_Seperator', get_option('dbem_times_seperator', ' - ')));
        delete_option('dbem_dates_Seperator');
        delete_option('dbem_times_Seperator');
        delete_option('dbem_dates_seperator');
        delete_option('dbem_times_seperator');
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.4) {
        //tax rates now saved at booking level, so that alterations to tax rates don't change previous booking prices
        //any past bookings that don't get updated will adhere to these two values when calculating prices
        update_option('dbem_legacy_bookings_tax_auto_add', get_option('dbem_bookings_tax_auto_add'));
        update_option('dbem_legacy_bookings_tax', get_option('dbem_bookings_tax'));
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.422) {
        //copy registration email content into new setting
        update_option('dbem_rss_limit', 0);
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.4425) {
        //copy registration email content into new setting
        update_option('dbem_css_editors', 0);
        update_option('dbem_css_rsvp', 0);
        update_option('dbem_css_evlist', 0);
        update_option('dbem_css_loclist', 0);
        update_option('dbem_css_rsvpadmin', 0);
        update_option('dbem_css_catlist', 0);
        update_option('dbem_css_taglist', 0);
        if (locate_template('plugins/events-manager/templates/events-search.php')) {
            update_option('dbem_css_search', 0);
            update_option('dbem_search_form_hide_advanced', 0);
        }
        update_option('dbem_events_page_search_form', get_option('dbem_events_page_search'));
        update_option('dbem_search_form_dates_separator', get_option('dbem_dates_separator'));
        delete_option('dbem_events_page_search');
        //avoids the double search form on overriden templates
        update_option('dbem_locations_page_search_form', 0);
        //upgrades shouldn't get extra surprises
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.512) {
        update_option('dbem_search_form_geo_units', 0);
        //don't display units search for previous installs
        //correcting the typo
        update_option('dbem_search_form_submit', get_option('dbem_serach_form_submit'));
        //if template isn't overridden, assume it is still being used
        if (!locate_template('plugins/events-manager/templates/events-search.php')) {
            delete_option('dbem_serach_form_submit', 0);
        }
        //ML translation
        if (get_option('dbem_serach_form_submit_ml')) {
            update_option('dbem_search_form_submit_ml', get_option('dbem_serach_form_submit_ml'));
            delete_option('dbem_serach_form_submit_ml');
            //we can assume this isn't used in templates
        }
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.54) {
        update_option('dbem_cp_events_excerpt_formats', 0);
        //don't override excerpts in previous installs
        update_option('dbem_cp_locations_excerpt_formats', 0);
    }
    if (get_option('dbem_version') != '' && get_option('dbem_version') < 5.55) {
        //rename email templates sent to admins on new bookings
        update_option('dbem_bookings_contact_email_cancelled_subject', get_option('dbem_contactperson_email_cancelled_subject'));
        update_option('dbem_bookings_contact_email_cancelled_body', get_option('dbem_contactperson_email_cancelled_body'));
        if (get_option('dbem_bookings_approval')) {
            //if approvals ENABLED, we should make the old 'New Booking' email the one for a pending booking
            update_option('dbem_bookings_contact_email_pending_subject', get_option('dbem_bookings_contact_email_subject'));
            update_option('dbem_bookings_contact_email_pending_body', get_option('dbem_bookings_contact_email_body'));
        } else {
            //if approvals DISABLED, we should make the old 'New Booking' email the one for a confirmed booking
            update_option('dbem_bookings_contact_email_confirmed_subject', get_option('dbem_bookings_contact_email_subject'));
            update_option('dbem_bookings_contact_email_confirmed_body', get_option('dbem_bookings_contact_email_body'));
        }
        delete_option('dbem_contactperson_email_cancelled_subject');
        delete_option('dbem_contactperson_email_cancelled_body');
        delete_option('dbem_bookings_contact_email_subject');
        delete_option('dbem_bookings_contact_email_body');
    }
    //set time localization for first time depending on current settings
    if (get_option('dbem_time_24h', 'not set') == 'not set') {
        //Localise vars regardless
        $locale_code = substr(get_locale(), 0, 2);
        if (preg_match('/^en_(?:GB|IE|AU|NZ|ZA|TT|JM)$/', get_locale())) {
            $locale_code = 'en-GB';
        }
        //Set time
        $show24Hours = !preg_match("/en|sk|zh|us|uk/", $locale_code);
        // Setting 12 hours format for those countries using it
        update_option('dbem_time_24h', $show24Hours);
    }
}
コード例 #4
0
ファイル: em-booking.php プロジェクト: rajankz/webspace
 function output($format, $target = "html")
 {
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $format, $placeholders);
     foreach ($this->get_tickets() as $EM_Ticket) {
         break;
     }
     //Get first ticket for single ticket placeholders
     $output_string = $format;
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_BOOKINGID':
                 $replace = $this->booking_id;
                 break;
             case '#_RESPNAME':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGNAME':
                 $replace = $this->get_person()->get_name();
                 break;
             case '#_RESPEMAIL':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGEMAIL':
                 $replace = $this->get_person()->user_email;
                 break;
             case '#_RESPPHONE':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGPHONE':
                 $replace = $this->get_person()->phone;
                 break;
             case '#_BOOKINGSPACES':
                 $replace = $this->get_spaces();
                 break;
             case '#_BOOKINGLISTURL':
                 $replace = em_get_my_bookings_url();
                 break;
             case '#_COMMENT':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGCOMMENT':
                 $replace = $this->booking_comment;
                 break;
             case '#_BOOKINGPRICEWITHTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, true), 2);
                 break;
             case '#_BOOKINGPRICEWITHOUTTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, false), 2);
                 break;
             case '#_BOOKINGPRICETAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, false) * (get_option('dbem_bookings_tax') / 100), 2);
                 break;
             case '#_BOOKINGPRICE':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(), 2);
                 break;
             case '#_BOOKINGTICKETNAME':
                 $replace = $EM_Ticket->name;
                 break;
             case '#_BOOKINGTICKETDESCRIPTION':
                 $replace = $EM_Ticket->description;
                 break;
             case '#_BOOKINGTICKETPRICEWITHTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, true), 2);
                 break;
             case '#_BOOKINGTICKETPRICEWITHOUTTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, false), 2);
                 break;
             case '#_BOOKINGTICKETTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, false) * (get_option('dbem_bookings_tax') / 100), 2);
                 break;
             case '#_BOOKINGTICKETPRICE':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(), 2);
                 break;
             case '#_BOOKINGTICKETS':
                 ob_start();
                 em_locate_template('emails/bookingtickets.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             default:
                 $replace = $full_result;
                 break;
         }
         $replaces[$full_result] = apply_filters('em_booking_output_placeholder', $replace, $this, $full_result, $target);
     }
     //sort out replacements so that during replacements shorter placeholders don't overwrite longer varieties.
     krsort($replaces);
     foreach ($replaces as $full_result => $replacement) {
         $output_string = str_replace($full_result, $replacement, $output_string);
     }
     //run event output too, since this is never run from within events and will not infinitely loop
     $output_string = $this->get_event()->output($output_string, $target);
     return apply_filters('em_booking_output', $output_string, $this, $format, $target);
 }
コード例 #5
0
ファイル: em-booking.php プロジェクト: hypenotic/slowfood
 /**
  * @param EM_Booking $EM_Booking
  * @param EM_Event $event
  * @return boolean
  */
 function email()
 {
     global $EM_Mailer;
     //FIXME ticket logic needed
     $EM_Event = $this->get_event();
     //We NEED event details here.
     //Make sure event matches booking, and that booking used to be approved.
     if (!($this->status == 0 && $this->previous_status > 0) || $this->previous_status == 4) {
         $contact_id = $EM_Event->owner != "" ? $EM_Event->owner : get_option('dbem_default_contact_person');
         $contact_subject = get_option('dbem_bookings_contact_email_subject');
         $contact_body = get_option('dbem_bookings_contact_email_body');
         if (get_option('dbem_bookings_approval') == 0 && $this->status < 2 || $this->status == 1) {
             $booker_subject = get_option('dbem_bookings_email_confirmed_subject');
             $booker_body = get_option('dbem_bookings_email_confirmed_body');
         } elseif ($this->status == 0 || $this->previous_status == 4) {
             $booker_subject = get_option('dbem_bookings_email_pending_subject');
             $booker_body = get_option('dbem_bookings_email_pending_body');
         } elseif ($this->status == 2) {
             $booker_subject = get_option('dbem_bookings_email_rejected_subject');
             $booker_body = get_option('dbem_bookings_email_rejected_body');
         } elseif ($this->status == 3) {
             $booker_subject = get_option('dbem_bookings_email_cancelled_subject');
             $booker_body = get_option('dbem_bookings_email_cancelled_body');
             $contact_subject = get_option('dbem_contactperson_email_cancelled_subject');
             $contact_body = get_option('dbem_contactperson_email_cancelled_body');
         }
         // email specific placeholders
         $placeholders = array('#_RESPNAME' => '#_BOOKINGNAME', '#_RESPEMAIL' => '#_BOOKINGEMAIL', '#_RESPPHONE' => '#_BOOKINGPHONE', '#_COMMENT' => '#_BOOKINGCOMMENT', '#_RESERVEDSPACES' => '#_BOOKEDSPACES', '#_BOOKINGNAME' => $this->person->display_name, '#_BOOKINGEMAIL' => $this->person->user_email, '#_BOOKINGPHONE' => $this->person->phone, '#_BOOKINGSPACES' => $this->get_spaces(), '#_BOOKINGLISTURL' => em_get_my_bookings_url(), '#_BOOKINGCOMMENT' => $this->comment);
         foreach ($placeholders as $key => $value) {
             $contact_subject = str_replace($key, $value, $contact_subject);
             $contact_body = str_replace($key, $value, $contact_body);
             $booker_subject = str_replace($key, $value, $booker_subject);
             $booker_body = str_replace($key, $value, $booker_body);
         }
         $booker_subject = $EM_Event->output($booker_subject, 'email');
         $booker_body = $EM_Event->output($booker_body, 'email');
         //Send to the person booking
         if (!$this->email_send($booker_subject, $booker_body, $this->person->user_email)) {
             return false;
         }
         //Send admin/contact emails
         if ((get_option('dbem_bookings_approval') == 0 || $this->status == 0 || $this->status == 3) && (get_option('dbem_bookings_contact_email') == 1 || get_option('dbem_bookings_notify_admin') != '')) {
             //Only gets sent if this is a pending booking, unless approvals are disabled.
             $contact_subject = $EM_Event->output($contact_subject, 'email');
             $contact_body = $EM_Event->output($contact_body, 'email');
             if (get_option('dbem_bookings_contact_email') == 1) {
                 if (!$this->email_send($contact_subject, $contact_body, $EM_Event->contact->user_email) && current_user_can('activate_plugins')) {
                     $this->errors[] = __('Confirmation email could not be sent to contact person. Registrant should have gotten their email (only admin see this warning).', 'dbem');
                     return false;
                 }
             }
             if (get_option('dbem_bookings_notify_admin') != '' && preg_match('/^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$/', get_option('dbem_bookings_notify_admin'))) {
                 if (!$this->email_send($contact_subject, $contact_body, get_option('dbem_bookings_notify_admin'))) {
                     $this->errors[] = __('Confirmation email could not be sent to admin. Registrant should have gotten their email (only admin see this warning).', 'dbem');
                     return false;
                 }
             }
         }
         return true;
     }
     return false;
     //TODO need error checking for booking mail send
 }
コード例 #6
0
ファイル: bookingform.php プロジェクト: hypenotic/slowfood
for ($i = 1; $i <= 10; $i++) {
    $booking_spaces = !empty($_POST['booking_spaces']) && $_POST['booking_spaces'] == $i ? 'selected="selected"' : '';
    array_push($booked_places_options, "<option value='{$i}' {$booking_spaces}>{$i}</option>");
}
$EM_Tickets = $EM_Event->get_bookings()->get_tickets();
?>
<div id="em-booking">
	<a name="em-booking"></a>
	<?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.
?>
	<?php 
if ($EM_Event->get_bookings()->has_booking()) {
    ?>
		<p><?php 
    echo sprintf(__('You are currently attending this event. <a href="%s">Manage my bookings</a>', 'dbem'), em_get_my_bookings_url());
    ?>
</p>
	<?php 
} elseif ($EM_Event->start < current_time('timestamp')) {
    ?>
		<p><?php 
    _e('Bookings are closed for this event.', 'dbem');
    ?>
</p>
	<?php 
} else {
    ?>
		<?php 
    echo $EM_Notices;
    ?>
コード例 #7
0
ファイル: bookingform.php プロジェクト: hypenotic/slowfood
for ($i = 1; $i <= 10; $i++) {
    $booking_spaces = !empty($_POST['booking_spaces']) && $_POST['booking_spaces'] == $i ? 'selected="selected"' : '';
    array_push($booked_places_options, "<option value='{$i}' {$booking_spaces}>{$i}</option>");
}
$EM_Tickets = $EM_Event->get_bookings()->get_tickets();
?>
<div id="em-booking">
	<a name="em-booking"></a>
	<?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.
?>
	<?php 
if ($EM_Booking = $EM_Event->get_bookings()->has_booking()) {
    ?>
		<p><?php 
    echo apply_filters('em_my_bookings_booked_message', sprintf(__('You are currently attending this event. <a href="%s">Manage my bookings</a>', 'dbem'), em_get_my_bookings_url()), $EM_Booking);
    ?>
</p>
	<?php 
} elseif (!$EM_Event->rsvp) {
    ?>
		<p><?php 
    _e('Online bookings are not available for this event.', 'dbem');
    ?>
</p>
	<?php 
} elseif ($EM_Event->start < current_time('timestamp')) {
    ?>
		<p><?php 
    _e('Bookings are closed for this event.', 'dbem');
    ?>