if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
// Load email data
- $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `cat_id`, `payment_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ // @TODO Unused: cat_id
+ $content getPoolDataFromId(getRequestElement('id'));
// Delete mail only once
- if (SQL_NUMROWS($result) == 1) {
- // Load data
- // @TODO Unused: cat_id
- $content = SQL_FETCHARRAY($result);
-
+ if (count($content) > 0) {
// Prepare data for the template
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Mail already deleted!
displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
}
-
- // Free result
- SQL_FREERESULT($result);
} elseif ((isGetRequestElementSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
// Load data from bonus mail
$result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",