CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • List of Events -> How do I include multiple event types?
Pages: [1]

Author Topic: List of Events -> How do I include multiple event types?  (Read 1272 times)

nikkislaw

  • Guest
List of Events -> How do I include multiple event types?
January 05, 2009, 10:45:21 am
I'm sure this is a simple thing, but I can't seem to find the answer after spending an embarrassing amount of time on the problem (I'm a PHP newb at best).   :-[

I have an Events listing and all I want to do is list more than 1 event type.  I'm using code graciously provided by the community to list my events and it works perfectly otherwise.  Here's the portion of code where the event type ID is specified:

Code: [Select]
if (module_exists('civicrm')) {
  civicrm_initialize(TRUE);
  require_once 'api/v2/Event.php';
  // This example limits listing to public and active events
  $params = array ('is_public'     => 1, 'is_active'     => 1, 'event_type_id'     => 1);
  $myEvents = civicrm_event_search( $params );
  if ($myEvents) {
    $count = 0;
    $last = '';
    usort($myEvents,'cmp_date2');

If anyone could assist me with the syntax I would be very grateful.  Thank you in advance!   :)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: List of Events -> How do I include multiple event types?
January 05, 2009, 01:24:15 pm

The current api code does not allow multiple event types. the easiest option might be to repeat the code multiple times and change the event type and consolidate the results

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nikkislaw

  • Guest
Re: List of Events -> How do I include multiple event types?
January 05, 2009, 04:26:45 pm
Thank you for your reply!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • List of Events -> How do I include multiple event types?

This forum was archived on 2017-11-26.