+// Filter for returning given user's locked order points
+function FILTER_LOCKED_ORDER_POINTS ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Is ext-user installed and active?
+ if (isExtensionActive('user')) {
+ // Get the points and add them to the existing
+ $filterData['points'] += countSumTotalData($filterData['userid'], 'user_points', 'locked_order_points');
+ } // END - if
+
+ // Return the data for next filter
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+
+// Filter for returning all user's order points column names
+function FILTER_GET_ALL_ORDER_POINTS_COLUMN_NAMES ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Add 'order_points' and 'locked_order_points'
+ $filterData['columns'] .= $filterData['alias'] . 'order_points' . $filterData['separator'] . $filterData['alias'] . 'locked_order_points' . $filterData['separator'];
+
+ // Return the data for next filter
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+
+// Filter for ZIP code inclusion (not exclusion but it must be run in exclusion filter chain)
+function FILTER_ORDER_ZIP_CODE_SQL ($sql) {
+ // Check if category and number of receivers is okay
+ if (isOrderMultiPageEnabled()) {
+ // Default is no zip code limitation
+ $zip = NULL;
+
+ // POST or GET elements?
+ if ((isPostRequestElementSet('zip')) && (postRequestElement('zip') != '')) {
+ // Choose recipients by zip code from POST
+ $zip = bigintval(postRequestElement('zip'));
+ } elseif ((isGetRequestElementSet('zip')) && (getRequestElement('zip') != '')) {
+ // Choose recipients by zip code from GET
+ $zip = bigintval(getRequestElement('zip'));
+ }
+
+ // Is the zip code set?
+ if (!is_null($zip)) {
+ // Is the previous SQL statement empty?
+ if (empty($sql)) {
+ // SQL statemet is empty, so use WHERE
+ $sql = sprintf(" WHERE `zip` LIKE '%s%%%%'", $zip);
+ } else {
+ // ... otherwise use AND
+ $sql .= sprintf(" AND `zip` LIKE '%s%%%%'", $zip);
+ }
+ } // END - if
+ } // END - if
+
+ // Return expanded SQL
+ return $sql;
+}
+
+// Filter for adding columns of points to array
+function FILTER_ORDER_POINTS_COLUMNS ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Add column
+ array_push($filterData, 'order_points');
+
+ // Return the data for next filter
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+