• Hi,

    EM is awesome plugin with a really helpfull documentation that lets a lot of possibilities.

    But, I would like to know how it is possible to show content only for users who have booked an event. There are conditional placeholders for logged in and not logged in users; so I need something like that but for users who have booked a specific event, to show content for them.

    Thank you very much in advance. Any help appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    so I need something like that but for users who have booked a specific event, to show content for them.

    sorry but at the moment this is not possible and might need custom coding on your part to make this work.

    Thread Starter jordib

    (@jordib)

    Hi again,

    I’ve been trying to custom coding for this functionality, but still not working, could you just tell me if I’m in correct way to find the solution trying to display the following function example:

    function events_content() {
        global $EM_Booking, $EM_Event;
        $EM_Booking = $EM_Event->get_bookings()->has_booking();
        echo  EM_Events::output(array('scope'=>'past', 'owner'=>bp_displayed_user_id(), 'format'=>'
        	<div class="EM_score_name">#_EVENTNAME</div>'
            if( is_object($EM_Booking) && !get_option('dbem_bookings_double') ){
               '<p>Im event attendee</p>'
            } else{
               '<p>Im not event attendee</p>'
            ));
        
    }
    

    For sure is wrong because website crashes.
    Thank you very much in advance. Any help appreciated.

    caimin_nwl

    (@caimin_nwl)

    The reason it’s crashing is because you have the echo in the wrong place and you’re mixing the PHP with the HTML without separating them correctly.

    You’d also need to properly loop through the bookings you retrieve.

    Thread Starter jordib

    (@jordib)

    Thanks, now I see more clear everything. I don’t know what I was thinking about when I code this, because it’s clear I’m mixing php and html :S:S. I will update the solution.

    Thank you very much for the support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Content only for attendees’ is closed to new replies.