// Do we have an entry?
if (SQL_NUMROWS($result_master) == 1) {
- // Mail order / bonus mail found!
+ // Mail order / bonus mail found
$poolData = SQL_FETCHARRAY($result_master);
- // Transfer data to constants for the template
- if (($poolData['id'] > 0) && ($ID == '-1')) $ID = $poolData['id'];
- if ($col == 'bonus_id') $poolData['sender'] = '0';
+ // 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
+
+ // Bonus mails do always have a sender 'NULL'
+ if ($col == 'bonus_id') {
+ $poolData['sender'] = null;
+ } // END - if
// Load unconfirmed mail links. Hmmm, this select query is pretty cool
// but it does only show unconfirmed mail links from existing user