Posted: September 11, 2013 at 7:26 am
|
hi guys, i’d like to add some text, graphics and video as soon as the registration time is over. something like: <?php if (REGISTRATION TIME IS OVER()) { do this <?php }else{ ?> do that <?php } ?> i tried several variables, but couldn’t get it done ;( any idea or help? thanks! |
September 11, 2013 at 11:14 am The event_espresso_get_is_active function (located in main.php) will run a check and return the registration status of the event. You can review how it’s used in some of the built in Event Espresso templates such as /templates/event_list.php, /templates/event_list_display.php and /templates/registration_page.php. |
|
|
Thanks. I tried <?php if (event_espresso_get_status($event_id) == ‘REGISTRATION_CLOSED’) { ?> Didn’t work. if-STATEMENT looks correct, doesn’t it? |
Hi Klaus, The function event_espresso_get_is_active() returns an array containing more than just the status as above. Look in event_list_display.php lines line 24 – 35 for an example in how to use the function. See how $status[‘status’] is used? |
|
|
I don’t get it ;( What is wrong with <?php if ($num_attendees <= $reg_limit && $status == ‘REGISTRATION_OPEN’){ ?> DO THIS <?php } ?> ??? |
|
Try: <?php if ($num_attendees <= $reg_limit && $status['status'] == 'REGISTRATION_OPEN'){ ?> DO THIS <?php } ?> Which file are you placing the code in?
|
|
September 13, 2013 at 12:21 am I would like to use it in my own single.php template file within the <This is the registration form> (which i copied from registration_page_display.php). The form works perfect in my template, the <?php if ($num_attendees <= $reg_limit){ ?> works perfect as well, but as soon as i add the I tried using your lines above, but that does not seem to work. Hm ;(( Any idea? Thanks for your help! |
|
<?php if ($num_attendees >= $reg_limit && $today < $event_registration_end){?> WORKED FOR ME! |
|
September 13, 2013 at 10:33 am Glad you got it sorted! |
The support post ‘IF EXPIRED do this, write that’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.