-if (isInstalled()) {
- // Is the extension active
- redirectOnUninstalledExtension('mailid');
-
- // Secure all data
- $url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = '';
- if (REQUEST_ISSET_GET('uid')) $url_uid = bigintval(REQUEST_GET('uid'));
- if (REQUEST_ISSET_GET('mailid')) $url_mid = bigintval(REQUEST_GET('mailid'));
- if (REQUEST_ISSET_GET('bonusid')) $url_bid = bigintval(REQUEST_GET('bonusid'));
- if (REQUEST_ISSET_GET('code')) $code = bigintval(REQUEST_GET('code'));
- if (REQUEST_ISSET_GET('mode')) $mode = REQUEST_GET('mode');
-
- // 01 1 12 2 2 21 1 22 10
- if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
- // No image? Then output header
- if ($mode != 'img') loadIncludeOnce('inc/header.php');
-
- // Maybe he wants to confirm an email?
- if ($url_mid > 0) {
- $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND `userid`=%s LIMIT 1",
- array($url_mid, $url_uid), __FILE__, __LINE__);
- $type = 'mailid'; $urlId = $url_mid;
- } elseif ($url_bid > 0) {
- $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND `userid`=%s LIMIT 1",
- array($url_bid, $url_uid), __FILE__, __LINE__);
- $type = 'bonusid'; $urlId = $url_bid;
- }
+// Set content type and HTTP status
+setContentType('text/html');
+setHttpStatus('404 NOT FOUND');
+
+// Is the extension mailid active?
+redirectOnUninstalledExtension('mailid');
+
+// Is the extension other active?
+redirectOnUninstalledExtension('other');
+
+// Init variables
+$userId = '0';
+$bonusId = '0';
+$mailId = '0';
+$code = '0';
+$mode = '';
+
+// Secure all data
+if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid'));
+if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid'));
+if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid'));
+if (isGetRequestParameterSet('code')) $code = bigintval(getRequestParameter('code'));
+if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode');
+
+// 01 2 21 12 2 2 21 1 2210
+if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
+ // No image?
+ if ($mode != 'img') {
+ // ... then output header
+ loadIncludeOnce('inc/header.php');
+ } // END - fi
+
+ // Maybe he wants to confirm an email?
+ if ($mailId > 0) {
+ $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
+ array($mailId, $userId), __FILE__, __LINE__);
+ $type = 'mailid';
+ $urlId = $mailId;
+ } elseif ($bonusId > 0) {
+ $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
+ array($bonusId, $userId), __FILE__, __LINE__);
+ $type = 'bonusid';
+ $urlId = $bonusId;
+ }
+
+ if (SQL_NUMROWS($result_main) == 1) {
+ // Is the stats id valid?
+ list($lid, $ltype) = SQL_FETCHROW($result_main);