$OUT .= '<a name="menu" class="menu_blur" href="{%url=modules.php?module=' . getModule() . '&what=' . $content['sub_what'] . '%}" target="_self">';
} else {
// Not found! - open
- $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_WHAT_404=' . $content['sub_what'] . '%}">';
+ $OUT .= '<em style="cursor:help" class="notice" title="{%message,MENU_WHAT_404=' . $content['sub_what'] . '%}">';
}
// Menu title
if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) $GLOBALS['last_online'] = array();
// is the cache entry there?
- if (isset($GLOBALS['is_member'])) {
+ if (isset($GLOBALS[__FUNCTION__])) {
// Then return it
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHED! (' . intval($GLOBALS['is_member']) . ')');
- return $GLOBALS['is_member'];
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHED! (' . intval($GLOBALS[__FUNCTION__]) . ')');
+ return $GLOBALS[__FUNCTION__];
} elseif ((!isSessionVariableSet('userid')) || (!isSessionVariableSet('u_hash'))) {
// No member
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'No member set in cookie/session.');
}
// Cache status
- $GLOBALS['is_member'] = $ret;
+ $GLOBALS[__FUNCTION__] = $ret;
// Return status
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . intval($ret));
setCurrentUserId($userid);
// Don't look for invalid userids...
- if ($userid < 1) {
+ if (!isValidUserId($userid)) {
// Invalid, so abort here
debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $userid . ' is invalid.');
} elseif (isUserDataValid()) {
} // END - if
// Do we have cache?
- if (!isset($GLOBALS['is_admin'][$adminId])) {
+ if (!isset($GLOBALS[__FUNCTION__][$adminId])) {
// Init it with failed
- $GLOBALS['is_admin'][$adminId] = false;
+ $GLOBALS[__FUNCTION__][$adminId] = false;
// Search in array for entry
if (isset($GLOBALS['admin_hash'])) {
if (!empty($valPass)) {
// Check if password is valid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '(' . $valPass . '==' . $passCookie . ')='.intval($valPass == $passCookie));
- $GLOBALS['is_admin'][$adminId] = (($GLOBALS['admin_hash'] == $passCookie) || ((strlen($GLOBALS['admin_hash']) == 32) && ($GLOBALS['admin_hash'] == md5($passCookie))) || (($GLOBALS['admin_hash'] == '*FAILED*') && (!isExtensionActive('cache'))));
+ $GLOBALS[__FUNCTION__][$adminId] = (($GLOBALS['admin_hash'] == $passCookie) || ((strlen($GLOBALS['admin_hash']) == 32) && ($GLOBALS['admin_hash'] == md5($passCookie))) || (($GLOBALS['admin_hash'] == '*FAILED*') && (!isExtensionActive('cache'))));
} // END - if
} // END - if
// Return result of comparision
- return $GLOBALS['is_admin'][$adminId];
+ return $GLOBALS[__FUNCTION__][$adminId];
}
// Generates a list of "max receiveable emails per day"
// Init status
$data['action'] = '';
- //* DEBUG: */ debugOutput(__LINE__.'='.$module.'/'.$what.'/'.getAction().'=');
+ //* DEBUG: */ debugOutput(__LINE__ . '=' . $module . '/'.$what . '/' . getAction() . '=');
if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
// sql_patches is missing so choose depending on mode
if (isWhatSet()) {
* Dynamic referal system, can also send mails!
*
* subject = Subject line, write in lower-case letters and underscore is allowed
- * userid = Referal id wich should receive...
+ * userid = Referal id wich should receive...
* points = ... xxx points
* sendNotify = shall I send the referal an email or not?
* refid = inc/modules/guest/what-confirm.php need this
//* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): Referal level increased. DEPTH='.$GLOBALS['ref_level']);
}
- // Default is 'normal' points
- $data = 'points';
-
- // Which points, locked or normal?
- if ($locked === true) $data = 'locked_points';
-
// Check user account
//* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',points='.$points);
if (fetchUserData($userid)) {
+ // Determine wether the user has some mails to click before he/she gets the points
+ $locked = ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled()));
+
+ // Default is 'normal' points
+ $data = 'points';
+
+ // Which points, locked or normal?
+ if ($locked === true) {
+ $data = 'locked_points';
+ } // END - if
+
// This is the user and his ref
$GLOBALS['cache_array']['add_userid'][getUserData('refid')] = $userid;
//* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):data='.$data.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$add_mode.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
} // END - if
- // Determine wether the user has some mails to click before he/she gets the points
- $locked = false;
- if ((getUserData('ref_payout') > 0) && (!isDirectPaymentAllowed())) $locked = true;
-
// Prepare data for the filter
$filterData = array(
'subject' => $subject,
} elseif (($sendNotify === true) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) {
// Prepare content
$content = array(
- 'text' => '{--REASON_DIRECT_PAYMENT--}',
+ 'reason' => '{--REASON_DIRECT_PAYMENT--}',
'points' => $ref_points
);
$ret = '';
if ($table == '/ARRAY/') {
// Selection from array
- if ((is_array($id)) && (is_array($name)) && (count($id)) == (count($name))) {
+ if ((is_array($id)) && (is_array($name)) && ((count($id)) == (count($name)) || (!empty($callback)))) {
// Both are arrays
foreach ($id as $idx => $value) {
$ret .= '<option value="' . $value . '"';
// Is the call-back function set?
if (!empty($callback)) {
// Call it
- $name[$idx] = call_user_func_array($callback, array($name[$idx]));
+ $name[$idx] = call_user_func_array($callback, array($id[$idx]));
} // END - if
// Finish option tag
} // END - foreach
} else {
// Problem in request
- debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
+ debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name) . ',callback=' . $callback);
}
} else {
// Data from database
} // END - foreach
} else {
// No cateogries are defined yet
- $OUT = '<option class="member_failed">{--MEMBER_NO_CATEGORIES--}</option>';
+ $OUT = '<option class="notice">{--MEMBER_NO_CATEGORIES--}</option>';
}
// Return HTML code