]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/yoomedia_functions.php
Typo fixed
[mailer.git] / inc / libs / yoomedia_functions.php
index 10132b66d122fa3cd74dd9e33897e6736d54f0cc..2f9f64a2375d4fd31403c258a7d4979b0380f517 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Test if the extension settings did work
-function YOOMEDIDA_TEST_CONFIG ($data) {
+function YOOMEDIA_TEST_CONFIG ($data) {
        global $_CONFIG;
 
        // Is this admin?
@@ -48,7 +48,7 @@ function YOOMEDIDA_TEST_CONFIG ($data) {
        } // END - if
 
        // Transfer config data
-       $_CONFIG = array_merge($_CONFIG, $data);
+       $_CONFIG = merge_array($_CONFIG, $data);
 
        // Temporary allow maximum
        $_CONFIG['yoomedia_tm_max_reload']    = 1000;
@@ -64,10 +64,10 @@ function YOOMEDIDA_TEST_CONFIG ($data) {
        // Log the response if failed
        if (count($response) == 0) {
                // Queries depleted (as we count here!)
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): Requested depleted. Maxmimum was: ".$_CONFIG['yoomedia_requests_total']);
+               DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".getConfig('yoomedia_requests_total'));
        } elseif (count($response) <= 10) {
                // Log serialized raw response
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): Raw response=".base64_encode(serialize($response)));
+               DEBUG_LOG(__FUNCTION__, __LINE__, " Raw response=".base64_encode(serialize($response)));
        } // END - if
 
        // Do we have some data there?
@@ -76,24 +76,22 @@ function YOOMEDIDA_TEST_CONFIG ($data) {
 
 // Queries the given Yoo!Media API 2.0 script
 function YOOMEDIA_QUERY_API ($script, $countQuery = true) {
-       global $_CONFIG;
-
        // Init response array
        $response = array();
 
        // Enougth queries left?
-       if (($_CONFIG['yoomedia_requests_remain'] > 0) || (!$countQuery)) {
+       if ((getConfig('yoomedia_requests_remain') > 0) || (!$countQuery)) {
                // Prepare the low-level request
                $requestString = sprintf("http://www.yoomedia.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s",
                        $script,
-                       bigintval($_CONFIG['yoomedia_id']),
-                       bigintval($_CONFIG['yoomedia_sid']),
-                       $_CONFIG['yoomedia_passwd'],
-                       bigintval($_CONFIG['yoomedia_tm_max_reload']),
-                       bigintval($_CONFIG['yoomedia_tm_min_wait']),
-                       bigintval($_CONFIG['yoomedia_tm_clicks_remain']),
-                       bigintval($_CONFIG['yoomedia_tm_min_pay']),
-                       bigintval($_CONFIG['yoomedia_erotic_allowed'])
+                       bigintval(getConfig('yoomedia_id')),
+                       bigintval(getConfig('yoomedia_sid')),
+                       getConfig('yoomedia_passwd'),
+                       bigintval(getConfig('yoomedia_tm_max_reload')),
+                       bigintval(getConfig('yoomedia_tm_min_wait')),
+                       bigintval(getConfig('yoomedia_tm_clicks_remain')),
+                       bigintval(getConfig('yoomedia_tm_min_pay')),
+                       bigintval(getConfig('yoomedia_erotic_allowed'))
                );
 
                // Run the query
@@ -173,8 +171,6 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) {
 
 // Prepares a bonus mail for delivery. Works only if extension "bonus" is active
 function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) {
-       global $_CONFIG;
-
        // Is this an admin?
        if (!IS_ADMIN()) {
                // Abort here
@@ -194,7 +190,7 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) {
        if ($data['reward'] < 1) $data['reward'] = 1;
 
        // Add website id
-       $data['sid'] = $_CONFIG['yoomedia_sid'];
+       $data['sid'] = getConfig('yoomedia_sid');
 
        // Add total receivers
        $data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS());
@@ -208,8 +204,6 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) {
 
 // Adds the mail to the bonus mail pool
 function YOOMEDIA_SEND_BONUS_MAIL ($data, $mode) {
-       global $_CONFIG;
-
        // Is this an admin?
        if (!IS_ADMIN()) {
                // Abort here
@@ -248,7 +242,7 @@ function YOOMEDIA_EXCLUDE_MAIL ($data, $mode) {
                $mode = YOOMEDIA_CONVERT_MODE($mode);
 
                // Add the entry
-               $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_yoomedia_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')",
+               SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_yoomedia_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')",
                        array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__);
        } // END - if
 }
@@ -259,7 +253,7 @@ function YOOMEDIA_UNLIST_MAIL ($data, $mode) {
        $mode = YOOMEDIA_CONVERT_MODE($mode);
 
        // Add the entry
-       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1",
+       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1",
                array($mode, bigintval($data['id'])), __FILE__, __LINE__);
 }
 
@@ -276,7 +270,7 @@ function YOOMEDIA_TRANSLATE_INDEX ($type, $index) {
                $return = $yoomediaTranslationTable[$type][$index];
        } else {
                // Not found!
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): type={$type},index={$index} not found.");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " type={$type},index={$index} not found.");
        }
 
        // Return value
@@ -296,7 +290,7 @@ function YOOMEDIA_TRANSLATE_ERROR ($errorCode) {
                $return = $yoomediaTranslationTable['error_codes'][$errorCode];
        } else {
                // Log missing entries
-               DEBUG_LOG(__FUNCTION__."(".__LINE__."): errorCode={$errorCode}");
+               DEBUG_LOG(__FUNCTION__, __LINE__, " errorCode={$errorCode}");
        }
 
        // Return value
@@ -320,7 +314,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) {
                // Are we ready to sent again?
                if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) {
                        // Remove entry
-                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_yoomedia_reload WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_yoomedia_reload WHERE id=%s LIMIT 1",
                                array($id), __FILE__, __LINE__);
                } else {
                        // Dont' sent again this mail
@@ -343,7 +337,7 @@ function YOOMEDIA_RELOAD_LOCK ($data, $mode) {
                $mode = YOOMEDIA_CONVERT_MODE($mode);
 
                // Add the entry
-               $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_yoomedia_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)",
+               SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_yoomedia_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)",
                        array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__);
        } // END - if
 }