Support

Home Forums Event Espresso Premium EE3 Event Status "Not Open" – possible to change icon in calendar to show this?

EE3 Event Status "Not Open" – possible to change icon in calendar to show this?

Posted: May 26, 2016 at 4:53 am

Viewing 6 reply threads


Angus Russell

May 26, 2016 at 4:53 am

I’d like to show an icon in the Event Calendar saying words to the effect “Not Open” when the event status is Not Open, instead of showing the default icon of “Enter Now”

I suspect I only need to add a line or 2 of code to this file wp-content/plugins/custom-templates/templates/events-table/template.php

and upload the icon I’d like to use?

Thanks
Angus


Josh

  • Support Staff

May 26, 2016 at 8:36 am

Hi Angus,

I’ll assume you mean the Event Table and not the calendar? If so here’s the basic code changes you’d make to the event table template:

1) Right after the start of the loop (the start of the loop being
foreach ($events as $event){
you add this code:

$registration_start = strtotime( $event->registration_start );
$not_open = $registration_start > current_time( 'timestamp' );

2) The following line of code will start with $button_text where you’ll change it to something like this:

$button_text = $not_open ? ‘Not Open’ : __(‘Register’, ‘event_espresso’);

3) You substitute ‘Not Open’ for some html that can be used to show the icon. You may also need to tweak the line of code that starts with $live_button as well.


Angus Russell

June 1, 2016 at 11:57 pm

the code now looks like this:

foreach ($events as $event){
      		$registration_start = strtotime( $event->registration_start );
		$not_open = $registration_start > current_time( 'timestamp' );
		$button_text = $not_open ? ‘<img src="public_html/wp-content/plugins/wdm_venue/coming_soon.png" />’ : __(‘Register’, ‘event_espresso’);
		$alt_but ......

but nothing has changed on the calendar table. It looks the same and appears to function the same too.

So, tweak the $live_button line how?

This one:


$live_button 		= '<a>id.'" href="'.$registration_url.'">'.$button_text.'</a>';

Thanks

  • This reply was modified 8 years, 4 months ago by Tony. Reason: code formatting


Tony

  • Support Staff

June 2, 2016 at 6:02 am

wp-content/plugins/custom-templates/templates/events-table/template.php

Is for the ‘Events Table’ and not the ‘Event Calendar’ or ‘Calendar table’.

Can you link us to the page you that shows the output you want to edit so we can confirm which template you are editing please?


Angus Russell

June 2, 2016 at 6:32 am

I meant to include that for you! http://supersportsevents.me/

However, that may not help!

The developers used this file “Event espresso add on for calendar template” (wp-content/plugins/wdm_venue/wdm_venue.php) to create a new template due to some changes we asked them to make. The shortcode on the page above is for “wdm-calendar-table”. The wdm file appears to be based on this file wp-content/plugins/espresso-template-calendar-table/index.php

So I think that is the template I need to change. At the moment, the template I changed, based on matching the code snippet, was “Default events-table template” which was here wp-content/plugins/custom-templates/templates/events-table/template.php

However, I’m waiting for Lorenzo to get to us about a gateway development, and if that is positive we’ll be upgrading to EE4, so this may be not worth pursuing if we’re going to spend too much time working out which file to edit!

Thanks
Angus


Tony

  • Support Staff

June 2, 2016 at 12:10 pm

I don’t know how that dev has made the changes so really can’t say which template it will be.

Normally I would say it would be:

wp-content/plugins/wdm_venue/wdm_venue.php

But again I don’t know anything about that customization so it really could be any. (Lots of ways to achieve the same result)

You can add a simple echo:

<?php echo "Testing"; ?>

To each template, load the page and search the source for ‘testing’ to find if it loads.


Angus Russell

June 5, 2016 at 1:28 am

Thanks

Viewing 6 reply threads

The support post ‘EE3 Event Status "Not Open" – possible to change icon in calendar to show this?’ 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.

Event Espresso