= 0.5.0 if (empty($sql)) { // Add WHERE $sql = " WHERE `holiday_active` = 'N'"; } else { // Add AND $sql .= " AND `holiday_active` = 'N'"; } // Return the data for next filter //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done! - sql(' . strlen($sql) . ')=' . $sql); return $sql; } // Filter to check for user's holiday function FILTER_CHECK_USER_HOLIDAY ($filterData) { // Is the id number set and valid? if ((isset($filterData['userid'])) && (isValidId($filterData['userid']))) { // Check for his holiday status $result_holiday = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP() LIMIT 1", array($filterData['userid']), __FILE__, __LINE__); // Entry found? if (sqlNumRows($result_holiday) == 1) { // Exclude user who are in holiday $filterData['userid'] = NULL; } // END - if // Free memory sqlFreeResult($result_holiday); } // END - if // Return data for next filter return $filterData; } // Filter to check if holiday is activated function FILTER_PRE_USERID_HOLIDAY_CHECK ($filterData) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); // Is it still fine? if ((isValidId($filterData['userid'])) && ($filterData['pre_okay'] === TRUE)) { // Check user's holiday status $result_holiday = sqlQueryEscaped("SELECT COUNT(`d`.`userid`) AS `cnt` FROM `{?_MYSQL_PREFIX?}_user_data` AS `d` LEFT JOIN `{?_MYSQL_PREFIX?}_user_holidays` AS `h` ON `d`.`userid`=`h`.`userid` WHERE `d`.`userid`=%s AND `d`.`receive_mails` > 0 AND `d`.`status`='CONFIRMED' AND `d`.`holiday_active`='Y' AND `h`.`holiday_start` < UNIX_TIMESTAMP() AND `h`.`holiday_end` > UNIX_TIMESTAMP() LIMIT 1", array( bigintval($filterData['userid']) ), __FILE__, __LINE__ ); // Fetch entry list($count) = sqlFetchRow($result_holiday); // Free memory sqlFreeResult($result_holiday); // Is holiday is active? $filterData['pre_check'] = ($count == 0); } // END - if // Return filter data to next filter //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $filterData; } // [EOF] ?>