Displaying Individual Calendar Listings

Four score and seven years ago… ok, maybe not that long ago. 🙂

Maybe it was a year or two ago that I published how to retrieve and customize a public web calendar for your church using CCB’s API.

As with most of CCB, some of the native functionality leaves a church desiring more in the area of visual appeal.

So just as we did with the public web calendar tutorial, today’s tutorial will tackle how to retrieve and customize calendar listings for individuals.

Today’s tutorial will come in handy if you have a church app that seeks to provide attendees and members with the capability of seeing a list of events based on their respective CCB profile id.

For play by play details, do take time to read and review the public web calendar tutorial. The code below is a modified version of the public web calendar tutorial’s codebase.

Of course, there are some glaring differences to the code base that you’ll need to pay close attention too:

  • apiService variable should be set equal to individual_calendar_listing
  • startDate and endDate variables are required and should be set to respective dates using YYYY-MM-DD date format
  • the XPATH query should be defined as //item instead of //items/item

When using CCB API to access the individual_calendar_listing web service, the following attributes (see CCB Documentation) are available for retrieval should data exist:

  • date – the event date (datetime format of YYYY-MM-DD)
  • event_name – the event name
  • event ccb_id – the event id
  • event_description – the event description
  • start_time – the event start time (00:00:00 military format)
  • end_time – the event end time (00:00:00 military format)
  • event_duration – the event duration in minutes
  • location – the event location
  • group_name – the group name associated with event
  • group ccb_id – the group id associated with event
  • group_type – the type of group
  • grouping_name – the designated group name to be shown
  • leader_name – the leader name
  • leader ccb_id = the leader id
  • leader_phone = the leader phone number
  • leader_email = the leader email address

If you desire additional event information, then you’ll have to use the event id and pass it to the event_profile web service.

If the event has a registration form that you’re wanting to post a link to, then simply append the event’s id or place the correct form link with the appropriate form id attached.

https://mosaicchurchaustin.ccbchurch.com/form_response.php?id=FormIDHere

To begin this tutorial, open the text editor of your choice, and name and save the following php file: person-calendar.php.

Copy, paste, and save the code below, ensuring you change the id, startDate, and endDate variables to their respective values.

 

Now you’re ready to open the person-calendar.php in a web browser to test your technical prowess. If successful, then your browser should display information as shown in the example image below.

That’s it for this tutorial. Let me know if you have any technical issues, challenges, questions or comments. See you back here next week! 😉


Please comment if this tutorial has helped you.