]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/bonus_filter.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / filter / bonus_filter.php
index c86dda30de64700144acc4e3f035fe8b98a89f8e..65160b756feb484a197a75fbde067fa5ad8dbc89 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -54,7 +54,7 @@ function FILTER_ADD_LOGIN_BONUS ($filterData) {
        if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (isIncludeBonusLoginEnabled())) {
                // 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
+               sqlQueryEscaped('UPDATE
        `{?_MYSQL_PREFIX?}_user_data`
 SET
        `last_login`=UNIX_TIMESTAMP()
@@ -68,7 +68,7 @@ LIMIT 1',
                );
 
                // Updated entry?
-               $bonus = (!SQL_HASZEROAFFECTED());
+               $bonus = (!ifSqlHasZeroAffectedRows());
        } // END - if
 
        if (($bonus === TRUE) && (getRequestElement('do') == 'bonus')) {
@@ -88,8 +88,8 @@ LIMIT 1',
 function FILTER_GENERATE_BONUS_MAIL_LINKS ($filterData) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
 
-       // Is the type 'bid'?
-       if ($filterData['type'] == 'bid') {
+       // Is the type 'bonus'?
+       if ($filterData['type'] == 'bonus') {
                // Load template
                $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', TRUE, $filterData);
        } // END - if
@@ -152,5 +152,17 @@ function FILTER_SEND_BONUS_NOTIFICATIONS ($filterData) {
        return $filterData;
 }
 
+// Filter to add exclusion SQL for configured userid
+function FILTER_EXLCUDE_BONUS_USERID ($filterData = array()) {
+       // Is it valid?
+       if (isValidId(getBonusUserid())) {
+               // Exclude it
+               array_push($filterData, '{?bonus_userid?}');
+       } // END - if
+
+       // Return it
+       return $filterData;
+}
+
 // [EOF]
 ?>