From 30fa3d616b6a096d3bda4a139014d370fdf21889 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 2 Aug 2016 13:57:41 -0400 Subject: [PATCH] Set start at 1 and increment inside do while loop Updating the checks for events counts. Remove debug output. --- models/front/events/list.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/models/front/events/list.php b/models/front/events/list.php index 90e0741..483c43c 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -44,6 +44,7 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction */ public function modelAction( $actionData = false ) { + $limit = null; $status = null; $categoryId = null; $action = ''; @@ -137,19 +138,14 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction } else { // This is the default date range for this agenda view $total_current_events = $this->checkHaveAnyEvents(); - echo '
$total_current_events: ' . print_r( $total_current_events, true ) . '
'; - $weeks_to_check = 2; + $weeks_to_check = 1; $event_count = 0; do { - $event_count = $this->getEventCountForWeekRange( $weeks_to_check ); - ++$weeks_to_check; + $event_count = $this->getEventCountForWeekRange( ++$weeks_to_check ); } while ( $event_count <= 5 && $total_current_events > 5 ); - echo '
$event_count: ' . print_r( $event_count, true ) . '
'; - echo '
$weeks_to_check: ' . print_r( $weeks_to_check, true ) . '
'; - $week_string = ( $weeks === 1 ) ? 'weeks': 'week'; + $week_string = ( $weeks_to_check === 1 ) ? 'weeks': 'week'; $toDate = date('m/d/Y', strtotime( '+ ' . $weeks_to_check . ' ' . $week_string )); - echo '
$toDate: ' . print_r( $toDate, true ) . '
'; } } if ( $fromDate && $toDate && !(isset($_REQUEST['event_name']) && $_REQUEST['event_name'])) { -- 2.17.1