// Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
$result = SQL_QUERY('SELECT
- `s`.`id`,
- `s`.`userid`,
- `s`.`pool_id`,
- `t`.`price`
+ `id`,
+ `userid`,
+ `pool_id`,
+ `payment_id`
FROM
- `{?_MYSQL_PREFIX?}_user_stats` AS `s`
-LEFT JOIN
- `{?_MYSQL_PREFIX?}_payments` AS `t`
-ON
- `s`.`payment_id`=`t`.`id`
+ `{?_MYSQL_PREFIX?}_user_stats`
WHERE
- (UNIX_TIMESTAMP() - `s`.`timestamp_ordered`) >= {?auto_purge?}
+ (UNIX_TIMESTAMP() - `timestamp_ordered`) >= {?auto_purge?}
ORDER BY
- `s`.`userid` ASC', __FILE__, __LINE__);
+ `userid` ASC', __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Start deleting procedure
$userid = NULL;
// Add points
$userid = $content['userid'];
- $points += $content['price'];
+ $points += getPaymentPrice($content['payment_id']);
$admin_points += $content['price'];
// Remove confirmation links from queue