./inc/functions.php:2255: // @TODO This is still very static, rewrite it somehow
./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter
./inc/install-functions.php:59: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1118:// @TODO Rewrite these two constants
-./inc/language/de.php:1133:// @TODO Rewrite these three constants
+./inc/language/de.php:1117:// @TODO Rewrite these two constants
+./inc/language/de.php:1132:// @TODO Rewrite these three constants
./inc/language/de.php:300: // @TODO Following two are unused?
./inc/language/de.php:811:// @TODO Are these constants longer used?
./inc/language-functions.php:234: // @TODO These are all valid languages, again hard-coded
SQL_FREERESULT($result_links);
// At least one link was found, enougth to pay back the points
- if (($userid != $content['userid']) && ($userid > 0) && ($points > 0)) {
+ if (($userid != $content['userid']) && (isValidUserId($userid)) && ($points > 0)) {
// Directly add points back to senders account
addPointsAutoPurge($userid, $points);
$points = '0';
'ADMIN_USER_PROFILE_TITLE' => "Mitgliedsprofil aufrufen",
'LIST_UNCONFIRMED_MEMBER_LINKS' => "Unbestätigte Maillinks eines Mitgliedes auflisten",
'MEMBER_ENTER_MORE_MIN_RECEIVERS' => "Geben Sie mehr als <span class=\"data\">{?order_min?}</span> Empfänger ein.",
- 'NO_TEMPLATE_SUPPLIED' => "Keinen Template-Namen übergeben! Bug im Script erkannt. Bitte den Webmaster ({?WEBMASTER?}) verständigen.",
+ 'NO_TEMPLATE_SUPPLIED' => "Keinen Templatenamen übergeben! Bug im Script erkannt. Bitte den Webmaster ({?WEBMASTER?}) verständigen.",
'_OR' => "oder",
'GUEST_NEW_PASSWORD_SEND' => "Neues Passwort ist zu Ihrem Postfach unterwegs.",
'UNDER_CONSTRUCTION' => "Funktion noch im Aufbau.",
'DEFAULT_POINTS' => "Punkte",
'PROBLEM_POINTS_OVERVIEW_UNAVAILABLE' => "{?POINTS?}-Übersicht derzeit nicht verfügbar.",
'ADMIN_NOTHING_SELECTED_CHANGE' => "Sie haben nichts zum Ändern des Status ausgewählt.",
- 'TEMPLATE_CONTENT' => "Template-Content:",
- 'TEMPLATE_DATA' => "Template-Daten:",
+ 'TEMPLATE_CONTENT' => "Templatedaten:",
'ADMIN_LINK_DELETE_USER_TITLE' => "Mitglied löschen (mit Abfrage)",
'ADMIN_LINK_EDIT_USER_TITLE' => "Mitglied editieren",
'ADMIN_LINK_LOCK_USER_TITLE' => "Mitglied sperren",
function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
if (empty($cnt)) $cnt = '0';
$add = ''; $DT_MODE = '0';
- if ($userid > 0) {
+ if (isValidUserId($userid)) {
// Load entries only from a single user
$add = sprintf(" AND `userid`=%s", bigintval($userid));
$mode = 'member'; $COLS = 4; $DT_MODE = 2;
$prices['active'][$key] = $active;
// Allow valid and active users with at least one ref to get points
- if (($userid > 0) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0)) {
+ if ((isValidUserId($userid)) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0)) {
$total++;
} // END - if
} // END - foreach
// Run array through (by userid is the most important 2nd-level-array)
foreach($prices['userid'] as $key => $userid) {
// Allow valid and active users with at least one ref to get points
- if (($userid > 0) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0)) {
+ if ((isValidUserId($userid)) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0)) {
// Transfer data to array for the mail template
$DATA['level'] = $prices['level'][$key];
$DATA['points'] = $prices['points'][$key];
} // END - if
// Is the exlude userid set?
- if ($excludeUserId > 0) {
+ if (isValidUserId($excludeUserId)) {
// Then add it
$userids['url_userid'][$excludeUserId] = $excludeUserId;
} // END - if
// Nickname entered
$result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' OR `userid`='%s' OR `email`='%s' LIMIT 1",
array($userid, $userid, $email), __FUNCTION__, __LINE__);
- } elseif (($userid > 0) && (empty($email))) {
+ } elseif ((isValidUserId($userid)) && (empty($email))) {
// Direct userid entered
$result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($userid)), __FUNCTION__, __LINE__);
// Creates a user-profile link for the admin. This function can also be used for many other purposes
function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
- if (($title == '') && ($userid > 0)) {
+ if (($title == '') && (isValidUserId($userid))) {
// Set userid as title
$title = $userid;
} elseif ($userid == 0) {
// Creates a link to the user's admin-profile
function adminCreateUserLink ($userid) {
// Is the userid set correctly?
- if ($userid > 0) {
+ if (isValidUserId($userid)) {
// Create a link to that profile
return '{%url=modules.php?module=admin&what=list_user&userid=' . bigintval($userid) . '%}';
} // END - if
SQL_FREERESULT($result);
// Obtain some data
- if (!isGetRequestParameterSet('task') && (!empty($userid)) && ($userid > 0)) {
+ if (!isGetRequestParameterSet('task') && (!empty($userid)) && (isValidUserId($userid))) {
// Get task id from database
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `userid`=%s AND `task_type`='PAYOUT_REQUEST' AND `task_created`=%s LIMIT 1",
array(bigintval($userid), bigintval($tstamp)), __FILE__, __LINE__);
$taskId = getRequestParameter('task');
}
- if ((!empty($taskId)) && (!empty($userid)) && ($userid > 0)) {
+ if ((!empty($taskId)) && (!empty($userid)) && (isValidUserId($userid))) {
// Load user's data
if (!fetchUserData($userid)) {
// Abort here because it is not valid!
$ret = 'failed';
// Is the userid valid?
- if ($userid > 0) {
+ if (isValidUserId($userid)) {
// Remove entry from array
unset($receivers[$key]);
array(bigintval($DATA['id'])), __FILE__, __LINE__);
} else {
// Is the userid set?
- if ($userid > 0) {
+ if (isValidUserId($userid)) {
// User does not exists, pay points back
$points = getPaymentPoints($DATA['payment_id']);
addPointsDirectly('pool_payback', $DATA['sender'], $points);
// Walk through all points
foreach ($pointsBack as $userid => $PB) {
// Add points only when we have points left to add and a valid user id
- if (($PB > 0) && ($userid > 0)) {
+ if (($PB > 0) && (isValidUserId($userid))) {
// Prepare content
$content = array(
'points' => $PB
redirectOnUninstalledExtension('mailid');
// Init
-$url_userid = '0';
-$url_bid = '0';
-$url_mid = '0';
+$userId = '0';
+$bonusId = '0';
+$mailId = '0';
// Secure all data
-if (isGetRequestParameterSet('userid')) $url_userid = bigintval(getRequestParameter('userid'));
-if (isGetRequestParameterSet('mailid')) $url_mid = bigintval(getRequestParameter('mailid'));
-if (isGetRequestParameterSet('bonusid')) $url_bid = bigintval(getRequestParameter('bonusid'));
+if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid'));
+if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid'));
+if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid'));
// 01 1 12 2 2 21 1 2210
-if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
// Init result
$result_link = false;
// Maybe he wants to confirm an email?
- if ($url_mid > 0) {
+ if ($mailId > 0) {
// Normal-Mails
$result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
- array($url_mid, $url_userid), __FILE__, __LINE__);
+ array($mailId, $userId), __FILE__, __LINE__);
$type = 'mailid';
- $urlId = $url_mid;
- } elseif ($url_bid > 0) {
+ $urlId = $mailId;
+ } elseif ($bonusId > 0) {
// Bonus-Mail
$result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
- array($url_bid, $url_userid), __FILE__, __LINE__);
+ array($bonusId, $userId), __FILE__, __LINE__);
$type = 'bonusid';
- $urlId = $url_bid;
+ $urlId = $bonusId;
} else {
// Problem: No id entered
redirectToUrl('modules.php?module=index');
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($url_mid), __FILE__, __LINE__);
+ array($mailId), __FILE__, __LINE__);
break;
case 'BONUS':
// Bonus-Mails
$result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
- array($url_bid), __FILE__, __LINE__);
+ array($bonusId), __FILE__, __LINE__);
break;
default: // Invalid mail type
setExtraTitle($title);
// Is the user's id unlocked?
- if (fetchUserData($url_userid)) {
+ if (fetchUserData($userId)) {
// Status must be CONFIRMED
if (getUserData('status') == 'CONFIRMED') {
// Update last activity if not admin
if (!isAdmin()) {
// Is not admin, so update last activity
- updateLastActivity($url_userid);
+ updateLastActivity($userId);
} // END - if
// User has confirmed his account so we can procede...
case 'BONUS':
$result = SQL_QUERY_ESC("SELECT `points`, `time` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
- array($url_bid), __FILE__, __LINE__);
+ array($bonusId), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
list($points, $time) = SQL_FETCHROW($result);
$payment = '0.00000';
if (($time > 0) && (($payment > 0) || ($points > 0))) {
// Export data into constants for the template
$content = array(
- 'userid' => $url_userid,
+ 'userid' => $userId,
'type' => $type,
'data' => $urlId,
'url' => $URL
redirectOnUninstalledExtension('other');
// Init variables
-$url_userid = '0';
-$url_bid = '0';
-$url_mid = '0';
+$userId = '0';
+$bonusId = '0';
+$mailId = '0';
$code = '0';
$mode = '';
// Secure all data
-if (isGetRequestParameterSet('userid')) $url_userid = bigintval(getRequestParameter('userid'));
-if (isGetRequestParameterSet('mailid')) $url_mid = bigintval(getRequestParameter('mailid'));
-if (isGetRequestParameterSet('bonusid')) $url_bid = bigintval(getRequestParameter('bonusid'));
+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 1 12 2 2 21 1 22 10
-if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
// No image? Then output header
if ($mode != 'img') loadIncludeOnce('inc/header.php');
// Maybe he wants to confirm an email?
- if ($url_mid > 0) {
+ 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($url_mid, $url_userid), __FILE__, __LINE__);
+ array($mailId, $userId), __FILE__, __LINE__);
$type = 'mailid';
- $urlId = $url_mid;
- } elseif ($url_bid > 0) {
+ $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($url_bid, $url_userid), __FILE__, __LINE__);
+ array($bonusId, $userId), __FILE__, __LINE__);
$type = 'bonusid';
- $urlId = $url_bid;
+ $urlId = $bonusId;
}
if (SQL_NUMROWS($result_main) == 1) {
switch ($ltype) {
case 'NORMAL':
$result_mailid = SQL_QUERY_ESC("SELECT `pool_id`, `userid`, `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
- array($url_mid), __FILE__, __LINE__);
+ array($mailId), __FILE__, __LINE__);
break;
case 'BONUS':
$result_mailid = SQL_QUERY_ESC("SELECT `id`, `id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
- array($url_bid), __FILE__, __LINE__);
+ array($bonusId), __FILE__, __LINE__);
break;
default: // Unknown type
if ($ltype == 'BONUS') $sender = '0';
// Is the user id valid?
- if (fetchUserData($url_userid) === true) {
+ if (fetchUserData($userId) === true) {
// Is the user status CONFIRMED?
if (getUserData('status') == 'CONFIRMED') {
// User has confirmed his account so we can procede...
$img_code = '0';
if (!empty($code)) {
// Generate code
- $img_code = generateRandomCode(getConfig('code_length'), $code, $url_userid, $urlId);
+ $img_code = generateRandomCode(getConfig('code_length'), $code, $userId, $urlId);
} // END - if
// @TODO Rewrite this to a filter
switch ($ltype) {
case 'NORMAL':
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
- array($url_mid), __FILE__, __LINE__);
+ array($mailId), __FILE__, __LINE__);
// Update mediadata as well
if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update database
updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'add', 1);
} // END - if
- $stats_data = $url_mid;
+ $stats_data = $mailId;
break;
case 'BONUS':
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
- array($url_bid), __FILE__, __LINE__);
+ array($bonusId), __FILE__, __LINE__);
// Update mediadata as well
if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update database
updateMediadataEntry(array('total_clicks', 'bonus_clicks'), 'add', 1);
} // END - if
- $stats_data = $url_bid;
+ $stats_data = $bonusId;
break;
default: // Unknown type
if (isExtensionInstalledAndNewer('user', '0.1.2')) {
// Update counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE `userid`=%s LIMIT 1",
- array($url_userid), __FILE__, __LINE__);
+ array($userId), __FILE__, __LINE__);
// Update random confirmed as well?
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
// Update second counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=`rand_confirmed` + 1 WHERE `userid`=%s LIMIT 1",
- array($url_userid), __FILE__, __LINE__);
+ array($userId), __FILE__, __LINE__);
} // END - if
} // END - if
// Insert stats record
- insertUserStatsRecord($url_userid, $type, $stats_data);
+ insertUserStatsRecord($userId, $type, $stats_data);
// Right code entered?
if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
// Count down ref_payout value
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=`ref_payout`-1 WHERE `userid`=%s AND `ref_payout` > 0 LIMIT 1",
- array($url_userid), __FILE__, __LINE__);
+ array($userId), __FILE__, __LINE__);
// Add points
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment);
+ addPointsThroughReferalSystem('mailid_okay', $userId, $payment);
// Shall I add bonus points for "turbo clickers" ?
if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
// Is an active-rallye running and this is not a notification mail?
if ((isBonusRallyeActive()) && ($notify != 'Y')) {
// Shall I exclude the webmaster's own userid from the active-rallye?
- if ((((getBonusUserId() == $url_userid) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $url_userid)) && (getConfig('def_refid') != $url_userid)) {
+ if ((((getBonusUserId() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $userId)) && (getConfig('def_refid') != $userId)) {
// Add points and remember ranking are done in this function....
- addTurboBonus($urlId, $url_userid, $type);
+ addTurboBonus($urlId, $userId, $type);
// Set template to mailid_points_done2 which contains a link to the ranking list
$template = 'mailid_points_done2';
if ($locked) $template = 'mailid_points_locked2';
- $content['userid'] = $url_userid;
+ $content['userid'] = $userId;
$content['type'] = $type;
$content['data'] = $urlId;
} // END - if
} // END - if
// Load total points
- $content['total'] = getTotalPoints($url_userid);
+ $content['total'] = getTotalPoints($userId);
// Load template
loadTemplate($template, false, $content);
if ($code > 0) {
// Export data into constants for the template
$content['code'] = $code;
- $content['userid'] = $url_userid;
+ $content['userid'] = $userId;
$content['type'] = $type;
$content['data'] = $urlId;
$content['banner'] = loadTemplate('mailid_banner', true);
if (getConfig('code_length') > 0) {
// Generate Code
- $content['image'] = generateCaptchaCode($code, $type, $urlId, $url_userid);
+ $content['image'] = generateCaptchaCode($code, $type, $urlId, $userId);
$templ = 'mailid_enter_code';
} else {
// Disabled code
// Export data into constants for the template
$content['time'] = $time;
$content['tim2'] = strlen($time);
- $content['userid'] = $url_userid;
+ $content['userid'] = $userId;
$content['type'] = $type;
$content['data'] = $urlId;
$content['rand'] = mt_rand(0, 99999);