- $content = SQL_FETCHARRAY($result_data);
-
- // "Translate some data
- $content['subject'] = COMPILE_CODE($content['subject']);
- $content['text'] = COMPILE_CODE($content['text']);
- $content['timestamp'] = MAKE_DATETIME($content['timestamp'], "2");
- $content['category'] = GET_CATEGORY($content['cat_id']);
- $content['points'] = TRANSLATE_COMMA($content['points']);
- $content['time'] = CREATE_FANCY_TIME($content['time']);
- $content['uid'] = $GLOBALS['userid'];
-
- // Get timestamp from insert
- $content['user_status'] = sprintf(MEMBER_MAIL_NORMAL_CONFIRMED_ON,
- MAKE_DATETIME(USER_STATS_GET_TIMESTAMP("mailid", $content['id']), "2")
- );
+ $content = sqlFetchArray($result_data);
+ $content = merge_array($content, getPoolDataFromId($content['pool_id']));
+
+ // Translate some data
+ $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], '2');
+ // @TODO This call cannot be saved as EL code cannot be "framed" in other EL code
+ $content['userid'] = getMemberId();
+ $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN=' . $content['id'] . '%}';
+
+ // Is ext-user active?
+ if (isExtensionActive('user')) {
+ // Default is never confirmed
+ $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_NEVER_CONFIRMED=' . $content['id'] . '%}';
+
+ // Get the timestamp from the mail
+ $confirmedStamp = getEpocheTimeFromUserStats('mailid', $content['id']);
+
+ // Have confirmed it?
+ if ($confirmedStamp > 0) {
+ // Get timestamp from insert
+ $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_ON=' . generateDateTime($confirmedStamp, '2') . '%}';
+ } // END - if
+ } // END - if