- // Mail order / bonus mail found!
- // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
- list($stats_id, $sender, $subject, $text, $url, $stamp, $max) = SQL_FETCHROW($result_master);
+ // Mail order / bonus mail found
+ $poolData = SQL_FETCHARRAY($result_master);
+
+ // If there is a pool id and $ID is not set, we take it
+ if (($poolData['id'] > 0) && ($ID == '-1')) {
+ $ID = $poolData['id'];
+ } // END - if