]> git.mxchange.org Git - mailer.git/commitdiff
Moved all FILTER_FOO() filter functions to an own include directory:
authorRoland Häder <roland@mxchange.org>
Thu, 2 Jun 2011 05:00:15 +0000 (05:00 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 2 Jun 2011 05:00:15 +0000 (05:00 +0000)
- For example inc/filter/foo_filter.php holds filter functions for extension
  'foo'

36 files changed:
.gitattributes
inc/extensions-functions.php
inc/extensions/ext-rallye.php
inc/filter-functions.php
inc/filter/.htaccess [new file with mode: 0644]
inc/filter/_filter.php [new file with mode: 0644]
inc/filter/active_filter.php [new file with mode: 0644]
inc/filter/admins_filter.php [new file with mode: 0644]
inc/filter/bonus_filter.php [new file with mode: 0644]
inc/filter/booking_filter.php [new file with mode: 0644]
inc/filter/cache_filter.php [new file with mode: 0644]
inc/filter/mediadata_filter.php [new file with mode: 0644]
inc/filter/online_filter.php [new file with mode: 0644]
inc/filter/other_filter.php [new file with mode: 0644]
inc/filter/politician_stop_filter.php [new file with mode: 0644]
inc/filter/rallye_filter.php [new file with mode: 0644]
inc/filter/register_filter.php [new file with mode: 0644]
inc/filter/removeip_filter.php [new file with mode: 0644]
inc/filter/theme_filter.php [new file with mode: 0644]
inc/filter/timezone_filter.php [new file with mode: 0644]
inc/filter/uberwach_filter.php [new file with mode: 0644]
inc/libs/active_functions.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/booking_functions.php
inc/libs/cache_functions.php
inc/libs/mediadata_functions.php
inc/libs/online_functions.php
inc/libs/other_functions.php
inc/libs/politician_stop_functions.php
inc/libs/rallye_functions.php
inc/libs/register_functions.php
inc/libs/removeip_functions.php
inc/libs/theme_functions.php
inc/libs/timezone_functions.php
inc/libs/uberwach_functions.php

index 6f6db16a902869befe435396dba325f9e9c8a3cc..26353d9e07519d6138f28a25cc22664426d5ed31 100644 (file)
@@ -200,6 +200,23 @@ inc/extensions/ext-wernis.php svneol=native#text/plain
 inc/extensions/ext-yacy.php svneol=native#text/plain
 inc/extensions/ext-yoomedia.php svneol=native#text/plain
 inc/filter-functions.php svneol=native#text/plain
 inc/extensions/ext-yacy.php svneol=native#text/plain
 inc/extensions/ext-yoomedia.php svneol=native#text/plain
 inc/filter-functions.php svneol=native#text/plain
+inc/filter/.htaccess svneol=native#text/plain
+inc/filter/_filter.php svneol=native#text/plain
+inc/filter/active_filter.php svneol=native#text/plain
+inc/filter/admins_filter.php svneol=native#text/plain
+inc/filter/bonus_filter.php svneol=native#text/plain
+inc/filter/booking_filter.php svneol=native#text/plain
+inc/filter/cache_filter.php svneol=native#text/plain
+inc/filter/mediadata_filter.php svneol=native#text/plain
+inc/filter/online_filter.php svneol=native#text/plain
+inc/filter/other_filter.php svneol=native#text/plain
+inc/filter/politician_stop_filter.php svneol=native#text/plain
+inc/filter/rallye_filter.php svneol=native#text/plain
+inc/filter/register_filter.php svneol=native#text/plain
+inc/filter/removeip_filter.php svneol=native#text/plain
+inc/filter/theme_filter.php svneol=native#text/plain
+inc/filter/timezone_filter.php svneol=native#text/plain
+inc/filter/uberwach_filter.php svneol=native#text/plain
 inc/filters.php svneol=native#text/plain
 inc/fix_filters.php svneol=native#text/plain
 inc/fix_menu.php svneol=native#text/plain
 inc/filters.php svneol=native#text/plain
 inc/fix_filters.php svneol=native#text/plain
 inc/fix_menu.php svneol=native#text/plain
index 56f624b44b5f551eb52335629ffcd4bea16c1744..780ee2f8bc5c4130d8a412839da75c86b5c5d0ca 100644 (file)
@@ -142,6 +142,9 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0', $dry_run = false
                ));
        }
 
                ));
        }
 
+       // Load extension's filter library if present
+       loadExtensionFilters($ext_name);
+
        // Extensions are not deprecated by default
        setExtensionDeprecated('N');
 
        // Extensions are not deprecated by default
        setExtensionDeprecated('N');
 
