// Add links for selecting some users
function alpha ($sortby) {
$add = '';
- foreach (array('page','offset','mode','status') as $param) {
+ foreach (array('page','offset','do','status') as $param) {
if (isGetRequestElementSet($param)) {
$add .= '&' . $param . '=' . getRequestElement($param);
} // END - if
$add = '&page=' . getRequestElement('page') . '&offset=' . getRequestElement('offset');
// Add status/ mode
- foreach (array('mode','status') as $param) {
+ foreach (array('do','status') as $param) {
if (isGetRequestElementSet($param)) {
$add .= '&' . $param . '=' . getRequestElement($param);
} // END - if
$OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
// Add status/mode
- foreach (array('mode','status') as $param) {
+ foreach (array('do','status') as $param) {
if (isGetRequestElementSet($param)) {
$OUT .= '&' . $param . '=' . getRequestElement($param);
} // END - if
return $email;
}
-// Selects a random user id as the new referal id if they have at least X confirmed mails in this run
+// Selects a random user id as the new referral id if they have at least X confirmed mails in this run
// @TODO Double-check configuration entry here
-function determineRandomReferalId () {
+function determineRandomReferralId () {
// Default is zero refid
$refid = NULL;
// Do we have one entry there?
if (SQL_NUMROWS($result) == 1) {
- // Use that userid as new referal id
+ // Use that userid as new referral id
list($refid) = SQL_FETCHROW($result);
} // END - if
// Is the timeout reached?
if ($probe >= getConfig('login_timeout')) {
// Add login bonus to user's account
- $add = ', `login_bonus`=`login_bonus`+{?login_bonus?}';
+ $add = ',`login_bonus`=`login_bonus`+{?login_bonus?}';
$GLOBALS['bonus_payed'] = true;
// Subtract login bonus from userid's account or jackpot
// Procedure to checking for login data
if (($GLOBALS['bonus_payed'] === true) && (isExtensionActive('bonus'))) {
// Bonus added (just displaying!)
- $url = 'modules.php?module=chk_login&mode=bonus';
+ $url = 'modules.php?module=chk_login&do=bonus';
} else {
// Bonus not added
- $url = 'modules.php?module=chk_login&mode=login';
+ $url = 'modules.php?module=chk_login&do=login';
}
} else {
// Use this URL
redirectToUrl('modules.php?module=index&what=login&login=' . $errorCode);
}
} else {
- // id or email is wrong
- displayMessage('<span class="notice">{--GUEST_WRONG_ID_EMAIL--}</span>');
+ // Id or email is wrong
+ displayMessage('<span class="bad">{--GUEST_WRONG_ID_EMAIL--}</span>');
}
// Return the error code
// And send him right away the confirmation mail
sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
- // Maybe he got "referaled"?
+ // Maybe he got "referraled"?
if ((isValidUserId($refid)) && ($refid != $userid)) {
- // Select the referal userid
+ // Select the referral userid
if (fetchUserData($refid)) {
// Update ref counter...
- updateReferalCounter($refid);
+ updateReferralCounter($refid);
// If version matches add ref bonus to refid's account
if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) {
handleBonusPoints(getConfig('bonus_ref'), $refid);
} // END - if
- // Add one-time referal bonus over referal system or directly
- initReferalSystem();
- addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), bigintval($userid));
+ // Add one-time referral bonus over referral system or directly
+ initReferralSystem();
+ addPointsThroughReferralSystem('referral_bonus', $refid, getPointsRef(), bigintval($userid));
} // END - if
} // END - if
if (isExtensionActive('rallye')) {
// Add user to rallye (or not?)
- addUserToReferalRallye(bigintval($userid));
+ addUserToReferralRallye(bigintval($userid));
} // END - if
// Account confirmed!
// Init title with "all accounts"
$code = '{--ADMIN_LIST_ALL_ACCOUNTS--}';
- // Do we have a 'status' or 'mode' set?
+ // Do we have a 'status' or 'do' set?
if (isGetRequestElementSet('status')) {
// Set title according to the 'status'
$code = sprintf("{--ADMIN_LIST_STATUS_%s_ACCOUNTS--}", strtoupper(getRequestElement('status')));
- } elseif (isGetRequestElementSet('mode')) {
- // Set title according to the "mode"
- $code = sprintf("{--ADMIN_LIST_MODE_%s_ACCOUNTS--}", strtoupper(getRequestElement('mode')));
+ } elseif (isGetRequestElementSet('do')) {
+ // Set title according to 'do'
+ $code = sprintf("{--ADMIN_LIST_DO_%s_ACCOUNTS--}", strtoupper(getRequestElement('do')));
}
// Return the code
return $code;
}
+// Template call-back function for displaying "username"
+function doTemplateDisplayUsername ($template, $clear = false, $userid = NULL) {
+ // Is a userid set?
+ if (!isValidUserId($userid)) {
+ // Please don't call this without a valid userid
+ debug_report_bug(__FUNCTION__, __LINE__, 'template=' . $template . ',clear=' . intval($clear) . ',userid[' . gettype($userid) . ']=' . intval($userid) . ' - Invalid userid provided.');
+ } // END - if
+
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$userid])) {
+ // Generate code
+ $GLOBALS[__FUNCTION__][$userid] = $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})';
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$userid];
+}
+
// [EOF]
?>