Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
- *
- * @package Event Espresso
- * @subpackage templates
- * @since 4.6.29
- * @author Darren Ethier
- *
- * Template Args that are available in this template
- * @type EE_Attendee $contact
- * @type bool $show_gravatar whether to show gravatar or not.
- */
- $custom_question_output = '';
- if( $contact instanceof EE_Attendee ) {
- $prev_answer_value = EEM_Answer::instance()->get_var(
- array(
- array(
- 'Registration.ATT_ID' => $contact->ID(),
- 'Registration.EVT_ID' => $event->ID(),
- 'QST_ID' => 17 // replace with custom question's ID
- ),
- 'order_by' => array(
- 'ANS_ID' => 'DESC'
- ),
- 'limit' => 1
- ),
- 'ANS_value' );
- if( $prev_answer_value ) {
- $custom_question_output = '<br><span style="color:#585858; font-style:italic; font-size:.8em;"> Player's Name: </span>' . $prev_answer_value;
- }
- }
- $custom_question_output2 = '';
- if( $contact instanceof EE_Attendee ) {
- $prev_answer_value = EEM_Answer::instance()->get_var(
- array(
- array(
- 'Registration.ATT_ID' => $contact->ID(),
- 'Registration.EVT_ID' => $event->ID(),
- 'QST_ID' => 18 // replace with custom question's ID
- ),
- 'order_by' => array(
- 'ANS_ID' => 'DESC'
- ),
- 'limit' => 1
- ),
- 'ANS_value' );
- if( $prev_answer_value ) {
- $custom_question_output2 = ' ' . $prev_answer_value;
- }
- }
- if ( $show_gravatar ) {
- $gravatar = get_avatar( $contact->email(),
- (int) apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32 )
- );
- } else {
- $gravatar = '';
- }
- $states = EEM_State::instance()->get_all_states();
- $state = isset( $states[ $contact->state_ID() ] ) ? $states[ $contact->state_ID() ]->get( 'STA_name' ) : $contact->state_ID();
- $state = ! is_numeric( $state ) ? ', ' . $state : '';
- $countries = EEM_Country::instance()->get_all_countries();
- $country = isset( $countries[ $contact->country_ID() ] ) ? $countries[ $contact->country_ID() ]->get( 'CNT_name' ) : $contact->country_ID();
- $country = ! empty( $country ) ? ', ' . $country : '';
- $group_size = $contact->get_most_recent_registration_for_event( $event->get('EVT_ID'))->get('REG_group_size');
- // if group size is 1, ditch the quantity display
- $group_size = $group_size > 1 ? '<br><span style="color:#C0C0C0; font-style:italic; font-size:.8em;"> Total entries by Registrant (if >1): (' . $group_size . ')</span>' : '';
- ?>
- <?php do_action( 'AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar ); ?>
- <li><?php echo $gravatar . ' ' . $contact->full_name() . ' '
- . ' – '
- . '<span style="color:#C0C0C0;">'
- . $contact->city()
- . $state
- . '</span>'
- . $group_size
- . '<span style="color:#707070; font-style:italic;">'
- . $custom_question_output
- . $custom_question_output2
- . '</span>'; ?></li>
- <?php do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement