Jump to content

Customizing wordpress plugin - Events manager - attendeespendinglist.php


FrederikRS

Recommended Posts

Hi,

 

I'm new at this forum, so I hope I'm posting my question in the correct category - otherwise please correct me.

 

The situation is that I need to customize the plugin "Events manager" for WordPress a little bit, but I'm not a coding guru, so I need a little advise or two.

 

I have the following code from the file (attendeespendinglist.php):

<?php
/* @var $EM_Event EM_Event */
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
    ?>
    <ul class="event-attendees">
    <?php
    $guest_bookings = get_option('dbem_bookings_registration_disable');
    $guest_booking_user = get_option('dbem_bookings_registration_user');
    foreach( $EM_Bookings as $EM_Booking){
        if($EM_Booking->status == 0 && !in_array($EM_Booking->get_person()->ID, $people) ){
            $people[] = $EM_Booking->get_person()->ID;
            echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
        }elseif($EM_Booking->status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
            echo '<li>'. $EM_Booking->get_person()->get_name() .'</li>';
        }
    }
    ?>
    </ul>
    <?php
}

This will generate a list with people who have a pending booking.

 

I need to divide the list into two. The first list containing the first 20 pending bookings and the second list containing the rest.

 

So it would be something like this:

 

List 1:

1. name1

2. name2

...

20. name20

 

List 2:

21. name21

22.name22

....

etc.

 

 

Is it possible to do this - and in that case how?

 

I really hope you are able to help me solving this question.

 

 

Thanks in advance!

 

 

Best regards,

Frederik

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.