Support

Home Forums Event Espresso Premium How to Hide Events that are not open for registration yet (not_open)

How to Hide Events that are not open for registration yet (not_open)

Posted: April 2, 2016 at 5:03 pm


Jason Lee

April 2, 2016 at 5:03 pm

Hi there,

We want our events to show up if registration is open and also continue to show up until the event starts (even if registration is full). We want events to not show if the registration time window hasn’t opened yet and to then go away when the event itself actually starts.

Currently as soon as we put the event into the program, it puts it on the list. The event continues to show when seats are full (which is correct) but also stays on the entire day of the event and only goes away at midnight of that day.

What would we need to change in our shortcode for this? This is currently what we have on our outward looking page:

[EVENT_CUSTOM_VIEW template_name=”mycustomtemplate” show_featured=true change_title=”Events”]

Also, if we want the long description of the event to be hidden, is there a way to do that?


Josh

  • Support Staff

April 4, 2016 at 12:04 pm

Hi Jason,

I believe you’ll need to change the part of the query in the Event Espresso – Custom Template Display that’s on line 177.

Then, you remove the long description code from your “mycustomtemplate” file.


Jason Lee

April 11, 2016 at 2:17 pm

Hey there, I am having trouble locating the mycustomtemplatefile. I have a folder that is mycustomtemplate in my uploads>espresso>templates but no file with that name.

Also, what do we need to add to fix this

Currently as soon as we put the event into the program, it puts it on the list. The event continues to show when seats are full (which is correct) but also stays on the entire day of the event and only goes away at midnight of that day.


Josh

  • Support Staff

April 11, 2016 at 2:55 pm

Hi Jason,

If there are no files in the mycustomtemplatefile folder, you can copy the template file over from the custom template plugin.

You change the part of the query in the Event Espresso – Custom Template Display that’s on line 177 of the index.php file to change how long the event is displayed on the day of the event.


Jason Lee

April 11, 2016 at 3:55 pm

Thanks for getting back to me so quickly πŸ™‚ I actually do have the index.php file in the uploads>espresso>templates>mycustomtemplates>index.php but the file is only 150 lines long.


Tony

  • Support Staff

April 12, 2016 at 7:04 am

Hi Jason,

Within /wp-content/uploads/espresso/templates/mucustomtemplates/ do you have index.php and template.php or just an index?

Can you check which version of the Custom Template Add-on you are using please?

The template file that you have in /uploads/espresso/templates/mycustomtemplates/ simply displays the events passed to it by the custom template add-on. You don’t change the query to pull the events there, it would be /wp-content/plugins/espresso-custom-templates/index.php where the events are pulled from the DB.

Line 177 is:

$sql .= $show_expired == 'false' ? " AND (e.start_date >= '" . date('Y-m-d') . "' OR e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') " : '';

You going to need to adjust that SQL so that events with a registration start date does has not yet passed.


Jason Lee

April 12, 2016 at 7:33 pm

Thanks for the help. I want to make sure I did this correctly…

I created a folder called wp-content/uploads/espresso-custom-templates and then copied wp-content/plugins/espresso-custom-templates/index.php into it. Was this correct?

I have found the line you mentioned in there Tony and am just curious what I need to change it to to produce the desired results.

– We want events NOT to show until registration opens up (so we can put them all in ahead of time and then they show as they open)

– We want events to continue to show if they are full or if registration closes up until the time the event starts or ends, preferably starts but either works.


Jason Lee

April 12, 2016 at 7:34 pm

Note: I am SQL challenged lol


Tony

  • Support Staff

April 13, 2016 at 5:55 am

I created a folder called wp-content/uploads/espresso-custom-templates and then copied wp-content/plugins/espresso-custom-templates/index.php into it. Was this correct?

Those steps do seem correct, but it depends on what version of the custom template add-on you are using, it sounds like your using the older version. Can you look within Dashboard -> Plugins and find the Custom Template Add-on in the list, then post the version number here.

We want events NOT to show until registration opens up (so we can put them all in ahead of time and then they show as they open)

So something like e.registration_start <= '" . date('Y-m-d') . "'

As in registration_start has passed.

We want events to continue to show if they are full or if registration closes up until the time the event starts or ends, preferably starts but either works.

That should happen by default anyway, do you see something different?

So putting the change to the registration_start date together with the current behavior, line 177 should be:

$sql .= $show_expired == 'false' ? " AND (e.start_date >= '" . date('Y-m-d') . "' OR e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') AND (e.registration_start <= '" . date('Y-m-d') . "' ) " : '';


Jason Lee

April 13, 2016 at 9:47 am

Custom template display is version 1.0 and shows no updates available.

Yes, we are seeing something different. Events are staying on for the entire day, not just until they start


Tony

  • Support Staff

April 13, 2016 at 11:08 am

The latest version of the Custom Template Add-on is v1.1, you’ll find it within your account page. I’m not sure why that is not shoing on your site, do you have any plugins that stop updates?

Yes, we are seeing something different. Events are staying on for the entire day, not just until they start

Oh sorry, I understand now. The for that kind of customization your going to need the help of a developer, the event time is not currently considered within the query (its used in the order by) but you’ll needed to build out the query to also check based on the current time.

The support post ‘How to Hide Events that are not open for registration yet (not_open)’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 3 years, 7 months ago ago

Topic Tags

Tagged: 

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.