- // Add header
- require_once(PATH."inc/header.php");
-
- // Init
- $url_uid = 0; $url_bid = 0; $url_mid = 0;
-
- // Secure all data
- if (!empty($_GET['uid'])) $url_uid = bigintval($_GET['uid']);
- if (!empty($_GET['mailid'])) $url_mid = bigintval($_GET['mailid']);
- if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']);
-
- //* DEBUG: */ die("*".$url_uid."/".$url_bid."/".$url_mid."*<pre>".print_r($FATAL, true)."</pre>");
-
- // 01 1 12 3 32 21 1 2 2 10
- if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (count($FATAL) == 0))
- {
- // Maybe he wants to confirm an email?
- if ($url_mid > 0)
- {
- // Normal-Mails
- $result = SQL_QUERY_ESC("SELECT link_type FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d AND userid=%d LIMIT 1",
- array($url_mid, $url_uid), __FILE__, __LINE__);
- $TYPE = "mailid"; $DATA = $url_mid;
- }
- elseif ($url_bid > 0)
- {
- // Bonus-Mail
- $result = SQL_QUERY_ESC("SELECT link_type FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%d AND userid=%d LIMIT 1",
- array($url_bid, $url_uid), __FILE__, __LINE__);
- $TYPE = "bonusid"; $DATA = $url_bid;
- }
- else
- {
- // Problem: No ID entered
- LOAD_URL("index.php");
- }
- if (SQL_NUMROWS($result) == 1)
- {
- list($ltype) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- switch ($ltype)
- {
- case "NORMAL":
- // Is the stats ID valid?
- $result = SQL_QUERY_ESC("SELECT pool_id, url FROM "._MYSQL_PREFIX."_user_stats WHERE id=%d LIMIT 1",
- array($url_mid), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result_link) == 1) {
+ // Load the entry
+ list($ltype) = SQL_FETCHROW($result_link);
+
+ // @TODO Rewrite this to a filter
+ switch ($ltype) {
+ case 'NORMAL':
+ // Is the stats id valid?
+ $result = SQL_QUERY_ESC("SELECT `pool_id`, `url`, `subject` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
+ array($mailId), __FILE__, __LINE__);