} // END - if
// Shall we display the copyright notice?
- if ((!REQUEST_ISSET_GET(('frame'))) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && (getConfig('WRITE_FOOTER') == 'Y') && ($GLOBALS['header_sent'] == '2')) {
+ if ((!REQUEST_ISSET_GET('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && (getConfig('WRITE_FOOTER') == 'Y') && ($GLOBALS['header_sent'] == '2')) {
// Backlink enabled?
if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
// Copyright with backlink, thanks! :-)
} // END - if
// Shall we display the parsing time and number of queries?
- if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == '2')) {
+ if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET('frame')) && ($GLOBALS['header_sent'] == '2')) {
// Then display it here
displayParsingTime();
} // END - if
} // END - if
// Load body or not
-if (($GLOBALS['module'] != 'frametester') || (($GLOBALS['module'] == 'frametester') && (REQUEST_ISSET_GET(('frame')))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET(('frame')))) && ($GLOBALS['output_mode'] != '1')) {
+if (($GLOBALS['module'] != 'frametester') || (($GLOBALS['module'] == 'frametester') && (REQUEST_ISSET_GET('frame'))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET('frame'))) && ($GLOBALS['output_mode'] != '1')) {
// Is the header sent and the script is not the mail confirmation script and not a CSS?
if (($GLOBALS['header_sent'] == '1') && (basename($_SERVER['PHP_SELF']) != 'mailid.php') && ($GLOBALS['output_mode'] != '1')) {
// Add BODY tag
$DATA['keys'][] = 'status';
if ((!$NO_UPDATE) && (IS_ADMIN()) && ($GLOBALS['what'] == "add_sponsor")) {
// Only allowed for admin
- $DATA['values'][] = "PENDING";
+ $DATA['values'][] = 'PENDING';
} else {
// Guest area
- $DATA['values'][] = "UNCONFIRMED";
+ $DATA['values'][] = 'UNCONFIRMED';
// Generate hash code
$DATA['keys'][] = "hash";
// Search for an email address in the database
function SPONSOR_FOUND_EMAIL_DB ($email) {
// Do we already have the provided email address in our DB?
- $ret = (GET_TOTAL_DATA($email, "sponsor_data", "id", 'email', true) == 1);
+ $ret = (GET_TOTAL_DATA($email, "sponsor_data", 'id', 'email', true) == 1);
// Return result
return $ret;
}
// Load URL data by given search term and column
-function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add = '') {
+function SURFBAR_GET_URL_DATA ($searchTerm, $column='id', $order='id', $sort="ASC", $group='id', $add = '') {
// By default nothing is found
$GLOBALS['last_url_data'] = array();
// Is the column an id number?
- if (($column == "id") || ($column == 'userid')) {
+ if (($column == 'id') || ($column == 'userid')) {
// Extra secure input
$searchTerm = bigintval($searchTerm);
} // END - if
- // If the column is "id" there can be only one entry
+ // If the column is 'id' there can be only one entry
$limit = '';
- if ($column == "id") {
+ if ($column == 'id') {
$limit = "LIMIT 1";
} // END - if
// Then load all!
while ($dataRow = SQL_FETCHARRAY($result)) {
// Shall we group these results?
- if ($group == "id") {
+ if ($group == 'id') {
// Add the row by id as index
$GLOBALS['last_url_data'][$dataRow['id']] = $dataRow;
} else {
}
// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
-function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $extraFields = array()) {
+function SURFBAR_REGISTER_URL ($url, $uid, $status = 'PENDING', $addMode = 'reg', $extraFields = array()) {
// Make sure by the user registered URLs are always pending
- if ($addMode == "reg") $status = "PENDING";
+ if ($addMode == 'reg') {
+ $status = 'PENDING';
+ } // END - if
// Prepare content
$content = merge_array($extraFields, array(
));
// Is limit/reload set?
- if (!isset($config['limit'])) $content['limit'] = 0;
- if (!isset($config['reload'])) $content['reload'] = 0;
+ if (!isset($config['limit'])) {
+ $content['limit'] = 0;
+ } // END - if
+ if (!isset($config['reload'])) {
+ $content['reload'] = 0;
+ } // END - if
// Insert the URL into database
$content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content);
$content['limit'] = surfbarTranslateLimit($content['limit']);
// If in reg-mode we notify admin
- if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
+ if (($addMode == 'reg') || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
// Notify admin even when he as unlocked an email
SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
} // END - if
$templateName = "surfbar_frameset";
// Any frame set? ;-)
- if (REQUEST_ISSET_GET(('frame'))) {
+ if (REQUEST_ISSET_GET('frame')) {
// Use the frame as a template name part... ;-)
$templateName = sprintf("surfbar_frame_%s",
- REQUEST_GET(('frame'))
+ REQUEST_GET('frame')
);
} // END - if
}
} elseif (REQUEST_ISSET_GET(('reset_pass'))) {
// Is the form submitted?
- if ((REQUEST_ISSET_POST(('send_link'))) && (REQUEST_ISSET_POST(('email')))) {
+ if ((REQUEST_ISSET_POST(('send_link'))) && (REQUEST_ISSET_POST('email'))) {
// Try to send the link out
$OUT = ADMIN_SEND_PASSWORD_RESET_LINK(REQUEST_POST('email'));
}
// Change activation status
-function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
+function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = 'id') {
$cnt = 0; $newStatus = 'Y';
if ((is_array($IDs)) && (count($IDs) > 0)) {
// "Walk" all through and count them
}
// Delete rows by given ID numbers
-function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $deleteNow=false, $idColumn="id", $userIdColumn='userid') {
+function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $deleteNow=false, $idColumn='id', $userIdColumn='userid') {
// All valid entries? (We hope so here!)
if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
// Shall we delete here or list for deletion?
}
// Edit rows by given ID numbers
-function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $editNow=false, $idColumn="id", $userIdColumn='userid') {
+function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $editNow=false, $idColumn='id', $userIdColumn='userid') {
// All valid entries? (We hope so here!)
if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
// Shall we change here or list for editing?
}
// Un-/lock rows by given ID numbers
-function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn='userid') {
+function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn='id', $userIdColumn='userid') {
// All valid entries? (We hope so here!)
if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) {
// Shall we un-/lock here or list for locking?
}
// Undelete rows by given ID numbers
-function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn='userid') {
+function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn='id', $userIdColumn='userid') {
// All valid entries? (We hope so here!)
if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) {
// Shall we un-/lock here or list for locking?
ADD_DESCR('admin', __FILE__);
// Was an URL added?
-if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('url')))) {
+if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('url'))) {
// Dummy variables
$DATA = array(); $id = "reload_ye"; $skip = false;
// Display form is default
$FORM = true;
-if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('login'))) && (REQUEST_ISSET_POST(('email'))) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
+if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('login'))) && (REQUEST_ISSET_POST('email')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
// Add admin when not added already
if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == 'done') {
// Do not ouput any form!
// Set missing elements
// @TODO Do we still need this ugly code here?
if (!REQUEST_ISSET_POST(('login'))) REQUEST_SET_POST('login', '');
- if (!REQUEST_ISSET_POST(('email'))) REQUEST_SET_POST('email', '');
+ if (!REQUEST_ISSET_POST('email')) REQUEST_SET_POST('email', '');
// Load form from template
LOAD_TEMPLATE("admin_admins_add");
$SEL = countPostSelection();
if ($SEL > 0) {
// Add option for events
- $GLOBALS['cache_array']['admins'] = generateOptionList('admins', "id", "login", '', 'email');
+ $GLOBALS['cache_array']['admins'] = generateOptionList('admins', 'id', "login", '', 'email');
$SW = 2; $rowNameS = '';
foreach (REQUEST_POST('sel') as $template => $sel) {
// First of all load data from DB
if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
$OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
}
- $OUT .= generateOptionList('admins', "id", "login", $content['admin_id'], 'email');
+ $OUT .= generateOptionList('admins', 'id', "login", $content['admin_id'], 'email');
$OUT .= "</select>\n<br />\n";
$aid2 = $content['admin_id']; $id2 = $content['id'];
}
$content = array(
'sw' => $SW,
'id' => $id,
- 'admins_selection' => generateOptionList('admins', "id", "login", $aid, "default_acl"),
+ 'admins_selection' => generateOptionList('admins', 'id', "login", $aid, "default_acl"),
'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
'what_selection' => ADMIN_MENU_SELECTION("what", $wht, $id),
'mode_options' => generateOptionList(
}
// Prepare some constants for the template
- define('_ADMINS_SELECTION', generateOptionList('admins', "id", "login", '', "default_acl"));
+ define('_ADMINS_SELECTION', generateOptionList('admins', 'id', "login", '', "default_acl"));
define('_ACTION_SELECTION', ADMIN_MENU_SELECTION("action"));
define('_WHAT_SELECTION' , ADMIN_MENU_SELECTION("what"));
define('_MODE_OPTIONS' ,
$content = array(
'sw' => $SW,
'id' => $id,
- 'rallyes' => generateOptionList("rallye_data", "id", "title", $rallye),
+ 'rallyes' => generateOptionList("rallye_data", 'id', "title", $rallye),
'level' => $level,
'points' => $points,
'infos' => $infos,
// Load template
LOAD_TEMPLATE("admin_edit_email");
- } elseif (REQUEST_ISSET_POST(('save'))) {
+ } elseif (REQUEST_ISSET_POST('save')) {
// Save changes
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET
subject='%s',
ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE `id`=%s AND is_active='Y' LIMIT 1");
break;
}
- } elseif (REQUEST_ISSET_GET(('notify'))) {
+ } elseif (REQUEST_ISSET_GET('notify')) {
// Automatic notification
switch (REQUEST_GET('notify'))
{
$content['alogin'] = getAdminLogin($content['admin_id']);
// Count joined userids
- $joined = GET_TOTAL_DATA($content['id'], "rallye_users", "id", "rallye_id", true);
+ $joined = GET_TOTAL_DATA($content['id'], "rallye_users", 'id', "rallye_id", true);
// Did some users joined this rallye?
if ($joined > 0) {
// Get count/sum of refs, selected categories, unconfirmed mails
$REFS = GET_TOTAL_DATA($uid, "refsystem", "counter");
- $CATS = GET_TOTAL_DATA($uid, "user_cats", "id", 'userid', true);
- $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", 'userid', true);
+ $CATS = GET_TOTAL_DATA($uid, "user_cats", 'id', 'userid', true);
+ $LINKS = GET_TOTAL_DATA($uid, "user_links", 'id', 'userid', true);
// Add links to the numbers
if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$uid."\">".$LINKS."</a>]";
if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
// Get number of unconfirmed mails
- $LINKS = GET_TOTAL_DATA($content['userid'], "user_links", "id", 'userid', true);
+ $LINKS = GET_TOTAL_DATA($content['userid'], "user_links", 'id', 'userid', true);
if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$content['userid']."\">".translateComma($LINKS)."</a>]";
// Set link to sent mails if present
list($gender, $sname, $fname, $email, $status) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (($status == 'CONFIRMED') || ($status == "LOCKED")) {
+ if (($status == 'CONFIRMED') || ($status == 'LOCKED')) {
// Transfer data to constants
define('__GENDER' , translateGender($gender));
define('__SURNAME', $sname);
// Message when sponsor's account got lock
define('__EMAIL_MSG', getMessage('SPONSOR_ACCOUNT_LOCKED'));
$subject = getMessage('SPONSOR_SUBJECT_LOCKED');
- $status = "LOCKED";
+ $status = 'LOCKED';
} else {
// Message when sponsor's account got unlock
define('__EMAIL_MSG', getMessage('SPONSOR_ACCOUNT_UNLOCKED'));
SQL_FREERESULT($result_user);
// Is a lock reason set?
- if ((REQUEST_ISSET_POST(('lock'))) && ($status != "LOCKED")) {
+ if ((REQUEST_ISSET_POST(('lock'))) && ($status != 'LOCKED')) {
// Ok, lock the account!
if (GET_EXT_VERSION('user') >= '0.3.5') {
// Lock with reason
// Prepare message
$message = sprintf(getMessage('USER_ACCOUNT_LOCKED'), REQUEST_GET('uid'));
$ACT = true;
- } elseif ((REQUEST_ISSET_POST(('unlock'))) && ($status == "LOCKED")) {
+ } elseif ((REQUEST_ISSET_POST(('unlock'))) && ($status == 'LOCKED')) {
// Ok, unlock the account!
if (GET_EXT_VERSION('user') >= '0.3.5') {
// Reset lock reason as well
$SEL = 0;
// Some sanity-check
-if ((!REQUEST_ISSET_POST(('url'))) || (!REQUEST_ISSET_POST(('alternate')))) {
+if ((!REQUEST_ISSET_POST('url')) || (!REQUEST_ISSET_POST(('alternate')))) {
REQUEST_UNSET_POST('ok');
}
}
}
-if ((REQUEST_ISSET_POST(('url'))) || (REQUEST_ISSET_GET(('url'))) || (REQUEST_ISSET_GET(('frame')))) {
+if ((REQUEST_ISSET_POST('url')) || (REQUEST_ISSET_GET('url')) || (REQUEST_ISSET_GET('frame'))) {
// Default URL is ours
$url = constant('URL');
// Decode URL if set in GET parameters
- if (REQUEST_ISSET_GET(('url'))) $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
+ if (REQUEST_ISSET_GET('url')) $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
// Use URL from POST data if set
- if (REQUEST_ISSET_POST(('url'))) $url = REQUEST_POST('url');
+ if (REQUEST_ISSET_POST('url')) $url = REQUEST_POST('url');
// Add missing element
$frame = '';
- if (REQUEST_ISSET_GET(('frame'))) $frame = REQUEST_GET(('frame'));
+ if (REQUEST_ISSET_GET('frame')) $frame = REQUEST_GET('frame');
switch ($frame)
{
case '':
// Nobody was found unter this hash key... or our new member want's to confirm twice?
define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE'));
define('__UID', '0');
- LOAD_TEMPLATE("guest_confirm_table");
+ LOAD_TEMPLATE('guest_confirm_table');
}
} else {
// Nobody was found unter this hash key... or our new member want's to confirm twice?
define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE'));
define('__UID', '0');
- LOAD_TEMPLATE("guest_confirm_table");
+ LOAD_TEMPLATE('guest_confirm_table');
}
-} elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('email')))) {
+} elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST('email'))) {
// Confirmation link requested 0 1 2
$result = SQL_QUERY_ESC("SELECT userid, status, user_hash FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1",
- array(REQUEST_POST('email')), __FILE__, __LINE__);
+ array(REQUEST_POST('email')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Email address found
$DATA = SQL_FETCHROW($result);
switch ($DATA[1])
{
- case "UNCONFIRMED": // Account not confirmed
+ case 'UNCONFIRMED': // Account not confirmed
$msg = LOAD_EMAIL_TEMPLATE("guest_request_confirm", array('hash' => $DATA[2]), $DATA[0]);
sendEmail(REQUEST_POST('email'), getMessage('REQUEST_CONFIRM_LINK_SUBJ'), $msg);
$content = getMessage('CONFIRM_LINK_SENT');
$content = getMessage('LOGIN_ID_CONFIRMED');
break;
- case "LOCKED": // Account is locked
+ case 'LOCKED': // Account is locked
$content = getMessage('LOGIN_ID_LOCKED');
break;
}
// Send activation link again
if (IS_FORM_SENT()) {
// Check submitted data
- if (!REQUEST_ISSET_POST(('email'))) REQUEST_UNSET_POST('ok');
+ if (!REQUEST_ISSET_POST('email')) REQUEST_UNSET_POST('ok');
}
if (IS_FORM_SENT()) {
// Send new password
if (IS_FORM_SENT()) {
// Check submitted data
- if (!REQUEST_ISSET_POST(('email'))) REQUEST_UNSET_POST('ok');
+ if (!REQUEST_ISSET_POST('email')) REQUEST_UNSET_POST('ok');
} // END - if
if (IS_FORM_SENT()) {
}
// 6. Homepage URL
- if (!REQUEST_ISSET_POST(('url'))) {
+ if (!REQUEST_ISSET_POST('url')) {
// Homepage URL is empty
$FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_EMPTY');
} elseif (!isUrlValid(REQUEST_POST('url'))) {
}
// 7. Light validation of email address
- if ((!REQUEST_ISSET_POST(('email'))) || (REQUEST_POST('email') == "@")) {
+ if ((!REQUEST_ISSET_POST('email')) || (REQUEST_POST('email') == "@")) {
// Email is invalid/empty
$FORM_ERRORS[] = getMessage('SPONSOR_EMAIL_IS_INVALID');
} elseif (SPONSOR_FOUND_EMAIL_DB(REQUEST_POST('email'))) {
require($INC);
}
-if (REQUEST_ISSET_GET(('url'))) {
+if (REQUEST_ISSET_GET('url')) {
// Decode URL
$url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
}
} else {
// Check if he has an entry
- if (GET_TOTAL_DATA($UID, "user_cats", "id", 'userid', true, sprintf(" AND cat_id=%s", bigintval($content['id']))) == 1) {
+ if (GET_TOTAL_DATA($UID, "user_cats", 'id', 'userid', true, sprintf(" AND cat_id=%s", bigintval($content['id']))) == 1) {
$content['jn'] = '';
$content['jy'] = ' checked="checked"';
}
// Add description as navigation point
ADD_DESCR('member', __FILE__);
-define('UID_VALUE', getUserId()); $URL = '';
+// @TODO Try to rewrite this constant
+define('UID_VALUE', getUserId());
+
+// Init variable to prevent notices
+$URL = '';
// Detect what the member wants to do
$mode = 'show'; // Show his data
-if (REQUEST_ISSET_POST(('save'))) $mode = 'save'; // Save entered data
-if (REQUEST_ISSET_POST('edit')) $mode = 'edit'; // Edit data
-if (REQUEST_ISSET_POST(('notify'))) $mode = 'notify'; // Switch off notification
+if (REQUEST_ISSET_POST('save')) $mode = 'save'; // Save entered data
+if (REQUEST_ISSET_POST('edit')) $mode = 'edit'; // Edit data
+if (REQUEST_ISSET_POST('notify')) $mode = 'notify'; // Switch off notification
-switch ($mode)
-{
+switch ($mode) {
case 'show': // Show his data
if (EXT_IS_ACTIVE('country', true)) {
// New way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
$result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
} else {
// Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
$result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
}
$DATA = SQL_FETCHROW($result);
SQL_FREERESULT($result);
switch (getLanguage()) {
case 'de': define('DOB', $DATA[7].'.'.$DATA[8].'.'.$DATA[9]); break;
default : define('DOB', $DATA[8].'-'.$DATA[7].'-'.$DATA[9]); break;
- }
+ } // END - switch
if (EXT_IS_ACTIVE('country')) {
// Load country's description and code
$DATA[3] = COUNTRY_GENERATE_INFO($DATA[3]);
- }
+ } // END - if
// Load template
LOAD_TEMPLATE('member_mydata_overview');
break;
- case 'edit': // Edit data
- if (EXT_IS_ACTIVE('country', true)) {
- // New way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
- $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
+ case 'edit': // Edit data
+ if (EXT_IS_ACTIVE('country', true)) {
+ // New way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
+ $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(constant('UID_VALUE')), __FILE__, __LINE__);
- } else {
- // Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
- $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
+ array(getUserId()), __FILE__, __LINE__);
+ } else {
+ // Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13
+ $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(constant('UID_VALUE')), __FILE__, __LINE__);
- }
+ array(getUserId()), __FILE__, __LINE__);
+ }
- $DATA = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $DATA[13] = $DATA[12] + getConfig('profile_lock');
+ $DATA = SQL_FETCHROW($result);
+ SQL_FREERESULT($result);
+ $DATA[13] = $DATA[12] + getConfig('profile_lock');
- // How far is last change on his profile away from now?
- if (($DATA[13] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
- $DATA[13] = generateDateTime($DATA[13] + getConfig('profile_lock'), '0');
- // You cannot change your account
- LOAD_TEMPLATE('member_mydata_locked');
- } else {
- // He is allowed to change his profile
- switch ($DATA[10])
- {
- case 'M':
- define('M_DEFAULT', ' selected="selected"');
- define('F_DEFAULT', '');
- define('C_DEFAULT', '');
- break;
-
- case 'F':
- define('M_DEFAULT', '');
- define('F_DEFAULT', ' selected="selected"');
- define('C_DEFAULT', '');
- break;
-
- case 'C':
- define('M_DEFAULT', '');
- define('F_DEFAULT', '');
- define('C_DEFAULT', ' selected="selected"');
- break;
- }
- $DOB = '';
- switch (getLanguage())
- {
- case 'de': // German date format
- // Day
- $DOB .= ADD_SELECTION('day', $DATA[7]);
-
- // Month
- $DOB .= ADD_SELECTION('month', $DATA[8]);
-
- // Year
- $DOB .= ADD_SELECTION('year', $DATA[9]);
- break;
-
- default: // Default is the US date format... :)
- break;
- }
+ // How far is last change on his profile away from now?
+ if (($DATA[13] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
+ $DATA[13] = generateDateTime($DATA[13] + getConfig('profile_lock'), '0');
+ // You cannot change your account
+ LOAD_TEMPLATE('member_mydata_locked');
+ } else {
+ // He is allowed to change his profile
+ switch ($DATA[10])
+ {
+ case 'M':
+ define('M_DEFAULT', ' selected="selected"');
+ define('F_DEFAULT', '');
+ define('C_DEFAULT', '');
+ break;
+
+ case 'F':
+ define('M_DEFAULT', '');
+ define('F_DEFAULT', ' selected="selected"');
+ define('C_DEFAULT', '');
+ break;
+
+ case 'C':
+ define('M_DEFAULT', '');
+ define('F_DEFAULT', '');
+ define('C_DEFAULT', ' selected="selected"');
+ break;
+ }
+ $DOB = '';
+ switch (getLanguage()) {
+ case 'de': // German date format
+ // Day
+ $DOB .= ADD_SELECTION('day', $DATA[7]);
+
+ // Month
+ $DOB .= ADD_SELECTION('month', $DATA[8]);
+
+ // Year
+ $DOB .= ADD_SELECTION('year', $DATA[9]);
+ break;
+
+ default: // Default is the US date format... :)
+ break;
+ } // END - if
+
+ define('DOB', $DOB);
+ define('MAX_REC_LIST', addMaxReceiveList('member', $DATA[11], true));
+
+ if (EXT_IS_ACTIVE('country')) {
+ // Generate selection box
+ $OUT = "<select name=\"country_code\" class=\"member_select\" size=\"1\">\n";
+ $whereStatement = "WHERE `is_active`='Y'";
+ if (IS_ADMIN()) $whereStatement = '';
+ $OUT .= generateOptionList("countries", 'id', "descr", $DATA[3], "code", $whereStatement);
+ $OUT .= "</select>";
+ define('__COUNTRY_CONTENT', $OUT);
+ } else {
+ // Ouput default input box
+ define('__COUNTRY_CONTENT', "<input type=\"text\" name=\"cntry\" class=\"member_normal\" size=\"2\" maxlength=\"3\" value=\"".$DATA[3]."\" />");
+ }
+
+ // Load template
+ LOAD_TEMPLATE('member_mydata_edit');
+ }
+ break;
+
+ case 'save': // Save entered data
+ // Load old email / password: 0 1 2
+ $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
+ $DATA = SQL_FETCHROW($result);
+ SQL_FREERESULT($result);
+ $DATA[3] = $DATA[2] + getConfig('profile_lock');
- define('DOB', $DOB);
- define('MAX_REC_LIST', addMaxReceiveList('member', $DATA[11], true));
-
- if (EXT_IS_ACTIVE('country')) {
- // Generate selection box
- $OUT = "<select name=\"country_code\" class=\"member_select\" size=\"1\">\n";
- $whereStatement = "WHERE is_active='Y'";
- if (IS_ADMIN()) $whereStatement = '';
- $OUT .= generateOptionList("countries", "id", "descr", $DATA[3], "code", $whereStatement);
- $OUT .= "</select>";
- define('__COUNTRY_CONTENT', $OUT);
+ // How far is last change on his profile away from now?
+ if (($DATA[3] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
+ $DATA[3] = generateDateTime($DATA[3] + getConfig('profile_lock'), '0');
+ // You cannot change your account
+ LOAD_TEMPLATE('member_mydata_locked');
+ } elseif (!isEmailValid(REQUEST_POST('addy'))) {
+ // Invalid email address!
+ LOAD_TEMPLATE('admin_settings_saved', false, getMessage('INVALID_EMAIL_ADDRESS_ENTERED'));
+ } else {
+ // Generate hash
+ $hash = generateHash(REQUEST_POST('pass1'), substr($DATA[1], 0, -40));
+ if ((($hash == $DATA[1]) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) && (REQUEST_ISSET_POST(('pass1')))) {
+ // Only on simple changes normal mode is active = no email or password changed
+ $mode = 'normal'; $AND = '';
+
+ // Did the user changed the password?
+ if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $mode = 'pass'; }
+
+ // Or did he changed his password?
+ if (REQUEST_POST('addy') != $DATA[0]) {
+ // Jupp
+ if ($mode == 'normal') {
+ $mode = 'email';
} else {
- // Ouput default input box
- define('__COUNTRY_CONTENT', "<input type=\"text\" name=\"cntry\" class=\"member_normal\" size=\"2\" maxlength=\"3\" value=\"".$DATA[3]."\" />");
+ $mode .= ";email";
}
-
- // Load template
- LOAD_TEMPLATE('member_mydata_edit');
+ REQUEST_SET_POST('old_addy', $DATA[0]);
+ } // END - if
+
+ // Update member's profile
+ if (EXT_IS_ACTIVE('country')) {
+ // New way
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET
+`gender`='%s', `surname`='%s', `family`='%s',
+`street_nr`='%s',
+`country_code`=%s, `zip`=%s, `city`='%s',
+`email`='%s',
+`birth_day`=%s, `birth_month`=%s, `birth_year`=%s,
+`max_mails`=%s,
+`last_update`=UNIX_TIMESTAMP()".$AND.",
+`notified`='N',
+`last_profile_sent`=UNIX_TIMESTAMP()
+WHERE `userid`=%s AND `password`='%s' LIMIT 1",
+ array(
+ REQUEST_POST('gender'),
+ REQUEST_POST('surname'),
+ REQUEST_POST('family'),
+ REQUEST_POST('street_nr'),
+ bigintval(REQUEST_POST('country_code')),
+ bigintval(REQUEST_POST('zip')),
+ REQUEST_POST('city'),
+ REQUEST_POST('addy'),
+ bigintval(REQUEST_POST('day')),
+ bigintval(REQUEST_POST('month')),
+ bigintval(REQUEST_POST('year')),
+ bigintval(REQUEST_POST('max_mails')),
+ getUserId(),
+ getSession('u_hash')
+ ), __FILE__, __LINE__);
+ } else {
+ // Old way
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET
+`gender`='%s', `surname`='%s', `family`='%s',
+`street_nr`='%s',
+`country`='%s', `zip`=%s, `city`='%s',
+`email`='%s',
+`birth_day`=%s, `birth_month`=%s, `birth_year`=%s,
+`max_mails`='%s',
+`last_update`=UNIX_TIMESTAMP()".$AND.",
+`notified`='N',
+`last_profile_sent`=UNIX_TIMESTAMP()
+WHERE `userid`=%s AND `password`='%s' LIMIT 1",
+ array(
+ REQUEST_POST('gender'),
+ REQUEST_POST('surname'),
+ REQUEST_POST('family'),
+ REQUEST_POST('street_nr'),
+ REQUEST_POST('cntry'),
+ bigintval(REQUEST_POST('zip')),
+ REQUEST_POST('city'),
+ REQUEST_POST('addy'),
+ bigintval(REQUEST_POST('day')),
+ bigintval(REQUEST_POST('month')),
+ bigintval(REQUEST_POST('year')),
+ bigintval(REQUEST_POST('max_mails')),
+ getUserId(),
+ getSession('u_hash')
+ ), __FILE__, __LINE__);
}
- break;
-
- case 'save': // Save entered data
- // Load old email / password: 0 1 2
- $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
- $DATA = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $DATA[3] = $DATA[2] + getConfig('profile_lock');
-
- // How far is last change on his profile away from now?
- if (($DATA[3] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
- $DATA[3] = generateDateTime($DATA[3] + getConfig('profile_lock'), '0');
- // You cannot change your account
- LOAD_TEMPLATE("member_mydata_locked");
- } elseif (!isEmailValid(REQUEST_POST('addy'))) {
- // Invalid email address!
- LOAD_TEMPLATE('admin_settings_saved', false, getMessage('INVALID_EMAIL_ADDRESS_ENTERED'));
- } else {
- // Generate hash
- $hash = generateHash(REQUEST_POST('pass1'), substr($DATA[1], 0, -40));
- if ((($hash == $DATA[1]) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) && (REQUEST_ISSET_POST(('pass1')))) {
- // Only on simple changes normal mode is active = no email or password changed
- $mode = 'normal'; $AND = '';
-
- // Did the user changed the password?
- if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $mode = 'pass'; }
-
- // Or did he changed his password?
- if (REQUEST_POST('addy') != $DATA[0]) {
- // Jupp
- if ($mode == 'normal') { $mode = 'email'; } else { $mode .= ";email"; }
- REQUEST_SET_POST('old_addy', $DATA[0]);
- }
-
- // Update member's profile
- if (EXT_IS_ACTIVE('country')) {
- // New way
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET
-gender='%s', surname='%s', family='%s',
-street_nr='%s',
-country_code=%s, zip=%s, city='%s',
-email='%s',
-birth_day=%s, birth_month=%s, birth_year=%s,
-max_mails=%s,
-last_update=UNIX_TIMESTAMP()".$AND.",
-notified='N',
-last_profile_sent=UNIX_TIMESTAMP()
-WHERE userid=%s AND password='%s' LIMIT 1",
- array(
- REQUEST_POST('gender'),
- REQUEST_POST('surname'),
- REQUEST_POST('family'),
- REQUEST_POST('street_nr'),
- bigintval(REQUEST_POST('country_code')),
- bigintval(REQUEST_POST('zip')),
- REQUEST_POST('city'),
- REQUEST_POST('addy'),
- bigintval(REQUEST_POST('day')),
- bigintval(REQUEST_POST('month')),
- bigintval(REQUEST_POST('year')),
- bigintval(REQUEST_POST('max_mails')),
- UID_VALUE,
- getSession('u_hash')
- ), __FILE__, __LINE__);
- } else {
- // Old way
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET
-gender='%s', surname='%s', family='%s',
-street_nr='%s',
-country='%s', zip=%s, city='%s',
-email='%s',
-birth_day=%s, birth_month=%s, birth_year=%s,
-max_mails='%s',
-last_update=UNIX_TIMESTAMP()".$AND.",
-notified='N',
-last_profile_sent=UNIX_TIMESTAMP()
-WHERE userid=%s AND password='%s' LIMIT 1",
- array(
- REQUEST_POST('gender'),
- REQUEST_POST('surname'),
- REQUEST_POST('family'),
- REQUEST_POST('street_nr'),
- REQUEST_POST('cntry'),
- bigintval(REQUEST_POST('zip')),
- REQUEST_POST('city'),
- REQUEST_POST('addy'),
- bigintval(REQUEST_POST('day')),
- bigintval(REQUEST_POST('month')),
- bigintval(REQUEST_POST('year')),
- bigintval(REQUEST_POST('max_mails')),
- UID_VALUE,
- getSession('u_hash')
- ), __FILE__, __LINE__);
- }
-
- // Get all modes ...
- $modes = explode(';', $mode);
-
- // ... and run them through
- sendModeMails ('mydata', $modes);
- } else {
- // Entered wrong pass for updating profile
- LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEBER_UPDATE_PWD_WRONG'));
- }
- }
- break;
-
- case 'notify': // Switch off notfication
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
- $URL = 'modules.php?module=login&what=welcome&msg=' . urlencode(getMessage('PROFILE_UPDATED'));
- break;
+
+ // Get all modes ...
+ $modes = explode(';', $mode);
+
+ // ... and run them through
+ sendModeMails ('mydata', $modes);
+ } else {
+ // Entered wrong pass for updating profile
+ LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEBER_UPDATE_PWD_WRONG'));
+ }
+ }
+ break;
+
+ case 'notify': // Switch off notfication
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
+ $URL = 'modules.php?module=login&what=welcome&msg=' . urlencode(getMessage('PROFILE_UPDATED'));
+ break;
}
if (!empty($URL)) {
// Load generated URL
redirectToUrl($URL);
-}
+} // END - if
//
?>
define('__MIN_VALUE', getConfig('order_min'));
// Count unconfirmed mails
-$links = GET_TOTAL_DATA(getUserId(), "user_links", "id", 'userid', true);
+$links = GET_TOTAL_DATA(getUserId(), "user_links", 'id', 'userid', true);
// Does the user has more than 0 mails per day set?
$HOLIDAY = 'userid';
SURFBAR_HANDLE_SELF_MAINTENANCE();
// Is there a check value?
- if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET(('frame'))) && (in_array(REQUEST_GET('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
+ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array(REQUEST_GET('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
// Reload-lock is full, surfbar stopped so...
// Load header
loadIncludeOnce('inc/header.php');
// Load template
- if (((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'stop')) || (!REQUEST_ISSET_GET(('frame')))) {
+ if (((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'stop')) || (!REQUEST_ISSET_GET('frame'))) {
// Load template for "start" page
LOAD_TEMPLATE('surfbar_frame_start');
LOAD_TEMPLATE('surfbar_start_banner');
// This makes the footer appear again
- REQUEST_UNSET_GET(('frame'));
- } elseif ((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'stats')) {
+ REQUEST_UNSET_GET('frame');
+ } elseif ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'stats')) {
// Get total points amount
$points = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
// Load template for "stats" page
LOAD_TEMPLATE('surfbar_frame_stats', false, $content);
- } elseif ((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'textlinks')) {
+ } elseif ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'textlinks')) {
// Prepare content
$content = array(
'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(),
$templateName = SURFBAR_DETERMINE_TEMPLATE_NAME();
// Frame "top" set?
- if ((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'top')) {
+ if ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'top')) {
// Determine next id
$nextId = SURFBAR_DETERMINE_NEXT_ID();
// Load new URL
SURFBAR_RELOAD_TO_STOP_PAGE('stop2');
}
- } elseif ((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'start')) {
+ } elseif ((REQUEST_ISSET_GET('frame')) && (REQUEST_GET('frame') == 'start')) {
// Starter frame found so let the footer display
- REQUEST_UNSET_GET(('frame'));
+ REQUEST_UNSET_GET('frame');
} else {
// Load header in frameset mode
$isFrameset = true;