Advertisement
Guest User

Untitled

a guest
May 11th, 2020
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. <?php
  2. //List Attendees Template
  3. //Show a list of attendees using a shortcode
  4. //[LISTATTENDEES]
  5. //[LISTATTENDEES limit="30"]
  6. //[LISTATTENDEES show_expired="false"]
  7. //[LISTATTENDEES show_deleted="false"]
  8. //[LISTATTENDEES show_secondary="false"]
  9. //[LISTATTENDEES show_gravatar="true"]
  10. //[LISTATTENDEES paid_only="true"]
  11. //[LISTATTENDEES show_recurrence="false"]
  12. //[LISTATTENDEES event_identifier="your_event_identifier"]
  13. //[LISTATTENDEES category_identifier="your_category_identifier"]
  14.  
  15. //Please refer to this page for an updated lsit of shortcodes: http://eventespresso.com/forums/?p=592
  16.  
  17.  
  18. /*Example CSS for your themes style sheet:
  19.  
  20. li.attendee_details{
  21. display:block;
  22. margin-bottom:20px;
  23. background: #ECECEC;
  24. border:#CCC 1px solid;
  25. }
  26. .espresso_attendee{
  27. width:400px;
  28. padding:5px;
  29. }
  30. .espresso_attendee img.avatar{
  31. float:left;
  32. padding:5px;
  33. }
  34. .clear{
  35. clear:both;
  36. }
  37. */
  38.  
  39. //The following code displays your list of attendees.
  40. //The processing for this function is managed in the shortcodes.php file.
  41. if (!function_exists('event_espresso_show_attendess')) {
  42. function event_espresso_show_attendess($sql,$show_gravatar,$paid_only, $sort=''){
  43. //echo $sql;
  44. global $wpdb,$this_is_a_reg_page;
  45. $events = $wpdb->get_results($sql);
  46. foreach ($events as $event){
  47. $event_id = $event->id;
  48. $event_name = stripslashes_deep($event->event_name);
  49. /*if (!$this_is_a_reg_page){
  50. $event_desc = do_shortcode(stripslashes_deep($event->event_desc));
  51. }*/
  52.  
  53. //This variable is only available using the espresso_event_status function which is loacted in the Custom Files Addon (http://eventespresso.com/download/plugins-and-addons/custom-files-addon/)
  54. $event_status = function_exists('espresso_event_status') ? ' - ' . espresso_event_status($event_id) : '';
  55. //Example usage in the event title:
  56. /*<h2><?php _e('Attendee Listing For: ','event_espresso'); ?><?php echo $event_name . ' - ' . $event_status?> </h2>*/
  57. ?>
  58.  
  59. <div class="<?php espresso_template_css_class('event_display_boxes','event-display-boxes ui-widget'); ?>">
  60.  
  61. <h2 class="<?php espresso_template_css_class('event_title','event_title ui-widget-header ui-corner-top'); ?>">
  62. <?php _e('Attendee Listing For: ','event_espresso'); ?>
  63. <?php echo $event_name . $event_status?></h2>
  64.  
  65. <div class="<?php espresso_template_css_class('event_data_display','event-data-display ui-widget-content ui-corner-bottom'); ?>">
  66.  
  67. <?php //echo wpautop($event_desc); ?>
  68. <ol class="<?php espresso_template_css_class('attendee_list','attendee_list'); ?>">
  69. <?php
  70. $a_sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE . " WHERE event_id='" . $event_id . "'";
  71. $a_sql .= $paid_only == 'true'? " AND (payment_status='Completed' OR payment_status='Pending' OR payment_status='Refund') ":'';
  72. $a_sql .= $sort;
  73. //echo $a_sql;
  74. $attendees = $wpdb->get_results($a_sql);
  75. foreach ($attendees as $attendee){
  76. $id = $attendee->id;
  77. $lname = $attendee->lname;
  78. $fname = $attendee->fname;
  79. $city = $attendee->city;
  80. $state = $attendee->state;
  81. $country = $attendee->state;
  82. $email = $attendee->email;
  83. $ticket_name = $attendee->price_option;
  84. $gravatar = $show_gravatar == 'true'? get_avatar( $email, $size = '100', $default = 'http://www.gravatar.com/avatar/' ) : '';
  85. $city_state = $city != '' || $state != '' ? '<br />' . ($city != '' ? $city :'') . ($state != '' ? ', ' . $state :' ') :'';
  86.  
  87. //These are example variables to show answers to questions
  88. //$custom_question_1 = '<br />'.do_shortcode('[EE_ANSWER q="12" a="'.$id.'"]');
  89. //$custom_question_2 = '<br />'.do_shortcode('[EE_ANSWER q="13" a="'.$id.'"]');
  90.  
  91. ?>
  92. <li class="<?php espresso_template_css_class('attendee_details','attendee_details'); ?>"> <span class="<?php espresso_template_css_class('espresso_attendee','espresso_attendee'); ?>"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . $lname) . ' - ' . $email . ' ' . $ticket_name . ' ; ?> </span>
  93. </li>
  94. <?php
  95. }
  96. ?>
  97. </ol>
  98. </div>
  99. </div>
  100. <?php
  101. }
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement