-if (isBooleanConstantAndTrue('mxchange_installed')) {
- // Is the extension active
- if (!EXT_IS_ACTIVE("mailid", true)) {
- // Is not activated/installed yet!
- addFatalMessage(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
- } // END - if
+if (!isInstalled()) {
+ // You have to install first!
+ redirectToUrl('install.php');
+} // END - if
+
+// 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;
+ }