index b594f4e0543462db737bff7155734000602ba46b..90583365c6fefcfe457a0756dcf6e39c28e052f7 100644 (file)
@@ -326,7 +326,7 @@ Zudem sollten Sie mindestens folgende Templates (in <strong>templates/".getLangu
 
        case 'init': // Do stuff when extension is initialized
                // Do stuff only when not in CSS mode
 
        case 'init': // Do stuff when extension is initialized
                // Do stuff only when not in CSS mode
-               // @TODO Move this code into rallye_functions.php
+               // @TODO Move this code into a hook
                if (!isCssOutputMode()) {
                        // Get total member count
                        $total = getTotalConfirmedUser();
                if (!isCssOutputMode()) {
                        // Get total member count
                        $total = getTotalConfirmedUser();
index 613760b858d69661d6eabe8d930d92c6b8de7942..066ca223657ee8ccb5c9d0571ccdbb49e5c8fe6a 100644 (file)
@@ -343,5 +343,30 @@ function prepareFilterArray () {
        $GLOBALS['cache_array']['filter'] = $filterArray;
 }
 
        $GLOBALS['cache_array']['filter'] = $filterArray;
 }
 
+// Loads filter for given extension if present. This function will silently
+// ignore absent filter files.
+function loadExtensionFilters ($ext_name) {
+       // Do we have cache entry?
+       if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
+               // Default is not found
+               $GLOBALS[__FUNCTION__][$ext_name] = false;
+
+               // Construct include file name
+               $incFileName = sprintf("inc/filter/%s_filter.php", $ext_name);
+
+               // Is the include file readable?
+               if (isIncludeReadable($incFileName)) {
+                       // Load the include file
+                       loadIncludeOnce($incFileName);
+
+                       // Mark the file as loaded
+                       $GLOBALS[__FUNCTION__][$ext_name] = true;
+               } elseif (isDebugModeEnabled()) {
+                       // Log missing file
+                       logDebugMessage(__FUNCTION__, __LINE__, 'Include file ' . $incFileName . ' for extension ' . $ext_name . ' is missing.');
+               }
+       } // END - if
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
diff --git a/inc/filter/.htaccess b/inc/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/filter/_filter.php b/inc/filter/_filter.php
new file mode 100644 (file)
index 0000000..ff36984
--- /dev/null
@@ -0,0 +1,44 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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
+
+// [EOF]
+?>
diff --git a/inc/filter/active_filter.php b/inc/filter/active_filter.php
new file mode 100644 (file)
index 0000000..2132e64
--- /dev/null
@@ -0,0 +1,61 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 adding link to "active list"
+function FILTER_ADD_LINK_ACTIVE_LIST () {
+       // Is ext-active/online there?
+       if ((isExtensionActive('active')) && (isExtensionActive('online'))) {
+               // Init fake-content because there is no `what`='active' in database
+               $content = array(
+                       'menu'    => '<a class="menu_blur" href="{%url=modules.php?module=index&amp;what=active%}">{?menu_blur_spacer?}{--GUEST_ACTIVE_LINK--}</a>',
+                       'what'    => 'active',
+                       'visible' => 'Y',
+                       'locked'  => 'N'
+               );
+
+               // Add link to "we were active today" page
+               $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content);
+       } // END - if
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/admins_filter.php b/inc/filter/admins_filter.php
new file mode 100644 (file)
index 0000000..81beec2
--- /dev/null
@@ -0,0 +1,117 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 adding extra data to the query
+function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
+       // Is the admins extension updated? (should be!)
+       if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl';
+       if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`';
+       if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
+       if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`';
+
+       // Return it
+       return $add;
+}
+
+// Reset the login failures
+function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
+       // Store it in session
+       setSession('mailer_admin_failures'    , getAdminLoginFailures($data['id']));
+       setSession('mailer_admin_last_failure', getAdminLastFailure($data['id']));
+
+       // Prepare update data
+       $postData['login'][getCurrentAdminId()]          = $data['login'];
+       $postData['login_failures'][getCurrentAdminId()] = '0';
+       $postData['last_failure'][getCurrentAdminId()]   = null;
+
+       // Change it in the admin
+       adminsChangeAdminAccount($postData);
+
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
+       // Return the data for further processing
+       return $data;
+}
+
+// Count the login failure
+function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
+       // Prepare update data
+       $postData['login'][getCurrentAdminId()]          = $data['login'];
+       $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1';
+       $postData['last_failure'][getCurrentAdminId()]   = 'NOW()';
+
+       // Change it in the admin
+       adminsChangeAdminAccount($postData);
+
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
+       // Return the data for further processing
+       return $data;
+}
+
+// Rehashes the given plain admin password and stores it the database
+function FILTER_REHASH_ADMINS_PASSWORD ($data) {
+       // Generate new hash
+       $newHash = generateHash($data['plain_pass']);
+
+       // Prepare update data
+       $postData['login'][getCurrentAdminId()]    = $data['login'];
+       $postData['password'][getCurrentAdminId()] = $newHash;
+
+       // Change it in the admin
+       adminsChangeAdminAccount($postData);
+
+       // Update cookie/session and data array
+       setAdminMd5(encodeHashForCookie($newHash));
+       $data['pass_hash'] = $newHash;
+
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
+       // Return the data for further processing
+       return $data;
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/bonus_filter.php b/inc/filter/bonus_filter.php
new file mode 100644 (file)
index 0000000..b72d994
--- /dev/null
@@ -0,0 +1,83 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 adding login bonus to the user's account
+function FILTER_ADD_LOGIN_BONUS () {
+       // Is the user data valid?
+       if (!isMember()) {
+               // Do only run for logged in members
+               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
+       } // END - if
+
+       // Bonus is not given by default ;-)
+       $bonus = false;
+       if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('bonus_login_yn') == 'Y')) {
+               // Update last login if far enougth away
+               // @TODO This query isn't right, it will only update if the user was for a longer time away!
+               SQL_QUERY_ESC('UPDATE
+       `{?_MYSQL_PREFIX?}_user_data`
+SET
+       `last_login`=UNIX_TIMESTAMP()
+WHERE
+       `userid`=%s AND
+       `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
+LIMIT 1',
+                       array(
+                               getMemberId()
+                       ), __FUNCTION__, __LINE__
+               );
+
+               // Updated entry?
+               $bonus = (!SQL_HASZEROAFFECTED());
+       } // END - if
+
+       if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
+               // Output message with added points
+               $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
+       } elseif (isExtensionActive('bonus')) {
+               // No login bonus added!
+               $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/booking_filter.php b/inc/filter/booking_filter.php
new file mode 100644 (file)
index 0000000..4fb2b20
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 adding booking record
+function FILTER_ADD_BOOKING_RECORD ($data) {
+       // Add a record
+       addBookingRecord($data['subject'], $data['userid'], $data['points'], $data['mode']);
+
+       // Return data
+       return $data;
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/cache_filter.php b/inc/filter/cache_filter.php
new file mode 100644 (file)
index 0000000..ec708e1
--- /dev/null
@@ -0,0 +1,97 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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
+
+// Destroy the cache on extension changes
+function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
+       // Return the data anyway if there is no cache extension
+       if (!isCacheInstanceValid()) return $data;
+
+       // Remove cache
+       foreach (array('config','extension','filter','modules') as $cache) {
+               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
+       } // END - foreach
+
+       // Return it
+       return $data;
+}
+
+// Destroy the cache on changing admin
+function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) {
+       // Skip this step if the cache instance is not there
+       if (!isCacheInstanceValid()) return false;
+
+       // Remove cache
+       if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
+
+       // Return the data
+       return $data;
+}
+
+// Destroy all cache files
+function FILTER_CACHE_DESTROY_ALL () {
+       // Skip this step if the cache instance is not there
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       if (!isCacheInstanceValid()) return false;
+
+       // Remove cache files
+       foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
+               // Is the cache file readable?
+               // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
+               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
+                       // Remove the cache file
+                       $GLOBALS['cache_instance']->removeCacheFile();
+               } // END - if
+       } // END - foreach
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+}
+
+// Filter for purging 'filter' cache
+function FILTER_CACHE_DESTROY_FILTER () {
+       // Skip this step if the cache instance is not there
+       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
+
+       // Remove cache files
+       if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/mediadata_filter.php b/inc/filter/mediadata_filter.php
new file mode 100644 (file)
index 0000000..102ee3f
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 updating media data
+function FILTER_UPDATE_MEDIADATA_ENTRY ($data) {
+       // Execute the filter function
+       $data['added'] = ($data['added'] && updateMediadataEntry(array('total_points'), $data['mode'], $data['points']));
+
+       // Return data
+       return $data;
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/online_filter.php b/inc/filter/online_filter.php
new file mode 100644 (file)
index 0000000..50fb19a
--- /dev/null
@@ -0,0 +1,132 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 updates/extends on the online list
+function FILTER_UPDATE_ONLINE_LIST () {
+       // Do not update online list when extension is deactivated
+       if (!isExtensionActive('online', true)) {
+               // Extension not active
+               return;
+       } // END - if
+
+       // Empty session?
+       if (session_id() == '') {
+               // This is invalid here!
+               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid session.');
+       } // END - if
+
+       // Initialize variables
+       $userid = '0';
+       $isMember = 'N';
+       $isAdmin = 'N';
+       $action = getActionFromModuleWhat(getModule(), getWhat());
+
+       // Valid userid?
+       if (isMember()) {
+               // Is valid user
+               $userid = getMemberId();
+               $isMember = 'Y';
+       } // END - if
+
+       if (isAdmin()) {
+               // Is administrator
+               $isAdmin = 'Y';
+       } // END - if
+
+       // Now search for the user
+       $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1",
+               array(session_id()), __FUNCTION__, __LINE__);
+
+       // Entry found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Then update it
+               SQL_QUERY_ESC("UPDATE
+       `{?_MYSQL_PREFIX?}_online`
+SET
+       `module`='%s',
+       `action`='%s',
+       `what`='%s',
+       `userid`=%s,
+       `refid`=%s,
+       `is_member`='%s',
+       `is_admin`='%s',
+       `timestamp`=UNIX_TIMESTAMP(),
+       `ip`='%s'
+WHERE 
+       `sid`='%s'
+LIMIT 1",
+               array(
+                       getModule(),
+                       $action,
+                       getWhat(),
+                       makeDatabaseUserId($userid),
+                       makeDatabaseUserId(determineReferalId()),
+                       $isMember,
+                       $isAdmin,
+                       detectRemoteAddr(),
+                       session_id()
+               ), __FUNCTION__, __LINE__);
+       } else {
+               // No entry does exists so we simply add it!
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
+                       array(
+                               getModule(),
+                               $action,
+                               getWhat(),
+                               makeDatabaseUserId($userid),
+                               makeDatabaseUserId(determineReferalId()),
+                               $isMember,
+                               $isAdmin,
+                               session_id(),
+                               detectRemoteAddr()
+                       ), __FUNCTION__, __LINE__);
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Purge old entries
+       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/other_filter.php b/inc/filter/other_filter.php
new file mode 100644 (file)
index 0000000..17fa711
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 debugging SQLs
+function FILTER_DISPLAY_DEBUG_SQL () {
+       // Shall we display SQL queries?
+       if ((isAdmin()) && (isDisplayDebugSqlEnabled()) && (!isGetRequestParameterSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
+               // Then display it here
+               displayDebugSqls();
+       } // END - if
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/politician_stop_filter.php b/inc/filter/politician_stop_filter.php
new file mode 100644 (file)
index 0000000..8a66346
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 displaying politician_stop snippet
+function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET () {
+       // Shall we include the politician_stop snippet?
+       if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('politician_stop')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
+               // Then display it here
+               loadPoliticianStopSnippet();
+       } // END - if
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/rallye_filter.php b/inc/filter/rallye_filter.php
new file mode 100644 (file)
index 0000000..cda5e6b
--- /dev/null
@@ -0,0 +1,50 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 extra-autpurge
+function FILTER_RALLYE_EXTRA_AUTOPURGE () {
+       // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!)
+       purgeExpiredReferalRallyes();
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/register_filter.php b/inc/filter/register_filter.php
new file mode 100644 (file)
index 0000000..e73d8a4
--- /dev/null
@@ -0,0 +1,69 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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
+
+// Run a filter for must-fillout fields
+function FILTER_REGISTER_MUST_FILLOUT ($content) {
+       // Get all fields for output
+       $result = SQL_QUERY('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
+               __FUNCTION__, __LINE__);
+
+       // Walk through all entries
+       while ($row = SQL_FETCHARRAY($result)) {
+               // Must the user fill out this element?
+               $value = '';
+               if ($row['field_required'] == 'Y') {
+                       $value = '<span class="notice">(*)</span>';
+               } // END - if
+
+               // Add it
+               $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Return it
+       return $content;
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/removeip_filter.php b/inc/filter/removeip_filter.php
new file mode 100644 (file)
index 0000000..39afe01
--- /dev/null
@@ -0,0 +1,59 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 adding anonymity notice to the output stream
+function FILTER_ADD_ANONYMITY_NOTICE ($data) {
+       // Init content
+       $content = $data;
+
+       // Extension removeip activated?
+       if ((isExtensionActive('removeip')) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == 'Y')) {
+               // Add anoymity/privacy infos
+               $content['content'] .= addAnonymityLevel() . "<br />\n";
+       } // END - if
+
+       // Return it
+       return $content;
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/theme_filter.php b/inc/filter/theme_filter.php
new file mode 100644 (file)
index 0000000..5cb385c
--- /dev/null
@@ -0,0 +1,77 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 generic handling of theme change
+function FILTER_HANDLE_THEME_CHANGE () {
+       // Check if new theme is selcted
+       if ((isPostRequestParameterSet('new_theme')) && (postRequestParameter('new_theme') != getCurrentTheme())) {
+               // Set new theme for guests
+               $newTheme = postRequestParameter('new_theme');
+
+               // Change to new theme
+               setTheme($newTheme);
+
+               // Remove current from array
+               removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
+
+               // Add new theme
+               addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
+
+               // Redirect to same URL
+               redirectToRequestUri();
+       } // END - if
+}
+
+// Filter for settings theme from user profile, must be executed only if FILTER_FETCH_USER_DATA() ran before
+function FILTER_SET_USERS_THEME () {
+       // Is the user data valid?
+       if (!isMember()) {
+               // Do only run for logged in members
+               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
+       } // END - if
+
+       // Change to new theme
+       setTheme(getUserData('curr_theme'));
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/timezone_filter.php b/inc/filter/timezone_filter.php
new file mode 100644 (file)
index 0000000..7ff31c1
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 setting the timezone
+function FILTER_INIT_TIMEZONE () {
+       // Just set it if the required function is there
+       if (function_exists('date_default_timezone_set')) {
+               // CFG: TIME-ZONE
+               date_default_timezone_set(getConfig('timezone'));
+       } // END - if
+}
+
+// [EOF]
+?>
diff --git a/inc/filter/uberwach_filter.php b/inc/filter/uberwach_filter.php
new file mode 100644 (file)
index 0000000..ec30e1a
--- /dev/null
@@ -0,0 +1,53 @@
+<?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 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 displaying uberwach snippet
+function FILTER_DISPLAY_UBERWACH_SNIPPET () {
+       // Shall we include the uberwach snippet?
+       if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
+               // Then display it here
+               loadUberwachSnippet();
+       } // END - if
+}
+
+// [EOF]
+?>
index 30e4c74da63fe521a69fc60e42a5dc00ed2d1659..a868326a394bd76230eee642792cac66853ee099 100644 (file)
@@ -40,22 +40,5 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
        die();
 } // END - if
 
-// Filter for adding link to "active list"
-function FILTER_ADD_LINK_ACTIVE_LIST () {
-       // Is ext-active/online there?
-       if ((isExtensionActive('active')) && (isExtensionActive('online'))) {
-               // Init fake-content because there is no `what`='active' in database
-               $content = array(
-                       'menu'    => '<a class="menu_blur" href="{%url=modules.php?module=index&amp;what=active%}">{?menu_blur_spacer?}{--GUEST_ACTIVE_LINK--}</a>',
-                       'what'    => 'active',
-                       'visible' => 'Y',
-                       'locked'  => 'N'
-               );
-
-               // Add link to "we were active today" page
-               $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content);
-       } // END - if
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index c46ee546f36e022876e51dac53068b18534f5f9e..18d2d5c7155f108763a66f09376db8ff9426ffc2 100644 (file)
@@ -624,83 +624,6 @@ function getAdminLastFailure ($adminId) {
        return $data['last_failure'];
 }
 
        return $data['last_failure'];
 }
 
-//-----------------------------------------------------------------------------
-//                                Filter Functions
-//-----------------------------------------------------------------------------
-
-// Filter for adding extra data to the query
-function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
-       // Is the admins extension updated? (should be!)
-       if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl';
-       if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`';
-       if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
-       if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`';
-
-       // Return it
-       return $add;
-}
-
-// Reset the login failures
-function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
-       // Store it in session
-       setSession('mailer_admin_failures'    , getAdminLoginFailures($data['id']));
-       setSession('mailer_admin_last_failure', getAdminLastFailure($data['id']));
-
-       // Prepare update data
-       $postData['login'][getCurrentAdminId()]          = $data['login'];
-       $postData['login_failures'][getCurrentAdminId()] = '0';
-       $postData['last_failure'][getCurrentAdminId()]   = null;
-
-       // Change it in the admin
-       adminsChangeAdminAccount($postData);
-
-       // Always make sure the cache is destroyed
-       rebuildCache('admin');
-
-       // Return the data for further processing
-       return $data;
-}
-
-// Count the login failure
-function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
-       // Prepare update data
-       $postData['login'][getCurrentAdminId()]          = $data['login'];
-       $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1';
-       $postData['last_failure'][getCurrentAdminId()]   = 'NOW()';
-
-       // Change it in the admin
-       adminsChangeAdminAccount($postData);
-
-       // Always make sure the cache is destroyed
-       rebuildCache('admin');
-
-       // Return the data for further processing
-       return $data;
-}
-
-// Rehashes the given plain admin password and stores it the database
-function FILTER_REHASH_ADMINS_PASSWORD ($data) {
-       // Generate new hash
-       $newHash = generateHash($data['plain_pass']);
-
-       // Prepare update data
-       $postData['login'][getCurrentAdminId()]    = $data['login'];
-       $postData['password'][getCurrentAdminId()] = $newHash;
-
-       // Change it in the admin
-       adminsChangeAdminAccount($postData);
-
-       // Update cookie/session and data array
-       setAdminMd5(encodeHashForCookie($newHash));
-       $data['pass_hash'] = $newHash;
-
-       // Always make sure the cache is destroyed
-       rebuildCache('admin');
-
-       // Return the data for further processing
-       return $data;
-}
-
 // ---------------------------------------------------------------------------
 //                             Wrapper functions
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //                             Wrapper functions
 // ---------------------------------------------------------------------------
index 68269946d8e2dc80356978972bcddfbae7e07716..0ef95848f653e01244321f0f89915468935ea42a 100644 (file)
@@ -274,49 +274,6 @@ function purgeExpiredTurboBonus() {
        } // END - if
 }
 
        } // END - if
 }
 
-//-----------------------------------------------------------------------------
-//                                Filter Functions
-//-----------------------------------------------------------------------------
-
-// Filter for adding login bonus to the user's account
-function FILTER_ADD_LOGIN_BONUS () {
-       // Is the user data valid?
-       if (!isMember()) {
-               // Do only run for logged in members
-               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
-       } // END - if
-
-       // Bonus is not given by default ;-)
-       $bonus = false;
-       if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('bonus_login_yn') == 'Y')) {
-               // Update last login if far enougth away
-               // @TODO This query isn't right, it will only update if the user was for a longer time away!
-               SQL_QUERY_ESC('UPDATE
-       `{?_MYSQL_PREFIX?}_user_data`
-SET
-       `last_login`=UNIX_TIMESTAMP()
-WHERE
-       `userid`=%s AND
-       `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
-LIMIT 1',
-                       array(
-                               getMemberId()
-                       ), __FUNCTION__, __LINE__
-               );
-
-               // Updated entry?
-               $bonus = (!SQL_HASZEROAFFECTED());
-       } // END - if
-
-       if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
-               // Output message with added points
-               $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
-       } elseif (isExtensionActive('bonus')) {
-               // No login bonus added!
-               $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
-       }
-}
-
 //-----------------------------------------------------------------------------
 //                             Wrapper Functions
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //                             Wrapper Functions
 //-----------------------------------------------------------------------------
