Support

Home Forums Event Espresso Premium List Attendees on Calendar Events

List Attendees on Calendar Events

Posted: July 16, 2014 at 4:57 pm


Tony O’Keefe

July 16, 2014 at 4:57 pm

Hi,

I am using [LISTATTENDEES] shortcode in the espresso-calendar.php file to display attendees on the calendar tooltips.

This is working fine.

I would like to also list attendees on the actual calendar events below the event title.
Can I acheive this in the same way with do_shortcode in the same .php file?

If so how will the code vary from this:

$events[ $cntr ]['tooltip'] .= ' <div>' . do_shortcode('[LISTATTENDEES paid_only="true" show_gravatar="true"]') . '</div>';

and where should I place it in the file?

Cheers,

Tony
———————————-
Event Espresso version 3.1.36.5.P
WordPress version WP 3.9.1


Dean

July 17, 2014 at 12:31 am

Hi,

So you want the listattendees to show on the actual calendar blobs? While in theory it’s possible you may find it difficult to make it look good.

If you edit espresso-calendar.php at approx. line 577 and add

$x = do_shortcode('[LISTATTENDEES paid_only="true" show_gravatar="true"]');
$events[ $cntr ]['title'] .= htmlspecialchars_decode(stripslashes($x ), ENT_QUOTES);

Then it will add it. HOWEVER, it does not process it correctly due to plugin making the HTML show as raw. I have been unable to pinpoint where it does this exactly, so you would need to figure that out before it becomes of any use.


Tony O’Keefe

July 19, 2014 at 9:17 pm

Hi Dean,
Thanks for your reply. My own attempts had ended up at pretty much the same point. I’d inserted the shortcode in the identical place you’ve suggested and got the raw HTML output. At least now I know it’s due to the processing.
All beyond my skills to hunt down the solution to this one and as it’s only a minor tweak I think I will let it slide.
Thanks for having a look anyway.
Cheers,
Tony.


Dean

July 21, 2014 at 7:14 am

OK,

I’ve got it to work, but you’re going to need to edit two files and as suspected the results will not look that good as the content area is so narrow.

Do what we did above, but with one slight difference:

$x = do_shortcode('[LISTATTENDEES paid_only="true" show_gravatar="true"]');
$events[ $cntr ]['mychanges'] .= htmlspecialchars_decode(stripslashes($x ), ENT_QUOTES);

(Notice the mychanges bit instead of the title?)

Then in /wp-content/plugins/espresso-calendar/scripts/espresso_calendar.js at about line 249 chaneg this:

eventAfterRender : function( event, element, view ) {
},

to this:

eventRender: function(event, element) { element.find('.fc-event-title').append(event.mychanges); },

Resources
http://arshaw.com/fullcalendar/docs/event_rendering/eventAfterRender/
http://stackoverflow.com/questions/8702058/add-custom-html-to-a-jquery-fullcalendar-cell

The support post ‘List Attendees on Calendar Events’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso