• Can anyone advise a poor sould on printing the date a user has booked? I see that the data is stored in “booking_date” column in em_bookings table, but how t I retrieve this value for usage in a placeholder for instance?

    Honestly what I need to do is hack the core files so that people who sign up for an event through my site get first-com first-served preference for the events, so it would be handy if in /admin/bookings/em_pending I could set up the columns to display date booking request was submitted.

    I have to column header but can’t print the date. $EM_Ticket->start returns 1-1-1970 instead of booking date.

    Any Ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter psperkins

    (@psperkins)

    Sorry for bugging you guys with stuff I figured out an hour or tow later on my own.

    What I ended up doing involved editing core file (boo hiss! – yeah I know but it was worth it for me) – to get the date to show in the columns of bookings in the admin (there are 4 – approved/pending/cancelled/rejected)
    I opened the appropriately named file in /plugins/event-manager/admin/bookings and since I couldn’t find a straight up way to do get the date I used $wpdb to do it instead.

    I did this inside a function called “em_bookings_pending_table()” for “pending” status bookings etc. etc.

    Inside that function around line 94 is the iteration of the admin list of bookings, with the header fields listed. If you are paying attention when you open each file you will notice similarities between the functions in each file corresponding to the booking status type we are working on. I did one file, opened the other 3 and just pasted the new stuff in each one since I wanted the same info in each one.

    I needed to get the booking_date field because this guys wants to give preference to “first comers” in approving his bookings.

    So first I found the < th > tags and added my new header “date” between to the list so it shows up in the admin booking list(s).

    Then, inside the foreach ($EM_Bookings->bookings as $EM_Booking) { right after $rowno++; but still inside the curlies I added:
    $bookingid = $EM_Booking->event_id; date_default_timezone_set('America/Boise'); $tickettime = $wpdb->get_var($wpdb->prepare("SELECT booking_date FROM wp_em_bookings WHERE event_id = $bookingid"));

    That got me the time where I could do this:
    <td><?php echo date("F d, Y - G:i", strtotime($tickettime)); ?></td>
    a little down further where the info for each booking is displayed in each list.

    I really like the booking feature of this plugin and (after my initial aversion to events not being posts but I like it better that way now that I understand a bit more) this is a great plugin.

    Now I edited four core plugin files here and even though I figured out what I was after, since I shared my long-winded solution can I ask if this could potentially be done with placeholder files and not hack those core files?

    I wonder if I could copy these functions into my own functions.php file, rename them and reuse them and then mod them without hacking core files?

    Just some perspective on using the bookings in hardcore ways I guess.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    where are you trying to print the user booking date?

    Thread Starter psperkins

    (@psperkins)

    In the admin – pending bookings/confirmed bookings/cancelled bookings/rejected bookings lists.

    Client wanted to give preference to early bookings so the date of the booking was important for him to see in the manage bookings area of the admin.

    I figured that one out to where it works for me right now. It might be cool to know if this booking date could be added to placeholders or template files in the future.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    I’m going to be redoing the booking windows and unifying them into one (there’s too many now!). I think the date is a sensible collumn to have. will add asap (probably in the release after next)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show date of booking’ is closed to new replies.