X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Ffilters.php;h=fcafc63c0ea18c7c25b6265986d489f6be06df24;hb=b3154fcf34de56f8069671d850f99eda386127c3;hp=c24ca0c73614660b735a995c0e69a7d98da12f2b;hpb=e68f2f7b0a55fa31eb7ce5baf844dca40f11abea;p=mailer.git diff --git a/inc/filters.php b/inc/filters.php index c24ca0c736..fcafc63c0e 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * 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 * @@ -60,8 +60,12 @@ function FILTER_FLUSH_FILTERS () { // Is the extension ext-sql_patches updated? if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) { + // Log only in debug mode + if (isDebugModeEnabled()) { + logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . intval(isExtensionInstalled('sql_patches')) . ',isExtensionInstalledAndOlder()=' . intval(isExtensionInstalledAndOlder('sql_patches', '0.5.9'))); + } // END - if + // Abort silently here - logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9')); return false; } // END - if @@ -252,7 +256,7 @@ function FILTER_RUN_SQLS ($filterData) { if ((isSqlsValid()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == false))) { // Run SQL commands //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Found ' . countSqls() . ' queries to run.'); - foreach (getSqls() as $mode=>$sqls) { + foreach (getSqls() as $mode => $sqls) { // Debug message //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mode=' . $mode . ',count()=' . count($sqls)); @@ -400,7 +404,7 @@ function FILTER_DETERMINE_USERNAME () { } // END - if } else { // Hmmm, logged in and no valid userid? - setUsername('{--USERNAME_UNKNOWN--}'); + setUsername('{--USERNAME_UNKNOWN--}'); // Destroy session destroyMemberSession(); @@ -526,7 +530,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($filterData) { $data = array( 'matches' => $matches, 'key' => $key, - 'mode' => getScriptOutputMode(), + 'output_mode' => getScriptOutputMode(), 'code' => $filterData, 'callback' => $callback, 'extra_func' => $extraFunction, @@ -599,8 +603,8 @@ function FILTER_RUN_RESET_INCLUDES () { // Get more daily reset scripts setIncludePool('reset', getArrayFromDirectory('inc/daily/', 'daily_')); - // Update database - if ((!isConfigEntrySet('DEBUG_RESET')) || (!isDebugResetEnabled())) { + // Update configuration if this reset is not being debugged + if (!isDebugResetEnabled()) { updateConfiguration('last_update', 'UNIX_TIMESTAMP()'); } // END - if @@ -611,7 +615,7 @@ function FILTER_RUN_RESET_INCLUDES () { // Include weekly reset scripts mergeIncludePool('reset', getArrayFromDirectory('inc/weekly/', 'weekly_')); - // Update config if not in debug mode + // Update configuration if this reset is not being debugged if (!isWeeklyResetDebugEnabled()) { updateConfiguration('last_week', getWeek()); } // END - if @@ -625,7 +629,7 @@ function FILTER_RUN_RESET_INCLUDES () { // Include monthly reset scripts mergeIncludePool('reset', getArrayFromDirectory('inc/monthly/', 'monthly_')); - // Update config + // Update configuration if this reset is not being debugged if (!isMonthlyResetDebugEnabled()) { updateConfiguration('last_month', $currMonth); } // END - if @@ -655,13 +659,16 @@ function FILTER_FLUSH_OUTPUT () { outputHtml(''); } -// Prepares an SQL statement part for HTML mail and/or holiday depency +// 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'"; + 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'"; @@ -688,9 +695,9 @@ function FILTER_DETERMINE_WHAT_ACTION () { // Fix module if (!isModuleSet()) { // Is the request element set? - if (isGetRequestParameterSet('module')) { + if (isGetRequestElementSet('module')) { // Set module from request - setModule(getRequestParameter('module')); + setModule(getRequestElement('module')); } elseif (isHtmlOutputMode()) { // Set default module 'index' setModule('index'); @@ -774,7 +781,7 @@ function FILTER_RUN_DAILY_RESET () { } // END - if // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D - if (((getDay(getConfig('last_update')) != getDay()) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (!isCssOutputMode())) { + if (((getDay(getConfig('last_update')) != getDay()) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('register')) && (!isCssOutputMode())) { // Tell every module we are in reset-mode! doReset(); } // END - if @@ -788,7 +795,7 @@ function FILTER_RUN_HOURLY_RESET () { } // END - if // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D - if ((((isConfigEntrySet('last_hour')) && (getConfig('last_hour') != getHour())) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (!isCssOutputMode())) { + if ((((isConfigEntrySet('last_hour')) && (getConfig('last_hour') != getHour())) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestElementSet('register')) && (!isCssOutputMode())) { // Tell every module we are in reset-mode! doHourly(); } // END - if @@ -934,7 +941,7 @@ function FILTER_HANDLE_FATAL_ERRORS () { // Filter for displaying copyright line function FILTER_DISPLAY_COPYRIGHT () { // Shall we display the copyright notice? - if ((!isGetRequestParameterSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == 2)) { + if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == 2)) { // Backlink enabled? if (((isConfigEntrySet('ENABLE_BACKLINK')) && (getConfig('ENABLE_BACKLINK') == 'Y')) || (isInstalling())) { // Copyright with backlink, thanks! :-) @@ -950,7 +957,7 @@ function FILTER_DISPLAY_COPYRIGHT () { function FILTER_DISPLAY_PARSING_TIME () { // Shall we display the parsing time and number of queries? // 1234 5 54 4 5 5 4 4 5 543 3 4432 2 33 2 2 21 - if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestParameterSet('frame'))) || (isInstallationPhase())) && (isHtmlOutputMode()) && ($GLOBALS['header_sent'] == 2)) { + if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (isHtmlOutputMode()) && ($GLOBALS['header_sent'] == 2)) { // Then display it here displayParsingTime(); } // END - if @@ -1113,8 +1120,8 @@ function FILTER_ACTIVATE_EXCHANGE () { // Check total amount of users if (getTotalConfirmedUser() >= getActivateXchange()) { // Activate System - addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1"); - addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2"); + addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N',`hidden`='N',`mem_only`='Y' WHERE `module`='order' LIMIT 1"); + addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2"); // Run SQLs runFilterChain('run_sqls'); @@ -1145,12 +1152,12 @@ function FILTER_HANDLE_HOME_IN_INDEX_SETTING ($filterData) { // Filter to add history entry function FILTER_ADD_HISTORY_ENTRY ($filterData) { // Add the entry - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_history` (`history_subject`,`history_userid`,`history_value`) VALUES('%s',%s,'%s')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_history` (`history_subject`,`history_userid`,`history_value`) VALUES ('%s',%s,'%s')", $filterData, __FUNCTION__, __LINE__); // Remember insert id for other filters - $filterData['history_id'] = SQL_INSERT_ID(); + $filterData['history_id'] = SQL_INSERTID(); // Return data return $filterData;