index 957c46cf418f6751cc3e0a411771599c28beaeeb..ad4601c0e4ed6d1d0a3d229f4b2f60c79d71ff48 100644 (file)
@@ -53,14 +53,5 @@ function addBookingRecord ($subject, $userid, $points, $mode) {
                array($userid, $subject, $mode, $points), __FUNCTION__, __LINE__);
 }
 
                array($userid, $subject, $mode, $points), __FUNCTION__, __LINE__);
 }
 
-// Filter for adding booking record
-function FILTER_ADD_BOOKING_RECORD ($data) {
-       // Add a record
-       addBookingRecord($data['subject'], $data['userid'], $data['points'], $data['mode']);
-
-       // Return data
-       return $data;
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 40505c6e94399723d0ea51f4a0b3623f0dfcec3f..8896ffdf41a99c08395ae90ee44aca3b40272cdb 100644 (file)
@@ -40,58 +40,5 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
        die();
 } // END - if
 
-// Destroy the cache on extension changes
-function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
-       // Return the data anyway if there is no cache extension
-       if (!isCacheInstanceValid()) return $data;
-
-       // Remove cache
-       foreach (array('config','extension','filter','modules') as $cache) {
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
-       } // END - foreach
-
-       // Return it
-       return $data;
-}
-
-// Destroy the cache on changing admin
-function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) {
-       // Skip this step if the cache instance is not there
-       if (!isCacheInstanceValid()) return false;
-
-       // Remove cache
-       if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
-
-       // Return the data
-       return $data;
-}
-
-// Destroy all cache files
-function FILTER_CACHE_DESTROY_ALL () {
-       // Skip this step if the cache instance is not there
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       if (!isCacheInstanceValid()) return false;
-
-       // Remove cache files
-       foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
-               // Is the cache file readable?
-               // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
-                       // Remove the cache file
-                       $GLOBALS['cache_instance']->removeCacheFile();
-               } // END - if
-       } // END - foreach
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
-}
-
-// Filter for purging 'filter' cache
-function FILTER_CACHE_DESTROY_FILTER () {
-       // Skip this step if the cache instance is not there
-       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
-
-       // Remove cache files
-       if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 03d9d534a539a80af773460eac1c6243bbaea896..151aa2783e31a7002a3dd06f9ac1f5538aa9a78c 100644 (file)
@@ -38,7 +38,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Update an entry
 function updateMediadataEntry ($keys_array, $mode, $value) {
 
 // Update an entry
 function updateMediadataEntry ($keys_array, $mode, $value) {
@@ -108,8 +108,10 @@ function getMediadataEntry ($key) {
        $value = '';
 
        // Check for entry
        $value = '';
 
        // Check for entry
-       $result = SQL_QUERY_ESC("SELECT media_value FROM `{?_MYSQL_PREFIX?}_mediadata` WHERE media_key='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `media_value` FROM `{?_MYSQL_PREFIX?}_mediadata` WHERE `media_key`='%s' LIMIT 1",
                array($key), __FUNCTION__, __LINE__);
                array($key), __FUNCTION__, __LINE__);
+
+       // Do we have one?
        if (SQL_NUMROWS($result) == 1) {
                // Load data
                list($value) = SQL_FETCHROW($result);
        if (SQL_NUMROWS($result) == 1) {
                // Load data
                list($value) = SQL_FETCHROW($result);
@@ -119,14 +121,5 @@ function getMediadataEntry ($key) {
        return $value;
 }
 
        return $value;
 }
 
-// Filter for updating media data
-function FILTER_UPDATE_MEDIADATA_ENTRY ($data) {
-       // Execute the filter function
-       $data['added'] = ($data['added'] && updateMediadataEntry(array('total_points'), $data['mode'], $data['points']));
-
-       // Return data
-       return $data;
-}
-
-//
+// [EOF]
 ?>
 ?>
index 31743dfdd7e06a78fd5d7ca0de26ff0c186808ee..c22a7fa2da6d91b420e871edb8adfc293df9827c 100644 (file)
@@ -40,90 +40,5 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
        die();
 } // END - if
 
-// Filter for updates/extends on the online list
-function FILTER_UPDATE_ONLINE_LIST () {
-       // Do not update online list when extension is deactivated
-       if (!isExtensionActive('online', true)) return;
-
-       // Empty session?
-       if (session_id() == '') {
-               // This is invalid here!
-               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid session.');
-       } // END - if
-
-       // Initialize variables
-       $userid = '0';
-       $isMember = 'N';
-       $isAdmin = 'N';
-       $action = getActionFromModuleWhat(getModule(), getWhat());
-
-       // Valid userid?
-       if (isMember()) {
-               // Is valid user
-               $userid = getMemberId();
-               $isMember = 'Y';
-       } // END - if
-
-       if (isAdmin()) {
-               // Is administrator
-               $isAdmin = 'Y';
-       } // END - if
-
-       // Now search for the user
-       $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1",
-               array(session_id()), __FUNCTION__, __LINE__);
-
-       // Entry found?
-       if (SQL_NUMROWS($result) == 1) {
-               // Then update it
-               SQL_QUERY_ESC("UPDATE
-       `{?_MYSQL_PREFIX?}_online`
-SET
-       `module`='%s',
-       `action`='%s',
-       `what`='%s',
-       `userid`=%s,
-       `refid`=%s,
-       `is_member`='%s',
-       `is_admin`='%s',
-       `timestamp`=UNIX_TIMESTAMP(),
-       `ip`='%s'
-WHERE 
-       `sid`='%s'
-LIMIT 1",
-               array(
-                       getModule(),
-                       $action,
-                       getWhat(),
-                       makeDatabaseUserId($userid),
-                       makeDatabaseUserId(determineReferalId()),
-                       $isMember,
-                       $isAdmin,
-                       detectRemoteAddr(),
-                       session_id()
-               ), __FUNCTION__, __LINE__);
-       } else {
-               // No entry does exists so we simply add it!
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
-                       array(
-                               getModule(),
-                               $action,
-                               getWhat(),
-                               makeDatabaseUserId($userid),
-                               makeDatabaseUserId(determineReferalId()),
-                               $isMember,
-                               $isAdmin,
-                               session_id(),
-                               detectRemoteAddr()
-                       ), __FUNCTION__, __LINE__);
-       }
-
-       // Free result
-       SQL_FREERESULT($result);
-
-       // Purge old entries
-       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 46a5aa6199ff5312f45edfe19ad3a16d5045df15..fa7d3a055841e090d22be2de7bbd0059f7482446 100644 (file)
@@ -60,14 +60,5 @@ function displayDebugSqls () {
        $GLOBALS['page_footer'] .= loadTemplate('admin_other_sqls', true, $OUT);
 }
 
        $GLOBALS['page_footer'] .= loadTemplate('admin_other_sqls', true, $OUT);
 }
 
-// Filter for debugging SQLs
-function FILTER_DISPLAY_DEBUG_SQL () {
-       // Shall we display SQL queries?
-       if ((isAdmin()) && (isDisplayDebugSqlEnabled()) && (!isGetRequestParameterSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
-               // Then display it here
-               displayDebugSqls();
-       } // END - if
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 6d21762f958039924e5b893b459c96e0f176225d..e22fd33f50ead3884700b509208fd48a9720aeac 100644 (file)
@@ -46,14 +46,5 @@ function loadPoliticianStopSnippet () {
        loadTemplate('politician_stop_snippet');
 }
 
        loadTemplate('politician_stop_snippet');
 }
 
-// Filter for displaying politician_stop snippet
-function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET () {
-       // Shall we include the politician_stop snippet?
-       if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('politician_stop')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
-               // Then display it here
-               loadPoliticianStopSnippet();
-       } // END - if
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index e2b69c0b67472fb841f215a594b98c6ba673b368..b2fb6807a3a5abb1683c7fcfed959f5c7de7cf7b 100644 (file)
@@ -462,7 +462,7 @@ function markReferalRallyesAsExpired ($result) {
                // Check status
                //   active = 1: account is still confirmed
                //   active = 0: account is deleted or locked
                // Check status
                //   active = 1: account is still confirmed
                //   active = 0: account is deleted or locked
-               $active = countSumTotalData($DATA['userid'][$idx], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
+               $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
 
                $prices['active'][$key] = $active;
 
 
                $prices['active'][$key] = $active;
 
@@ -952,11 +952,5 @@ function determineReferalRallyeMinimumPrices ($min_prices) {
        return $return;
 }
 
        return $return;
 }
 
-// Filter for extra-autpurge
-function FILTER_RALLYE_EXTRA_AUTOPURGE () {
-       // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!)
-       purgeExpiredReferalRallyes();
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 9153021f77fdfc0b26baf11027d556459c8b1048..85af2723d934b35d61c1673b0d626ba1bbadedaf 100644 (file)
@@ -130,31 +130,6 @@ function registerOutputFailedMessage ($messageId, $extra='') {
        }
 }
 
        }
 }
 
-// Run a filter for must-fillout fields
-function FILTER_REGISTER_MUST_FILLOUT ($content) {
-       // Get all fields for output
-       $result = SQL_QUERY('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
-               __FUNCTION__, __LINE__);
-
-       // Walk through all entries
-       while ($row = SQL_FETCHARRAY($result)) {
-               // Must the user fill out this element?
-               $value = '';
-               if ($row['field_required'] == 'Y') {
-                       $value = '<span class="notice">(*)</span>';
-               } // END - if
-
-               // Add it
-               $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
-       } // END - while
-
-       // Free memory
-       SQL_FREERESULT($result);
-
-       // Return it
-       return $content;
-}
-
 // Checks wether the registration data is complete
 function isRegistrationDataComplete () {
        // Init elements
 // Checks wether the registration data is complete
 function isRegistrationDataComplete () {
        // Init elements
index afb9e0265bef5fad0300f0973e75df1f851e7847..7c9b07accea4376d8c807a7dc87a223c126b8fed 100644 (file)
@@ -141,20 +141,5 @@ function addAnonymityLevel () {
        return loadTemplate('removeip_level', true, $message);
 }
 
        return loadTemplate('removeip_level', true, $message);
 }
 
-// Filter for adding anonymity notice to the output stream
-function FILTER_ADD_ANONYMITY_NOTICE ($data) {
-       // Init content
-       $content = $data;
-
-       // Extension removeip activated?
-       if ((isExtensionActive('removeip')) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == 'Y')) {
-               // Add anoymity/privacy infos
-               $content['content'] .= addAnonymityLevel() . "<br />\n";
-       } // END - if
-
-       // Return it
-       return $content;
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 177ac8f66b764d3ba74e660788f8c0d5e3d59031..6ee3384fd709d32502068dd8e68ad13d65ce48e7 100644 (file)
@@ -303,42 +303,5 @@ function getThemeId ($name) {
        return $id;
 }
 
        return $id;
 }
 
-//-----------------------------------------------------------------------------
-//                              Only filter functions
-//-----------------------------------------------------------------------------
-
-// Filter for generic handling of theme change
-function FILTER_HANDLE_THEME_CHANGE () {
-       // Check if new theme is selcted
-       if ((isPostRequestParameterSet('new_theme')) && (postRequestParameter('new_theme') != getCurrentTheme())) {
-               // Set new theme for guests
-               $newTheme = postRequestParameter('new_theme');
-
-               // Change to new theme
-               setTheme($newTheme);
-
-               // Remove current from array
-               removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
-
-               // Add new theme
-               addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
-
-               // Redirect to same URL
-               redirectToRequestUri();
-       } // END - if
-}
-
-// Filter for settings theme from user profile, must be executed only if FILTER_FETCH_USER_DATA() ran before
-function FILTER_SET_USERS_THEME () {
-       // Is the user data valid?
-       if (!isMember()) {
-               // Do only run for logged in members
-               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
-       } // END - if
-
-       // Change to new theme
-       setTheme(getUserData('curr_theme'));
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index 5250e1a2075f85d2afe3cdc80457e74fec0b3d9b..fa77f98fbe439395bb6de8feb25072b9d298a923 100644 (file)
@@ -40,14 +40,5 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
        die();
 } // END - if
 
-// Filter for setting the timezone
-function FILTER_INIT_TIMEZONE () {
-       // Just set it if the required function is there
-       if (function_exists('date_default_timezone_set')) {
-               // CFG: TIME-ZONE
-               date_default_timezone_set(getConfig('timezone'));
-       } // END - if
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>
index b7d19a289f0b0fb8115f87846ee0bdd3453fb9e2..4b35731c9098b906895eddd0968cda2df3b9c1c7 100644 (file)
@@ -46,14 +46,5 @@ function loadUberwachSnippet () {
        $GLOBALS['page_footer'] .= loadTemplate('uberwach_snippet', true);
 }
 
        $GLOBALS['page_footer'] .= loadTemplate('uberwach_snippet', true);
 }
 
-// Filter for displaying uberwach snippet
-function FILTER_DISPLAY_UBERWACH_SNIPPET () {
-       // Shall we include the uberwach snippet?
-       if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
-               // Then display it here
-               loadUberwachSnippet();
-       } // END - if
-}
-
 // [EOF]
 ?>
 // [EOF]
 ?>