]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/rallye_filter.php
First batch of removal of the headers needed for revision-functions.php
[mailer.git] / inc / filter / rallye_filter.php
index 939e0e00a689c4c8e45c8de6a3f4620b8153a484..507a35e8356a22277d82704738202799ca4c3fad 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 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -52,13 +52,10 @@ function FILTER_RALLYE_EXTRA_AUTOPURGE ($filterData) {
 }
 
 // Run filter for notifying users about rallyes
-function FILTER_RALLYE_NOTIFY_USERS ($filerData) {
+function FILTER_RALLYE_NOTIFY_USERS ($filterData) {
        // Do stuff only when not in CSS mode
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        if (!isCssOutputMode()) {
-               // Get total member count
-               $total = getTotalConfirmedUser();
-
                // Run filter to get SQL "addons"
                $sqlAddons = runFilterChain('add_rallye_notify_sqls', array(
                        'add' => '',
@@ -66,53 +63,53 @@ function FILTER_RALLYE_NOTIFY_USERS ($filerData) {
                ));
 
                // Check for new started but not notified rallyes
-               $result = SQL_QUERY("SELECT SQL_SMALL_RESULT
-       d.`id`,
-       d.`title`,
-       d.`start_time`,
-       d.`end_time`,
-       d.`send_notify`
+               $result = sqlQuery("SELECT SQL_SMALL_RESULT
+       `d`.`id`,
+       `d`.`title`,
+       `d`.`start_time`,
+       `d`.`end_time`,
+       `d`.`send_notify`
        " . $sqlAddons['add'] . "
 FROM
-       `{?_MYSQL_PREFIX?}_rallye_data` AS d
+       `{?_MYSQL_PREFIX?}_rallye_data` AS `d`
 WHERE
-       d.`is_active`='Y' AND
-       d.`notified`='N' AND
-       d.`expired`='N' AND
-       d.`start_time` <= UNIX_TIMESTAMP() AND
-       d.`end_time` > UNIX_TIMESTAMP()
+       `d`.`is_active`='Y' AND
+       `d`.`notified`='N' AND
+       `d`.`expired`='N' AND
+       `d`.`start_time` <= UNIX_TIMESTAMP() AND
+       `d`.`end_time` > UNIX_TIMESTAMP()
 LIMIT 1", __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) == 1) {
+               if (sqlNumRows($result) == 1) {
                        // Start rallye
                        autostartReferralRallyes($result);
                } // END - if
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Check for expired rallyes
-               $result = SQL_QUERY("SELECT SQL_SMALL_RESULT
-       d.`id`,
-       d.`title`,
-       d.`start_time`,
-       d.`end_time`,
-       d.`send_notify`
+               $result = sqlQuery("SELECT SQL_SMALL_RESULT
+       `d`.`id`,
+       `d`.`title`,
+       `d`.`start_time`,
+       `d`.`end_time`,
+       `d`.`send_notify`
        " . $sqlAddons['add'] . "
 FROM
-       `{?_MYSQL_PREFIX?}_rallye_data` AS d
+       `{?_MYSQL_PREFIX?}_rallye_data` AS `d`
 WHERE
-       d.`is_active`='Y' AND
-       d.`notified`='Y' AND
-       d.`expired`='N' AND
-       (d.`end_time` <= UNIX_TIMESTAMP()" . $sqlAddons['or'] . ")
+       `d`.`is_active`='Y' AND
+       `d`.`notified`='Y' AND
+       `d`.`expired`='N' AND
+       (`d`.`end_time` <= UNIX_TIMESTAMP()" . $sqlAddons['or'] . ")
 LIMIT 1", __FILE__, __LINE__);
-               if ((SQL_NUMROWS($result) == 1) && (isExtensionActive('autopurge'))) {
+               if ((sqlNumRows($result) == 1) && (isExtensionActive('autopurge'))) {
                        // End rallye here...
                        stopRallyeByResult($result);
                } // END - if
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
        } // END - if
 
        // Return data
@@ -126,8 +123,8 @@ function FILTER_ADD_RALLYE_SQL_COLUMNS ($filterData) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        if (isExtensionInstalledAndNewer('rallye', '0.2.0')) {
                // Add more data on higher versions
-               $filterData['add'] .= ',`min_users`,`min_prices`';
-               $filterData['or']  .= ' OR (d.`min_users` <= ' . $total . ' AND d.`min_users` > 0)';
+               $filterData['add'] .= ',`min_users`, `min_prices`';
+               $filterData['or']  .= ' OR (`d`.`min_users` <= ' . getTotalConfirmedUser() . ' AND `d`.`min_users` > 0)';
        } // END  - if
 
        // Return data