]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Renamed function, used more "pool functions":
[mailer.git] / inc / mysql-manager.php
index 6824a16c43adc7cafcee3417b50850f3c85e9ac0..28ba603cfe196063e7e2302e87b53ce23212ba87 100644 (file)
@@ -901,8 +901,26 @@ function getPaymentTitlePrice ($paymentsId, $full = FALSE) {
        return $ret;
 }
 
+// Get payment price
+function getPaymentPrice ($paymentsId) {
+       // Return result
+       return getPaymentData($paymentsId, 'price');
+}
+
+// Get payment time
+function getPaymentTime ($paymentsId) {
+       // Return result
+       return getPaymentData($paymentsId, 'time');
+}
+
+// Get payment 'payment'
+function getPaymentPayment ($paymentsId) {
+       // Return result
+       return getPaymentData($paymentsId, 'payment');
+}
+
 // "Getter" for payment data (cached)
-function getPaymentData ($paymentsId, $lookFor = 'price') {
+function getPaymentData ($paymentsId, $lookFor) {
        // Default value...
        $data[$lookFor] = NULL;
 
@@ -980,8 +998,7 @@ function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isB
                                // Update 'mails_sent' if ext-sql_patches is updated
                                if (isExtensionInstalledAndNewer('sql_patches', '0.7.4')) {
                                        // Update the pool
-                                       SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `mails_sent`=`mails_sent`+1 WHERE `id`=%s LIMIT 1',
-                                               array(bigintval($poolId)), __FUNCTION__, __LINE__);
+                                       updatePoolDataById($poolId, 'mails_sent', 1, '+');
                                } // END - if
                                $ret = 'done';
                        } else {
@@ -1874,7 +1891,7 @@ function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId =
                ), __FUNCTION__, __LINE__, TRUE, $strip);
 
        // Return insert id which is the task id
-       return SQL_INSERTID();
+       return SQL_INSERT_ID();
 }
 
 // Updates last module / online time
@@ -2111,14 +2128,14 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions =
                SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                // Add id number
-               setPostRequestElement('id', SQL_INSERTID());
+               setPostRequestElement('id', SQL_INSERT_ID());
 
                // Prepare filter data array
                $filterData = array(
                        'mode'          => 'add',
                        'table_name'    => $tableName,
                        'content'       => postRequestArray(),
-                       'id'            => SQL_INSERTID(),
+                       'id'            => SQL_INSERT_ID(),
                        'subject'       => '',
                        // @TODO Used generic 'userid' here
                        'userid_column' => array('userid'),
@@ -2451,40 +2468,6 @@ function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filter
        );
 }
 
-// Checks whether given URL is blacklisted
-function isUrlBlacklisted ($url) {
-       // Mark it as not listed by default
-       $listed = FALSE;
-
-       // Is black-listing enbaled?
-       if (!isUrlBlacklistEnabled()) {
-               // No, then all URLs are not in this list
-               return FALSE;
-       } elseif (!isset($GLOBALS['blacklist_data'][$url])) {
-               // Check black-list for given URL
-               $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS `blist_timestamp` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
-                       array($url), __FILE__, __LINE__);
-
-               // Is there an entry?
-               if (SQL_NUMROWS($result) == 1) {
-                       // Jupp, we got one listed
-                       $GLOBALS['blacklist_data'][$url] = SQL_FETCHARRAY($result);
-
-                       // Mark it as listed
-                       $listed = TRUE;
-               } // END - if
-
-               // Free result
-               SQL_FREERESULT($result);
-       } else {
-               // Is found in cache -> black-listed
-               $listed = TRUE;
-       }
-
-       // Return result
-       return $listed;
-}
-
 // Adds key/value pair to a working SQL string together
 function addKeyValueSql ($key, $value) {
        // Init SQL