From: quix0r Date: Sun, 30 Sep 2012 20:11:03 +0000 (+0000) Subject: Fixes for cache getPaymentsData(), renamed variable 'pid' to 'paymentsId' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28658e8d3c79f95ba557720198cf6440e7a555cb;p=mailer.git Fixes for cache getPaymentsData(), renamed variable 'pid' to 'paymentsId' --- diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 625598d66e..c6924af057 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -870,12 +870,12 @@ function getCategory ($cid) { } // Get a string of "mail title" and price back -function getPaymentTitlePrice ($pid, $full = false) { +function getPaymentTitlePrice ($paymentsId, $full = false) { // Only title or also including price? if ($full === false) { - $ret = getPaymentData($pid, 'main_title'); + $ret = getPaymentData($paymentsId, 'main_title'); } else { - $ret = getPaymentData($pid, 'main_title') . ' / {%pipe,getPaymentData,translateComma=' . $pid . '%} {?POINTS?}'; + $ret = getPaymentData($paymentsId, 'main_title') . ' / {%pipe,getPaymentData,translateComma=' . $paymentsId . '%} {?POINTS?}'; } // Return result @@ -883,15 +883,14 @@ function getPaymentTitlePrice ($pid, $full = false) { } // "Getter" for payment data (cached) -function getPaymentData ($pid, $lookFor = 'price') { +function getPaymentData ($paymentsId, $lookFor = 'price') { // Default value... $data[$lookFor] = NULL; // Do we have cache? - if (isset($GLOBALS['cache_array']['payments']['id'][$pid])) { + if (isset($GLOBALS['cache_array']['payments'][$paymentsId]['id'])) { // Use it if found to save SQL queries - die('
'.print_r($GLOBALS['cache_array']['payments'],true).'
'); - $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$pid]; + $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$paymentsId]; // Update cache hits incrementStatsEntry('cache_hits'); @@ -900,7 +899,7 @@ function getPaymentData ($pid, $lookFor = 'price') { $result = SQL_QUERY_ESC('SELECT `%s` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1', array( $lookFor, - bigintval($pid) + bigintval($paymentsId) ), __FUNCTION__, __LINE__); // Is the entry there?