- switch ($type)
- {
- case "NORMAL":
- $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- $type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
- $LINK = "<a href=\"{!URL!}/mailid.php?uid=".REQUEST_GET('uid')."&mailid=".$id."\" target=\"_blank\">".$id."</a>";
- break;
-
- case "BONUS":
- $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
- array(bigintval($id2)), __FILE__, __LINE__);
- $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
- $LINK = "<a href=\"{!URL!}/mailid.php?uid=".REQUEST_GET('uid')."&bonusid=".$id2."\" target=\"_blank\">".$id2."</a>";
- break;
-
- default: // Problem in application detected!
- // Log the error
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $type));
- break;
- }
-
+ // @TODO Rewrite this to includes/filter
+ switch ($type) {
+ case 'NORMAL':
+ $result_data = SQL_QUERY_ESC("SELECT `subject`,`timestamp_ordered` AS `timestamp`,`cat_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $type = 'mailid'; $mailId = $id; $problemMessage = '{--NORMAL_MAIL_PROBLEM--}';
+ $LINK = '<a href="{%url=mailid.php?userid=' . getRequestParameter('userid') . '&mailid=' . $id . '%}" target="_blank">' . $id . '</a>';
+ break;
+
+ case 'BONUS':
+ $result_data = SQL_QUERY_ESC("SELECT `subject`,`timestamp`,`cat_id` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id2)), __FILE__, __LINE__);
+ $type = 'bonusid'; $mailId = $id2; $problemMessage = '{--BONUS_MAIL_PROBLEM--}';
+ $LINK = '<a href="{%url=mailid.php?userid=' . getRequestParameter('userid') . '&bonusid=' . $id2 . '%}" target="_blank">' . $id2 . '</a>';
+ break;
+
+ default: // Problem in application detected!
+ // Log the error
+ logDebugMessage(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $type));
+ break;
+ } // END - switch
+
+ // Do we have an entry?