]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/autopurge_functions.php
Naming convention applied, ext-network menu resorted:
[mailer.git] / inc / libs / autopurge_functions.php
index 8d7ace168ddca39794a3d5663facafa9c4b9ea18..3d90fba9279d398cd68e0d20a5bf86c2163afc3f 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -39,7 +40,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Add points in autopurge-mode
 function addPointsAutoPurge ($userid, $points) {
@@ -47,8 +48,20 @@ function addPointsAutoPurge ($userid, $points) {
        addPointsDirectly('autopurge_add', $userid, $points);
 
        // Send out mail to user
-       $message = loadEmailTemplate('member_autopurge_points', translateComma($points), $userid);
-       sendEmail($userid, getMessage('AUTOPURGE_MEMBER_SUBJECT'), $message);
+       $message = loadEmailTemplate('member_autopurge_points', array('points' => $points), $userid);
+       sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
+}
+
+// Checks wether auto-purging is active
+function isAutoPurgingActive () {
+       // Do we have cache?
+       if (!isset($GLOBALS['auto_purging_active'])) {
+               // Determine it
+               $GLOBALS['auto_purging_active'] = (getConfig('auto_purge_active') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['auto_purging_active'];
 }
 
 // [EOF]