From b33d332d7d9b93e22f426a34145b100643f8bff5 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 6 Mar 2017 15:09:16 -0500 Subject: [PATCH] Fix for recur days. If they have everything check for week of days don't show them. --- index.php | 6 +++--- models/front/events/baseAction.php | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 4d17e00..67e6033 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Events * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.6.19 + * Version: 1.6.21 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -20,7 +20,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.6.19 + * @version 1.6.21 */ /* @@ -38,7 +38,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.19'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.21'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.1'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/baseAction.php b/models/front/events/baseAction.php index a49bf77..43eaa60 100644 --- a/models/front/events/baseAction.php +++ b/models/front/events/baseAction.php @@ -480,9 +480,13 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents $weeksOfMonth[] = 'last'; break; } - $recurs[] = implode( ' ', $weeksOfMonth ); + if ( count( $weeksOfMonth ) < 6 ) { + $recurs[] = implode( ' ', $weeksOfMonth ); + } + } + if ( count( $recurs ) >= 1 ) { + $eventDates .= 'Every ' . implode( ' ', $recurs ); } - $eventDates .= 'Every ' . implode( ' ', $recurs ); } $daysOfWeek = array(); foreach ( $recur['day_of_week']['names'] as $dow ) { -- 2.17.1