X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mailid.php;h=21cbc8922d77b75c48d4cf9d90225aadb0379056;hb=f2b603aed42bfdf7a94611d7bae71fe3a1048890;hp=2e19762f53d35be5d43fe1431efffd574047bb92;hpb=c0c6d5d58bdecd22bdcf7dfe5b24bec69e1810c7;p=mailer.git diff --git a/mailid.php b/mailid.php index 2e19762f53..21cbc8922d 100644 --- a/mailid.php +++ b/mailid.php @@ -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 * @@ -92,18 +92,18 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t $GLOBALS['frameset_mode'] = TRUE; } // END - if - // Init result for below SQL_NUMROWS() function + // Init result for below sqlNumRows() function $result_main = FALSE; // Maybe he wants to confirm an email? switch ($data['type']) { case 'normal': - $result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1", + $result_main = sqlQueryEscaped("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1", array($data['id'], $data['userid']), __FILE__, __LINE__); break; case 'bonus': - $result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1", + $result_main = sqlQueryEscaped("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1", array($data['id'], $data['userid']), __FILE__, __LINE__); break; @@ -113,9 +113,9 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // END - switch // Is an entry found? - if (SQL_NUMROWS($result_main) == 1) { + if (sqlNumRows($result_main) == 1) { // Is the stats id valid? - $data = merge_array($data, SQL_FETCHARRAY($result_main)); + $data = merge_array($data, sqlFetchArray($result_main)); // Init result here with invalid to avoid possible missing variable $result_mailid = FALSE; @@ -123,12 +123,12 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t // @TODO Rewrite this to a filter/function switch ($data['link_type']) { case 'NORMAL': - $result_mailid = SQL_QUERY_ESC("SELECT `pool_id`, `userid` AS `sender` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1", + $result_mailid = sqlQueryEscaped("SELECT `pool_id`, `userid` AS `sender` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1", array($data['id']), __FILE__, __LINE__); break; case 'BONUS': - $result_mailid = SQL_QUERY_ESC("SELECT `id` AS `pool_id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", + $result_mailid = sqlQueryEscaped("SELECT `id` AS `pool_id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", array($data['id']), __FILE__, __LINE__); break; @@ -138,9 +138,9 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // END - switch // Entry found? - if (SQL_NUMROWS($result_mailid) == 1) { + if (sqlNumRows($result_mailid) == 1) { // Load data - $data = merge_array($data, SQL_FETCHARRAY($result_mailid)); + $data = merge_array($data, sqlFetchArray($result_mailid)); // Correct notification switch in non-bonus mails if ((!isset($data['is_notify'])) || (!in_array($data['is_notify'], array('Y', 'N')))) { @@ -160,33 +160,33 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t // @TODO Rewrite this to a filter switch ($data['link_type']) { case 'NORMAL': - $result = SQL_QUERY_ESC("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($data['pool_id'])), __FILE__, __LINE__); // Entry found? - if (SQL_NUMROWS($result) == 1) { - $data = merge_array($data, SQL_FETCHARRAY($result)); + if (sqlNumRows($result) == 1) { + $data = merge_array($data, sqlFetchArray($result)); $data['time'] = getPaymentTime($data['payment_id']); $data['payment'] = getPaymentPayment($data['payment_id']); $isValid = TRUE; } // END - if // Free memory... - SQL_FREERESULT($result); + sqlFreeResult($result); break; case 'BONUS': - $result = SQL_QUERY_ESC("SELECT `time`, `points` AS `payment` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `time`, `points` AS `payment` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", array(bigintval($data['pool_id'])), __FILE__, __LINE__); // Entry found? - if (SQL_NUMROWS($result) == 1) { - $data = merge_array($data, SQL_FETCHARRAY($result)); + if (sqlNumRows($result) == 1) { + $data = merge_array($data, sqlFetchArray($result)); $isValid = TRUE; } // END - if // Free memory... - SQL_FREERESULT($result); + sqlFreeResult($result); break; default: // Unknown type @@ -234,28 +234,29 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // Free result - SQL_FREERESULT($result_mailid); + sqlFreeResult($result_mailid); } else { $data['error_code'] = getCode('ALREADY_CONFIRMED'); $data['do'] = 'failed'; } // Free result - SQL_FREERESULT($result_main); - - // Insert footer if no image - if ($data['do'] != 'img') { - // Write footer - loadIncludeOnce('inc/footer.php'); - } // END - if + sqlFreeResult($result_main); } else { // Not all variables are set $data['error_code'] = getCode('ERROR_MAILID'); + $data['do'] = 'failed'; } // Error code is set? handleMailIdErrorCode($data['error_code']); +// Insert footer if no image +if ($data['do'] != 'img') { + // Write footer + loadIncludeOnce('inc/footer.php'); +} // END - if + // Really all done here... ;-) doShutdown();