./inc/libs/rallye_functions.php:854:// @TODO Please document this function
./inc/libs/rallye_functions.php:910: // Load count @TODO Can't we rewrite this to our API?
./inc/libs/refback_functions.php:61: // @TODO Try to rewrite the following unset()
-./inc/libs/register_functions.php:296: // @TODO Rewrite these all to a single filter
-./inc/libs/register_functions.php:375: // @TODO Rewrite this to a filter
-./inc/libs/register_functions.php:382: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+./inc/libs/register_functions.php:292: // @TODO Rewrite these all to a single filter
+./inc/libs/register_functions.php:371: // @TODO Rewrite this to a filter
+./inc/libs/register_functions.php:378: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
./inc/libs/surfbar_functions.php:1540: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:712:// @TODO Can't we use our new expression language instead of this ugly code?
./inc/libs/surfbar_functions.php:953: // @TODO Invalid salt should be refused
return $status;
}
+// Checks wether refback is enabled
+function isRefbackEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_refback_enabled'])) {
+ // Determine it
+ $GLOBALS['is_refback_enabled'] = (getConfig('refback_enabled') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_refback_enabled'];
+}
+
// [EOF]
?>
$OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
while ($content = SQL_FETCHARRAY($result)) {
// Prepare array for the template
- $content = array(
- 'cat' => $content['cat'],
- 'def_y' => '',
- 'def_n' => '',
- 'id' => $content['id'],
- );
+ $content['default_yes'] = '';
+ $content['default_no'] = '';
// Mark categories
if ((postRequestParameter('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!isPostRequestParameterSet('cat', $content['id'])))) {
- $content['def_y'] = ' checked="checked"';
+ $content['default_yes'] = ' checked="checked"';
} else {
- $content['def_n'] = ' checked="checked"';
+ $content['default_no'] = ' checked="checked"';
}
// Load template and switch color
if ($row['field_required'] == 'Y') $value = '<span class="guest_failed">(*)</span>';
// Add it
- $content['must_fillout_'.strtolower($row['field_name']).''] = $value;
+ $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
} // END - while
// Free memory
// Include fields only for action 'edit'
if ($action == 'edit') {
// Default is not limited
- $urlData['limited_y'] = '';
- $urlData['limited_n'] = ' checked="checked"';
- $urlData['limited'] = 'false';
+ $urlData['limited_yes'] = '';
+ $urlData['limited_no'] = ' checked="checked"';
+ $urlData['limited'] = 'false';
// Is this URL limited?
if (SURFBAR_GET_VIEWS_MAX() > 0) {
// Then rewrite form data
- $urlData['limited_y'] = ' checked="checked"';
- $urlData['limited_n'] = '';
- $urlData['limited'] = 'true';
+ $urlData['limited_yes'] = ' checked="checked"';
+ $urlData['limited_no'] = '';
+ $urlData['limited'] = 'true';
} // END - if
} // END - if
adminSaveSettingsFromPostData();
} else {
// Prepare content
- $content = array();
+ $content = array(
+ 'refback_enabled_n' => '',
+ 'refback_enabled_y' => ''
+ );
// Translate Y/N switches
- switch (getConfig('refback_enabled')) {
- case 'Y': // Refback enabled
- $content['refback_enabled_y'] = ' checked="checked"';
- $content['refback_enabled_n'] = '';
- break;
-
- case 'N': // Refback disabled
- $content['refback_enabled_y'] = '';
- $content['refback_enabled_n'] = ' checked="checked"';
- break;
- } // END - switch
+ if (isRefbackEnabled()) {
+ // Enabled
+ $content['refback_enabled_y'] = ' checked="checked"';
+ } else {
+ // Disabled
+ $content['refback_enabled_n'] = ' checked="checked"';
+ }
// Load template
loadTemplate('admin_config_refback', false, $content);
$content['payment_list'] = $OUT;
// Init a lot array elements
- foreach (array('company','position','tax_ident','gender_m','gender_f','gender_c','surname','family','street_nr1','street_nr2','country','zip','city','phone','fix','cell','email','url','rec_y','rec_n','form_errors','refid') as $entry) {
+ foreach (array('company','position','tax_ident','gender_m','gender_f','gender_c','surname','family','street_nr1','street_nr2','country','zip','city','phone','fix','cell','email','url','receive_warnings_y','receive_warnings_n','form_errors','refid') as $entry) {
$content[$entry] = '';
} // END - foreach
$content['gender_' . strtolower(postRequestParameter('gender'))] = ' selected="selected"';
// Init receive selection
- $content['rec_y'] = '';
- $content['rec_n'] = '';
+ $content['receive_warnings_y'] = '';
+ $content['receive_warnings_n'] = '';
// Check for receive_warnings
- $content['rec_' . strtolower(postRequestParameter('receive_warnings'))] = ' selected="selected"';
+ $content['receive_warnings_' . strtolower(postRequestParameter('receive_warnings'))] = ' selected="selected"';
$OUT = '';
// Errors found?
} elseif (!isMember()) {
// User is not logged in
redirectToIndexMemberOnlyModule();
-} elseif (getConfig('refback_enabled') != 'Y') {
+} elseif (!isRefbackEnabled()) {
// Output message
loadTemplate('admin_settings_saved', false, '{--MEMBER_REFBACK_DISABLED--}');
<td class="register_right {%template,ColorSwitch%}">$content[cat]</td>
<td width="20" class="guest_normal {%template,ColorSwitch%}">
{--YES--}
- <input type="radio" class="guest_normal" name="cat[$content[id]]" value="Y"$content[def_y] />
+ <input type="radio" class="guest_normal" name="cat[$content[id]]" value="Y"$content[default_yes] />
</td>
<td width="20" class="guest_normal {%template,ColorSwitch%}">
{--NO--}
- <input type="radio" class="guest_normal" name="cat[$content[id]]" value="N"$content[def_n] />
+ <input type="radio" class="guest_normal" name="cat[$content[id]]" value="N"$content[default_no] />
</td>
</tr>
</td>
<td>
<select name="receive_warnings" class="guest_select" size="1">
- <option value="Y"$content[rec_y]>{--YES--}</option>
- <option value="N"$content[rec_n]>{--NO--}</option>
+ <option value="Y"$content[receive_warnings_y]>{--YES--}</option>
+ <option value="N"$content[receive_warnings_n]>{--NO--}</option>
</select>
</td>
</tr>
<div class="member_input" style="padding-top:5px;padding-bottom:5px">
Soll die Anzahl Aufrufe begrenzt werden?<br />
- <input type="radio" id="limited_no" onfocus="return FocusLimitedNo()" name="limited" value="N"$content[limited_n] /> {--NO--}
- <input type="radio" id="limited_yes" onfocus="return FocusLimitedYes()" name="limited" value="Y"$content[limited_y] /> {--YES--}
+ <input type="radio" id="limited_no" onfocus="return FocusLimitedNo()" name="limited" value="N"$content[limited_no] /> {--NO--}
+ <input type="radio" id="limited_yes" onfocus="return FocusLimitedYes()" name="limited" value="Y"$content[limited_yes] /> {--YES--}
</div>
<div class="member_input bottom" style="padding-top:5px;padding-bottom:5px">