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) »
  • Detecting 'Closed' condition for event registrations
Pages: [1]

Author Topic: Detecting 'Closed' condition for event registrations  (Read 211 times)

jlwood

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.2.9
Detecting 'Closed' condition for event registrations
January 09, 2015, 01:45:45 pm
My Setup: On my home page I display a view block  with links to events, some of which are Civicrm events with online registration, and some of which are not. A PHP field checks each row for a related CiviCRM event with online registration enabled and displays a "Register NOW!" link where appropriate. I'm Using Drupal 7 and Civicrm 4.5.5. 

My Problem: I'd like the link to change dynamically when registration closes, maybe with a strikeout and the word "Full" or "Registration Closed".  I know I can use the API to check the registration limit, closure dates, and number of signups with code like this:

Code: [Select]
    $result = civicrm_api3('Participant', 'getcount', array(
    'sequential' => 1,
    'event_id' => ??,
    ));
etc...

but it seems like there must be a better way. Some function in the API called "is_open" or something like that that checks the status using Civicrm's existing codebase. Am I looking for something that doesn't exist yet?



Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Detecting 'Closed' condition for event registrations

This forum was archived on 2017-11-26.