Support

Home Forums Event Espresso Premium Disable "There are no upcoming dates for this event" notice when event is active

Disable "There are no upcoming dates for this event" notice when event is active

Posted: October 26, 2014 at 1:49 pm

Viewing 7 reply threads


ty bonlando

October 26, 2014 at 1:49 pm

Hello,

Is there a way to disable this feature entirely, so there is no message when the event is currently active?

I don’t think it is important, and really just confuses the guests. They can figure out if the event is currently happening by looking at their watch.

I am using the latest version of EE4.

Thanks!


Lorenzo Orlando Caum

  • Support Staff

October 27, 2014 at 9:50 pm

Hi Ty,

Technically the messaging is correct since upcoming and active are different.

This verbiage can be changed by using a gettext filter:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#plugins

We are also exploring some options for how the upcoming events widget handles this.


Lorenzo


ty bonlando

October 28, 2014 at 8:29 am

thanks for the Lorenzo, is there a way to just disable the message altogether? So the times and dates always remain?


Lorenzo Orlando Caum

  • Support Staff

October 28, 2014 at 9:10 am

Not currently. However, you can update the messaging:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#plugins


Lorenzo


ty bonlando

October 28, 2014 at 10:16 am

Hopefully someone could develop a way to take this feature away, as i’ve had a few guests complain that they are not able to see when the event is over (as a lot of our shows allow for people to come in and out when they want. Also, it’s not matching up with the correct times, the server time in wordpress settings is accurate, so i’m not sure how to fix this.


ty bonlando

October 28, 2014 at 1:08 pm

i’ve downloaded the entire PO file, but this text doesn’t seem to exist in it. Help?


ty bonlando

October 28, 2014 at 1:12 pm

I mean, I could just modify the EEH_Event_View.helper.php, but it would get overwritten in an upgrade.

	/**
	 * espresso_list_of_event_dates
	* returns a unordered list of dates for an event
	*
	 * @return string
	 */
	if ( ! function_exists( 'espresso_list_of_event_dates' )) {
		function espresso_list_of_event_dates( $EVT_ID = FALSE, $dt_frmt = '', $tm_frmt = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE ) {
			$dt_frmt = ! empty( $dt_frmt ) ? $dt_frmt : get_option('date_format');
			$tm_frmt = ! empty( $tm_frmt ) ? $tm_frmt : get_option('time_format');
			$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID ,$show_expired );
			//d( $datetimes );
			if ( is_array( $datetimes ) && ! empty( $datetimes )) {
				global $post;
				$html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul">' : '';
				foreach ( $datetimes as $datetime ) {
					if ( $datetime instanceof EE_Datetime ) {
						if ( $format ) {
							$html .= '<li id="ee-event-datetimes-li-' . $datetime->ID() . '" class="ee-event-datetimes-li">';
							$datetime_name = $datetime->name();
							$html .= ! empty( $datetime_name ) ? '<strong>' . $datetime_name . '</strong>' : '';
							$html .= ! empty( $datetime_name )  && $add_breaks ? '<br />' : '';
							$html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $dt_frmt ) . '';
							//$html .= ! empty( $datetime_name )  && $add_breaks ? '<br />' : '';
							$html .= '<br /><span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $tm_frmt );
							$datetime_description = $datetime->description();
							$html .= ! empty( $datetime_description )  && $add_breaks ? '<br />' : '';
							$html .= ! empty( $datetime_description ) ? ' - ' . $datetime_description : '';
							$html .= '</li>';
						} else {
							$html .= $datetime;
						}
					}
				}
				$html .= $format ? '</ul>' : '';
			} else {
				$html = $format ?  '<p><span class="dashicons dashicons-marker pink-text"></span>' . __( 'There are no upcoming dates for this event.', 'event_espresso' ) . '</p><br/>' : '';
			}
			if ( $echo ) {
				echo $html;
			} else {
				return $html;
			}
		}
	}


Lorenzo Orlando Caum

  • Support Staff

October 28, 2014 at 3:15 pm

Could you give this a try?

https://gist.github.com/lorenzocaum/efab9a75b9f4a08e075b


Lorenzo

Viewing 7 reply threads

The support post ‘Disable "There are no upcoming dates for this event" notice when event is active’ 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