From: Steve Sutton Date: Wed, 29 May 2019 18:20:30 +0000 (-0400) Subject: Update pdf X-Git-Tag: v1.7.24^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9c0c6899c1a0335ad5ca0a1a150e4e219f4e0a41;p=WP-Plugins%2Fglm-member-db-events.git Update pdf Only output event schedules if they are within the date range search. --- diff --git a/index.php b/index.php index b286ea2..4974065 100755 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Associate - Events Add-On * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.7.23 + * Version: 1.7.24 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.7.23 + * @version 1.7.24 */ // Check that we're being called by WordPress. @@ -43,7 +43,7 @@ if (!defined('ABSPATH')) { * 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.7.23'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.7.24'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.14'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/pdfCreator.php b/models/front/events/pdfCreator.php index 9763652..58952bb 100644 --- a/models/front/events/pdfCreator.php +++ b/models/front/events/pdfCreator.php @@ -64,6 +64,7 @@ $totalEvents = count($events); $index = 0; $pdf->ezSetY( $this->pdf_top_y ); +// echo '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; foreach ( $events as $eventId => $event ) { $lineCount = 1; $eventTopY = $pdfY; @@ -72,6 +73,23 @@ foreach ( $events as $eventId => $event ) { $eventDates = ''; $recCounter = 0; foreach ( $event['recurrences'] as $rec ) { + if ( isset( $_REQUEST['glm_event_from'] ) ) { + $startingTime = strtotime( $_REQUEST['glm_event_from'] ); + } + // echo '
$startingTime: ' . print_r( $startingTime, true ) . '
'; + if ( isset( $_REQUEST['glm_event_from'] ) ) { + $endingTime = strtotime( $_REQUEST['glm_event_to'] ); + } + // echo '
$endingTime: ' . print_r( $endingTime, true ) . '
'; + if ( $startingTime && $endingTime && ( $rec['from_date']['timestamp'] > $endingTime || $rec['to_date']['timestamp'] < $startingTime ) ) { + continue; + } + if ( $startingTime && !$endingTime && $rec['to_date']['timestamp'] < $startingTime ) { + continue; + } + if ( !$startingTime && $endingTime && $rec['from_date']['timestamp'] > $endingTime ) { + continue; + } if ( $rec['name'] && !in_array( $rec['name'], array( 'Imported', 'Imported Event Schedule') ) ) { $eventDates .= $rec['name'] . ' '; }