- "Generic" filter splitted up and move to html_mail_filter.php as this filter will only work with ext-html_mail
installed
- ext-holiday does now register a filter on user_exclusion_sql which allows to remove some "static" if() blocks
- Other minor fixes
inc/extensions/ext-yoomedia.php svneol=native#text/plain
inc/extensions/forced/.htaccess svneol=native#text/plain
inc/extensions/forced/mode-setup.php svneol=native#text/plain
+inc/extensions/holiday/.htaccess svneol=native#text/plain
+inc/extensions/holiday/mode-update.php svneol=native#text/plain
inc/extensions/network/.htaccess svneol=native#text/plain
inc/extensions/network/mode-setup.php svneol=native#text/plain
inc/extensions/order/.htaccess svneol=native#text/plain
inc/filter/doubler_filter.php svneol=native#text/plain
inc/filter/earning_filter.php svneol=native#text/plain
inc/filter/forced_filter.php svneol=native#text/plain
+inc/filter/holiday_filter.php svneol=native#text/plain
inc/filter/html_mail_filter.php svneol=native#text/plain
inc/filter/mediadata_filter.php svneol=native#text/plain
inc/filter/menu_filter.php svneol=native#text/plain
$excludeSql = '';
// Shall I include only active members?
+// @TODO Move this out to an extension
if ((getConfig('birthday_active') == 'Y') && (isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
$excludeSql = ' AND (UNIX_TIMESTAMP() - `d`.`last_online`) < {?ap_inactive_since?}';
} // END - if
-// Is ext-holiday installed?
-// @TODO Rewrite these if() blocks to a filter
-if (isExtensionActive('holiday')) {
- // Exclude those as well
- $excludeSql .= " AND `d`.`holiday_active`='N'";
-} // END - if
-
// Only confirmed members shall receive birthday mails...
$result_birthday = sqlQueryEscaped("SELECT
`d`.`userid`,
`{?_MYSQL_PREFIX?}_user_data` AS `d`
WHERE
`d`.`status`='CONFIRMED'
- " . runFilterChain('user_exclusion_sql', $excludeSql) . " AND
+ " . runFilterChain('user_exclusion_sql', ' ' . $excludeSql) . " AND
`d`.`birth_day`=%s AND
`d`.`birth_month`=%s AND
`d`.`birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
} // END - if
// Version number
-setThisExtensionVersion('0.2.1');
+setThisExtensionVersion('0.2.2');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2'));
switch (getExtensionMode()) {
case 'setup': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='holiday' LIMIT 4");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES (0,'Urlaub')");
+
+ // Unregister filter
+ unregisterFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'HOLIDAY_USER_EXCLUSION_SQL', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
break;
case 'update': // Update an extension
- switch (getCurrentExtensionVersion())
- {
- case '0.0.2': // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
- break;
-
- case '0.0.3': // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
- break;
-
- case '0.0.4': // SQL queries for v0.0.4
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
- break;
-
- case '0.0.5': // SQL queries for v0.0.5
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
- break;
-
- case '0.0.6': // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
- break;
-
- case '0.0.7': // SQL queries for v0.0.7
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
- break;
-
- case '0.0.8': // SQL queries for v0.0.8
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
- break;
-
- case '0.0.9': // SQL queries for v0.0.9
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
- break;
-
- case '0.1.0': // SQL queries for v0.2.1
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
- break;
-
- case '0.1.1': // SQL queries for v0.1.1
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
- break;
-
- case '0.1.2': // SQL queries for v0.1.2
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Abspeichern der Urlaubsanfrage korregiert.");
- break;
-
- case '0.1.3': // SQL queries for v0.1.3
- addExtensionAddTableColumnSql('user_data', 'holiday_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1");
- addConfigAddSql('holiday_lock', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 2));
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Die Mitgliedaccounts werden nicht mehr gesperrt, sondern nur auf <strong>Urlaub</strong> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!");
- break;
-
- case '0.1.4': // SQL queries for v0.1.4
- addConfigAddSql('holiday_mode', "ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'");
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Urlaubsschaltung wird erst Abends um 00:00 Uhr aktiv und nicht durch die Beantragung. Dies kann nun auch auf direkte Umstellung eingestellt werden.");
- break;
-
- case '0.1.5': // SQL queries for v0.1.5
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle.");
- break;
-
- case '0.1.6': // SQL queries for v0.1.6
- addExtensionAddTableColumnSql('user_data', 'holiday_activated', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Fehlende Tabellenspalte hinzugefügt.");
- break;
-
- case '0.1.7': // SQL queries for v0.1.7
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
- break;
-
- case '0.1.8': // SQL queries for v0.1.8
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'list_holiday')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'del_holiday')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('config', '', 'config_holiday')");
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Erweiterung in's neue Menüsystem integriert.");
- break;
-
- case '0.1.9': // SQL queries for v0.1.9
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account',`title`='In Urlaub',`sort`=2 WHERE `what`='holiday' LIMIT 1");
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
- break;
-
- case '0.2.0': // SQL queries for v0.2.0
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Urlaubsmanagement' WHERE `action`='holiday' AND (`what`='' OR `what` IS NULL) LIMIT 1");
-
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
- break;
-
- case '0.2.1': // SQL queries for v0.2.1
- // Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
- break;
- } // END - switch
break;
case 'modify': // When the extension got modified
addExtensionAddTableColumnSql('bonus', 'html_msg', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
addExtensionAddTableColumnSql('pool', 'html_msg', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
addMemberMenuSql('main', 'html_mail', 'HTML-Empfang', 3);
+
+ // Register filter here
+ registerFilter(__FILE__, __LINE__, 'exclude_users', 'HTML_INCLUDE_USERS', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
// Remove filter(s)
unregisterFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_URL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'exclude_users', 'HTML_INCLUDE_USERS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/17/2004 *
+ * =================== Last change: 01/13/2006 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : mode-update.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Holiday requests from members *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Ferienantraege von Mitgliedern *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.2': // SQL queries for v0.0.2
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
+ break;
+
+ case '0.0.3': // SQL queries for v0.0.3
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+ break;
+
+ case '0.0.4': // SQL queries for v0.0.4
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
+ break;
+
+ case '0.0.5': // SQL queries for v0.0.5
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
+ break;
+
+ case '0.0.6': // SQL queries for v0.0.6
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
+ break;
+
+ case '0.0.7': // SQL queries for v0.0.7
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
+ break;
+
+ case '0.0.8': // SQL queries for v0.0.8
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
+ break;
+
+ case '0.0.9': // SQL queries for v0.0.9
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
+ break;
+
+ case '0.1.0': // SQL queries for v0.1.0
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
+ break;
+
+ case '0.1.1': // SQL queries for v0.1.1
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
+ break;
+
+ case '0.1.2': // SQL queries for v0.1.2
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Abspeichern der Urlaubsanfrage korregiert.");
+ break;
+
+ case '0.1.3': // SQL queries for v0.1.3
+ addExtensionAddTableColumnSql('user_data', 'holiday_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1");
+ addConfigAddSql('holiday_lock', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 2));
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Die Mitgliedaccounts werden nicht mehr gesperrt, sondern nur auf <strong>Urlaub</strong> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!");
+ break;
+
+ case '0.1.4': // SQL queries for v0.1.4
+ addConfigAddSql('holiday_mode', "ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Urlaubsschaltung wird erst Abends um 00:00 Uhr aktiv und nicht durch die Beantragung. Dies kann nun auch auf direkte Umstellung eingestellt werden.");
+ break;
+
+ case '0.1.5': // SQL queries for v0.1.5
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle.");
+ break;
+
+ case '0.1.6': // SQL queries for v0.1.6
+ addExtensionAddTableColumnSql('user_data', 'holiday_activated', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Fehlende Tabellenspalte hinzugefügt.");
+ break;
+
+ case '0.1.7': // SQL queries for v0.1.7
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
+ break;
+
+ case '0.1.8': // SQL queries for v0.1.8
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'list_holiday')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'del_holiday')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('config', '', 'config_holiday')");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Erweiterung in's neue Menüsystem integriert.");
+ break;
+
+ case '0.1.9': // SQL queries for v0.1.9
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account',`title`='In Urlaub',`sort`=2 WHERE `what`='holiday' LIMIT 1");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
+ break;
+
+ case '0.2.0': // SQL queries for v0.2.0
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Urlaubsmanagement' WHERE `action`='holiday' AND (`what`='' OR `what` IS NULL) LIMIT 1");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
+ break;
+
+ case '0.2.1': // SQL queries for v0.2.1
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
+ break;
+
+ case '0.2.2': // SQL queries for v0.2.2
+ // Register filter
+ registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'HOLIDAY_USER_EXCLUSION_SQL', FALSE, TRUE, isExtensionDryRun());
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Filter registriert für Mitglied-Ausschluss, die in Urlaub sind.");
+ break;
+ } // END - switch
+
+// [EOF]
+?>
// Remove extension
registerFilter(__FUNCTION__, __LINE__, 'extension_remove', 'REMOVE_EXTENSION');
- // Exclude some users
- registerFilter(__FUNCTION__, __LINE__, 'exclude_users', 'HTML_INCLUDE_USERS');
-
// Handling of fatal errors
registerFilter(__FUNCTION__, __LINE__, 'handle_fatal_errors', 'HANDLE_FATAL_ERRORS');
// In installation phase we always want to abort
if (($silentAbort === FALSE) || (isInstaller())) {
// Add fatal message
- reportBug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered! file=%s,L=%s,force=%d", $filterName, $filterFunction, basename($file), $line, intval($force)));
+ reportBug(__FUNCTION__, __LINE__, sprintf('Filter chain %s has already filter function %s registered! file=%s,L=%s,force=%d', $filterName, $filterFunction, basename($file), $line, intval($force)));
} // END - if
// Abort here
// Is the function there?
if (!function_exists($filterFunction)) {
// Then abort here
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s. file=%s,L=%s,force=%d", $filterFunction, $filterName, basename($file), $line, intval($force)));
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Filter function %s could not be added to filter chain %s. file=%s,L=%s,force=%d', $filterFunction, $filterName, basename($file), $line, intval($force)));
return FALSE;
} // END - if
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Filter for excluding holiday users in WHERE statements
+function FILTER_HOLIDAY_USER_EXCLUSION_SQL ($sql) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called! - sql(' . strlen($sql) . ')=' . $sql);
+
+ // Add it, as of this filter is registered only with ext-user >= 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;
+}
+
+// [EOF]
+?>
return $filterData;
}
+// Prepares an SQL statement part for HTML mail
+function FILTER_HTML_INCLUDE_USERS ($mode) {
+ // Exclude no users by default
+ $MORE = '';
+
+ // HTML mail?
+ if ($mode == 'html') {
+ $MORE = " AND `html`='Y'";
+ } // END - if
+
+ // Return result
+ return $MORE;
+}
+
// [EOF]
?>
outputHtml();
}
-// Prepares an SQL statement part for HTML mail and/or holiday dependency
-function FILTER_HTML_INCLUDE_USERS ($mode) {
- // Exclude no users by default
- $MORE = '';
-
- // HTML mail?
- if ($mode == 'html') {
- $MORE = " AND `html`='Y'";
- } // END - if
-
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Add something for the holiday extension
- $MORE .= " AND `holiday_active`='N'";
- } // END - if
-
- // Return result
- return $MORE;
-}
-
// Filter for determining what/action/module
function FILTER_DETERMINE_WHAT_ACTION () {
// In installation phase we don't have what/action
$userExclusionSql .= ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
} // END - if
- // Check for more extensions
- // @TODO This can be rewritten to filter
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Recent ext-holiday found
- $userExclusionSql .= " AND `d`.`holiday_active`='N'";
- } // END - if
-
// Check for all accounts
addSql("SELECT
`d`.`userid`,
(UNIX_TIMESTAMP() - `d`.`joined`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `d`.`last_online`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `d`.`ap_notified`) >= {?ap_inactive_since?}
- " . runFilterChain('user_exclusion_sql', $userExclusionSql) . "
+ " . runFilterChain('user_exclusion_sql', ' ' . $userExclusionSql) . "
ORDER BY
`d`.`userid` ASC");
$WHATs[] = 'list_autopurge';
} // END - switch
if (!empty($sql)) {
- // Init additional WHERE statement
- $whereStatement = '';
-
- // Is ext-holiday installed?
- // @TODO Rewrite these if() blocks to a filter
- if (isExtensionActive('holiday')) {
- // Exclude those as well
- $whereStatement .= " AND `d`.`holiday_active`='N'";
- } // END - if
-
// The SQL command needs to be finisched here (only confirmed accounts!)
- $sql .= ')' . $whereStatement . runFilterChain('user_exclusion_sql', " AND `d`.`status`='CONFIRMED'") . ' ORDER BY `d`.`last_online` ASC';
+ $sql .= ')' . runFilterChain('user_exclusion_sql', " AND `d`.`status`='CONFIRMED'") . ' ORDER BY `d`.`last_online` ASC';
// No IP locking setuped by default
$content['ip_locker'] = '{--BEG_NO_LIMITATION--}';
} // END - switch
if (!empty($sql)) {
- // Init additional WHERE statement
- $whereStatement = '';
-
- // Is ext-holiday installed?
- // @TODO Rewrite these if() blocks to a filter
- if (isExtensionActive('holiday')) {
- // Exclude those as well
- $whereStatement .= " AND `d`.`holiday_active`='N'";
- } // END - if
-
// The SQL command needs to be finisched here (only confirmed accounts!)
- $sql .= ')' . $whereStatement . runFilterChain('user_exclusion_sql', " AND `d`.`status`='CONFIRMED'") . ' ORDER BY `d`.`last_online` ASC';
+ $sql .= ')' . runFilterChain('user_exclusion_sql', " AND `d`.`status`='CONFIRMED'") . ' ORDER BY `d`.`last_online` ASC';
// Normal notification mails or bonus mails?
$sentBonusMails = ((getBonusNotifyPoints() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
setSession('DOUBLER_USERID', '');
if (empty($GLOBALS['local_doubler_userid'])) $GLOBALS['local_doubler_userid'] = '0';
-// Init additional WHERE statement
-$whereStatement = ' ';
-
-// Is ext-holiday installed?
-// @TODO Rewrite these if() blocks to a filter
-if (isExtensionActive('holiday')) {
- // Exclude those as well
- $whereStatement .= " AND `d`.`holiday_active`='N'";
-} // END - if
-
// Check for doubles which we can pay out
$result_total = sqlQueryEscaped("SELECT
COUNT(`do`.`id`) AS `cnt`,
`do`.`userid`=`d`.`userid`
WHERE
`d`.`status`='CONFIRMED'
- " . runFilterChain('user_exclusion_sql', $whereStatement) . " AND
+ " . runFilterChain('user_exclusion_sql', ' ' . $whereStatement) . " AND
`do`.`points` <= %s AND
`do`.`points` >= ({?doubler_min?} * 2) AND
`do`.`completed`='N' AND
`do`.`userid`=`d`.`userid`
WHERE
`d`.`status`='CONFIRMED'
- " . runFilterChain('user_exclusion_sql', $whereStatement) . " AND
+ " . runFilterChain('user_exclusion_sql', ' ' . $whereStatement) . " AND
`do`.`points` <= %s AND
`do`.`points` >= ({?doubler_min?} * 2) AND
`do`.`completed`='N' AND
$userExcludeSql = ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
} // END - if
-// @TODO Rewrite this as a filter
-if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- $userExclusionSql .= " AND `d`.`holiday_active`='N'";
-} // END - if
-
// Check for all accounts
$result = sqlQuery("SELECT
`d`.`userid`,
(UNIX_TIMESTAMP() - `d`.`joined`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `d`.`last_online`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `d`.`ap_notified`) >= {?ap_inactive_since?}
- " . runFilterChain('user_exclusion_sql', $userExcludeSql) . "
+ " . runFilterChain('user_exclusion_sql', ' ' . $userExcludeSql) . "
ORDER BY
`d`.`userid` ASC", __FILE__, __LINE__);
}
// Exclude other users
- $whereStatement = runFilterChain('user_exclusion_sql', $whereStatement);
+ $whereStatement = runFilterChain('user_exclusion_sql', ' ' . $whereStatement);
} elseif (isGetRequestElementSet('do')) {
// Choose what we need to list
switch (getRequestElement('do')) {
// If it is not 'testers', add exclusion SQL
if (getRequestElement('do') != 'testers') {
// Exclude tester users
- $whereStatement = runFilterChain('user_exclusion_sql', $whereStatement);
+ $whereStatement = runFilterChain('user_exclusion_sql', ' ' . $whereStatement);
} // END - if
} // END - if
if (isFormSent()) {
// Save settings
sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `html`='%s' WHERE `userid`=%s LIMIT 1",
- array(postRequestElement('html'), getMemberId()), __FILE__, __LINE__);
+ array(
+ postRequestElement('html'),
+ getMemberId()
+ ), __FILE__, __LINE__
+ );
displayMessage('{--MEMBER_SETTINGS_SAVED--}');
} else {
// Prepare it
// Enable HTML checking
// @TODO Rewrite this to a filter
- $HTML = ''; $HOL_STRING = '';
+ $HTML = '';
if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) {
$HTML = " AND `html`='Y'";
} // END - if
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Extension's version is fine
- $HOL_STRING = " AND `holiday_active`='N'";
- } // END - if
// ... and begin loading stuff
while ($categoriesContent = sqlFetchArray($result_cats)) {
$whereStatement .= ' AND (UNIX_TIMESTAMP() - `d`.`last_online`) < {?ap_inactive_since?}';
} // END - if
- // Is ext-holiday installed?
- if (isExtensionActive('holiday')) {
- // Exclude those as well
- $whereStatement .= " AND `d`.`holiday_active`='N'";
- } // END - if
-
// SQL string to check for accounts
$result_main = sqlQuery("SELECT
`d`.`userid`,
`{?_MYSQL_PREFIX?}_user_data` AS `d`
WHERE
`d`.`status`='CONFIRMED'
- " . $whereStatement . "
- " . runFilterChain('user_exclusion_sql', ' ') . " AND
+ " . runFilterChain('user_exclusion_sql', $whereStatement) . " AND
`d`.`beg_points` > 0
ORDER BY
`d`.`beg_points` DESC,
$whereStatement .= ' AND (UNIX_TIMESTAMP() - `d`.`last_online`) < {?ap_inactive_since?}';
} // END - if
- // Is ext-holiday installed?
- if (isExtensionActive('holiday')) {
- // Exclude those as well
- $whereStatement .= " AND `d`.`holiday_active`='N'";
- } // END - if
-
// Add more bonus points here by running a filter
$add = runFilterChain('add_bonus_points_user_columns', '');
$addWhere .= " AND `d`.`holiday_active`='N'";
} // END - if
- // Include only HTML recipients?
- if ((isExtensionActive('html_mail')) && ($mode == 'html')) {
- $addWhere .= " AND `d`.`html`='Y'";
- } // END - if
-
// Run query
$result = sqlQueryEscaped("SELECT
`d`.`userid`
$excludeSql = ' AND `userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
} // END - if
- // Check for new holiday extension
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Include only users with no active holiday
- $excludeSql .= " AND `holiday_active`='N'";
- } // END - if
-
// Check for all accounts
$result_inactive = sqlQuery("SELECT
`userid`,
(UNIX_TIMESTAMP() - `joined`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_since?}
- " . runFilterChain('user_exclusion_sql', $excludeSql) . "
+ " . runFilterChain('user_exclusion_sql', ' ' . $excludeSql) . "
ORDER BY
`userid` ASC", __FILE__, __LINE__);
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED'
- " . runFilterChain('user_exclusion_sql', $excludeSql) . " AND
+ " . runFilterChain('user_exclusion_sql', ' ' . $excludeSql) . " AND
(UNIX_TIMESTAMP() - `joined`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND
(UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_time?} AND