From: Anthony Talarico Date: Mon, 12 Jun 2017 18:58:16 +0000 (-0400) Subject: adding session checking for paging in the events list admin model X-Git-Tag: v1.6.47^2~10^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9f42791076d02efb3c8599b00b918dfc7006c547;p=WP-Plugins%2Fglm-member-db-events.git adding session checking for paging in the events list admin model adding another section that checks to see if the session search variables are set and if they are use those for paging --- diff --git a/models/admin/events/list.php b/models/admin/events/list.php index a28942e..2a6a779 100644 --- a/models/admin/events/list.php +++ b/models/admin/events/list.php @@ -643,7 +643,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['prevStart'] ) ) { unset( $_SESSION['search']['prevStart'] ); } - + // Check for Archived filter if (isset($_REQUEST['filterArchived']) && $_REQUEST['filterArchived'] == 'on') { $filterArchived = true; @@ -779,7 +779,6 @@ class GlmMembersAdmin_events_list extends GlmDataEvents // Check if we're doing paging if (isset($_REQUEST['pageSelect'])) { - // If request is for Next if ($_REQUEST['pageSelect'][0] == 'N') { $newStart = $_REQUEST['nextStart'] - 0; @@ -793,6 +792,20 @@ class GlmMembersAdmin_events_list extends GlmDataEvents $start = $newStart; } } + + if( isset($_SESSION['search']['pageSelect']) ){ + // If request is for Next + if ($_SESSION['search']['pageSelect'][0] == 'N') { + $newStart = $_SESSION['search']['nextStart'] - 0; + + // Otherwise it must be Previous + } else { + $newStart = $_SESSION['search']['prevStart'] - 0; + } + if ($newStart > 0) { + $start = $newStart; + } + } // Get the list of events and determine number of events in list $saveFLT = $this->postFirstAndLastTimes;