- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_clicks=ref_clicks+1 WHERE userid=%s LIMIT 1",
- array(bigintval($ref)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
+ array(makeDatabaseUserId(determineReferalId())), __FILE__, __LINE__);
+
+ // Base URL for redirection
+ switch (getConfig('refid_target')) {
+ case 'register':
+ $URL = 'modules.php?module=index&what=register';
+ break;
+
+ case 'index':
+ $URL = 'modules.php?module=index';
+ break;
+ } // END - switch