}
// 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
}
// "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('<pre>'.print_r($GLOBALS['cache_array']['payments'],true).'</pre>');
- $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$pid];
+ $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$paymentsId];
// Update cache hits
incrementStatsEntry('cache_hits');
$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?