./inc/modules/guest/what-mediadata.php:181:// @TODO Rewrite all these if-blocks to filters
./inc/modules/guest/what-mediadata.php:68: // @TODO Find a better formular than this one
./inc/modules/guest/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $adminId . '%}">' . $login . '</a>';
-./inc/modules/guest/what-sponsor_reg.php:295: // @TODO Maybe a default referal id?
+./inc/modules/guest/what-sponsor_reg.php:287: // @TODO Maybe a default referal id?
./inc/modules/guest/what-stats.php:100: // @TODO This can be somehow rewritten
./inc/modules/guest/what-stats.php:74:// @TODO This can be rewritten in a dynamic include
./inc/modules/member/what-beg2.php:87: // @TODO points->beg_points
./inc/mysql-manager.php:368: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:44:// @TODO Can we cache this?
./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1048: // @TODO Deprecate this thing
-./inc/template-functions.php:1059: // @TODO Deprecate this thing
-./inc/template-functions.php:1146: // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1179: // @TODO Add a little more infos here
-./inc/template-functions.php:1490:// @TODO Lame description for this function
-./inc/template-functions.php:1512: // @TODO Move this in a filter
+./inc/template-functions.php:1050: // @TODO Deprecate this thing
+./inc/template-functions.php:1061: // @TODO Deprecate this thing
+./inc/template-functions.php:1148: // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1181: // @TODO Add a little more infos here
+./inc/template-functions.php:1492:// @TODO Lame description for this function
+./inc/template-functions.php:1514: // @TODO Move this in a filter
./inc/template-functions.php:189: * @TODO On some pages this is buggy
./inc/template-functions.php:265: // @TODO Remove this sanity-check if all is fine
./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
$errorCode = getCode('BEG_SAME_AS_OWN');
}
- // Reload to index module
- if ((!empty($errorCode)) && (!empty($errorCode))) redirectToUrl('modules.php?module=index&code=' . $errorCode . '&ext=beg');
+ // Reload to index module if an error happens
+ if (!empty($errorCode)) {
+ redirectToUrl('modules.php?module=index&code=' . $errorCode . '&ext=beg');
+ } // END - if
} else {
// No userid entered
redirectToUrl('modules.php?module=index');
), __FUNCTION__, __LINE__);
while ($content = SQL_FETCHARRAY($result)) {
// Construct the message masked and add it
- $ret .= sprintf("%s %s %s (%s) - %s\n",
- translateGender($content['gender']),
+ $ret .= sprintf("{%%pipe,translateGender=%s%} %s %s (%s) - %s\n",
+ $content['gender'],
$content['surname'],
$content['family'],
$content['email'],
$content = getUserDataArray();
// Generate HTML list entry
- $add = '<li>{--ADMIN_MEMBER_UID--}: <strong>' . generateUserProfileLink($taskData['userid'], 'user_data') . ' (<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>)</strong></li>';
+ $add = '<li>{--ADMIN_MEMBER_UID--}: <strong>' . generateUserProfileLink($taskData['userid'], 'user_data') . ' (<a href="' . generateEmailLink($content['email'], 'user_data') . '">{%pipe,translateGender=' . $content['gender'] . '%} ' . $content['surname'] . ' ' . $content['family'] . '</a>)</strong></li>';
} else {
// Invalid userid, so log and zero it
logDebugMessage(__FUNCTION__, __LINE__, 'fetchUserData() failed: userid=' . $taskData['userid'] . ' not found.');
// Load sponsor details
$content = SQL_FETCHARRAY($result_main);
- // Prepare all data for the template
- // Init gender
- foreach (array('m', 'f', 'c') as $gender) {
- $content['gender_' . $gender] = '';
- } // END - foreach
-
- // Check for gender selection
- $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
-
// Warning because low points
$content['receive_warnings'] = addSelectionBox('yn', $content['receive_warnings'], 'receive_warning');
$content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
// Load entry
$content = SQL_FETCHARRAY($result_main);
- // Init entries
- foreach (array('gender_m','gender_f','gender_c') as $entry) {
- $content[$entry] = '';
- } // END - foreach
-
- // Prepare selections
- $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
-
// Load template
loadTemplate('admin_edit_user', false, $content);
}
$content = array(
'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
- 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
+ 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">{%pipe,translateGender=' . getUserData('gender') . '%} ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
// Load template
$content = array(
'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
- 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
+ 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">{%pipe,translateGender=' . getUserData('gender') . '%} ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
// Load template
);
// Check if referal count is larger 0 and update link
- if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
+ if ($refs_cnt > 0) {
+ $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
+ } // END - if
// Load template for level one
$OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
'userid' => $row['userid'],
'link' => $mailType,
'id' => $ID,
- 'email' => '<a href="' . generateEmailLink($row['email'], 'user_data') . '">' . translateGender($row['gender']) . ' ' . $row['surname'] . ' ' . $row['family'] . '</a>',
+ 'email' => '<a href="' . generateEmailLink($row['email'], 'user_data') . '">{%pipe,translateGender=' . $row['gender'] . '%} ' . $row['surname'] . ' ' . $row['family'] . '</a>',
'status' => $row['status'],
);
default: // Default is the US date format... :)
$content['birthday_selection'] = addSelectionBox('month', postRequestParameter('month')).addSelectionBox('day', postRequestParameter('day')).addSelectionBox('year', postRequestParameter('year'));
break;
- }
+ } // END - switch
// Adds a table for the guests with all visible categories
$content['category_selection'] = registerGenerateCategoryTable('guest', true);
// You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
$content['header_content'] = loadTemplate('register_header', true);
- // Other values
- $content['surname'] = SQL_ESCAPE(postRequestParameter('surname'));
- $content['family'] = SQL_ESCAPE(postRequestParameter('family'));
- $content['street_nr'] = SQL_ESCAPE(postRequestParameter('street_nr'));
- $content['zip'] = '';
+ // ZIP codes are numerical values
+ $content['zip'] = '';
if (isPostRequestParameterSet('zip')) {
- $content['zip'] = bigintval(postRequestParameter('zip'));
+ $content['zip'] = bigintval(postRequestParameter('zip'));
} // END - if
- $content['city'] = SQL_ESCAPE(postRequestParameter('city'));
- $content['email'] = SQL_ESCAPE(postRequestParameter('email'));
+
+ // Other values
+ foreach (array('gender', 'surname', 'family', 'street_nr', 'city', 'email') as $entry) {
+ $content[$entry] = SQL_ESCAPE(postRequestParameter($entry));
+ } // END - foreach
// The admin may see all
$whereStatement = "WHERE `is_active`='Y'";
- if (isAdmin()) $whereStatement = '';
+ if (isAdmin()) {
+ $whereStatement = '';
+ } // END - if
// Prepare country selection box
$OUT = '<select name="country_code" class="form_select" size="1">';
$content[$entry] = secureString(postRequestParameter($entry));
} // END - foreach
- // Init gender
- foreach (array('m', 'f', 'c') as $gender) {
- $content['gender_' . $gender] = '';
- } // END - foreach
-
- // Check for gender selection
- $content['gender_' . strtolower(postRequestParameter('gender'))] = ' selected="selected"';
-
// Init receive selection
$content['receive_warnings_y'] = '';
$content['receive_warnings_n'] = '';
// You cannot change your account
displayMessage($content['update_check']);
} else {
- // He is allowed to change his profile
- foreach (array('gender_m','gender_f','gender_c') as $entry) {
- $content[$entry] = '';
- } // END - foreach
-
- $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
+ // Init elements
$content['dob'] = '';
switch (getLanguage()) {
$GLOBALS['sponsor_output'] = displayMessage('{--SPONSOR_NO_MESSAGE_GENERATED--}', true);
}
} else {
- // Init gender
- foreach (array('m', 'f', 'c') as $gender) {
- $content['gender_' . $gender] = '';
- } // END - foreach
-
- // Check for gender selection
- $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
-
// Output formular
$GLOBALS['sponsor_output'] = loadTemplate('sponsor_account_form', true, $content);
}
// Generate a list of administrative links to a given userid
function generateMemberAdminActionLinks ($userid) {
// Make sure userid is a number
- if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ if ($userid != bigintval($userid)) {
+ debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ } // END - if
// Define all main targets
$targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
}
// Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
+function generateSelectionBoxFromArray (array $options, $name, $optionValue, $optionContent = '', $extraName = '') {
// Start the output
$OUT = '<select name="' . $name . '" size="1" class="form_select">
<option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
return loadTemplate('admin_settings_saved', $return, $message);
}
+// Generates a selection box for (maybe) given gender
+function generateGenderSelectionBox ($selectedGender = '') {
+ // Start the HTML code
+ $out = '<select name="gender" size="1" class="form_select">';
+
+ // Add the options
+ $out .= generateOptionList('/ARRAY/', array('M', 'F', 'C'), array('{--GENDER_M--}', '{--GENDER_F--}', '{--GENDER_C--}'), $selectedGender);
+
+ // Finish HTML code
+ $out .= '</select>';
+
+ // Return the code
+ return $out;
+}
+
//-----------------------------------------------------------------------------
// Template helper functions for EL
//-----------------------------------------------------------------------------
{--GENDER--}:
</td>
<td>
- <select name="gender" class="form_select" size="1">
- <option value="M">{--GENDER_M--}</option>
- <option value="F">{--GENDER_F--}</option>
- <option value="C">{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>
{--GENDER--}:
</td>
<td width="255">
- <select name="gender" class="form_select" size="1">
- <option value="M"$content[gender_m]>{--GENDER_M--}</option>
- <option value="F"$content[gender_f]>{--GENDER_F--}</option>
- <option value="C"$content[gender_c]>{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>
<tr>
<td width="195" align="right" height="21">{--GENDER--}:</td>
<td width="195">
- <select name="gender" class="form_select" size="1">
- <option value="M"$content[gender_m]>{--GENDER_M--}</option>
- <option value="F"$content[gender_f]>{--GENDER_F--}</option>
- <option value="C"$content[gender_c]>{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>
<td class="register_left">
{--GENDER--}$content[must_fillout_gender]:
</td>
- <td class="register_right"><select name="gender"
- size="1" class="form_select">
- <option value="M">{--GENDER_M--}</option>
- <option value="F">{--GENDER_F--}</option>
- <option value="C">{--GENDER_C--}</option>
- </select></td>
+ <td class="register_right">
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
+ </td>
</tr>
<tr>
<td class="register_left">{--SURNAME--}$content[must_fillout_surname],
{--GENDER--}:
</td>
<td>
- <select name="gender" class="form_select" size="1">
- <option value="M"$content[gender_m]>{--GENDER_M--}</option>
- <option value="F"$content[gender_f]>{--GENDER_F--}</option>
- <option value="C"$content[gender_c]>{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>
<tr>
<td align="right">{--GENDER--}:</td>
<td>
- <select name="gender" size="1" class="form_select">
- <option value="M"$content[gender_m]>{--GENDER_M--}</option>
- <option value="F"$content[gender_f]>{--GENDER_F--}</option>
- <option value="C"$content[gender_c]>{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>
{--GENDER--}:
</td>
<td class="bottom">
- <select name="gender" class="form_select" size="1">
- <option value="M"$content[gender_m]>{--GENDER_M--}</option>
- <option value="F"$content[gender_f]>{--GENDER_F--}</option>
- <option value="C"$content[gender_c]>{--GENDER_C--}</option>
- </select>
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
<tr>