<?php
/************************************************************************
- * MXChange v0.2.1 Start: 08/31/2004 *
- * ================ Last change: 11/14/2004 *
+ * Mailer v0.2.1-FINAL Start: 08/31/2004 *
+ * =================== Last change: 11/14/2004 *
* *
* -------------------------------------------------------------------- *
* File : what-config_bonus.php *
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
} // END - if
// Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
if (isFormSent()) {
- // Replace german decimal commas to computer decimal dots
- setRequestPostElement('login_bonus', convertCommaToDot(postRequestElement('login_bonus')));
- setRequestPostElement('turbo_bonus', convertCommaToDot(postRequestElement('turbo_bonus')));
- setRequestPostElement('bonus_ref', convertCommaToDot(postRequestElement('bonus_ref')));
- setRequestPostElement('bonus_order', convertCommaToDot(postRequestElement('bonus_order')));
- setRequestPostElement('bonus_notify_points', convertCommaToDot(postRequestElement('bonus_notify_points')));
+ // Replace german decimal comma with computer decimal dot
+ convertCommaToDotInPostDataArray(array('login_bonus', 'turbo_bonus', 'bonus_ref', 'bonus_order', 'bonus_notify_points'));
// Generate string for saving ranks
- setRequestPostElement('turbo_rates', '');
+ setPostRequestParameter('turbo_rates', '');
$RATES = array();
- foreach (postRequestElement('rate') as $rate) {
+ foreach (postRequestParameter('rate') as $rate) {
$rate = trim(convertCommaToDot($rate));
if (!empty($rate)) $RATES[] = $rate;
- }
- setRequestPostElement('turbo_rates', trim(implode(';', $RATES)));
- unsetPostRequestElement('rate');
+ } // END - foreach
+ setPostRequestParameter('turbo_rates', trim(implode(';', $RATES)));
+ unsetPostRequestParameter('rate');
// Automatically calculate bonus points for ranks 2 and 3 when not set
- if (!isPostRequestElementSet('turbo_rates')) setRequestPostElement('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+ if (!isPostRequestParameterSet('turbo_rates')) {
+ setPostRequestParameter('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+ } // END - if
// Save data
adminSaveSettingsFromPostData();
// Remember new settings
- setConfigEntry('bonus_active' , postRequestElement('bonus_active'));
- setConfigEntry('bonus_en_notify', postRequestElement('bonus_en_notify'));
- setConfigEntry('bonus_di_notify', postRequestElement('bonus_di_notify'));
+ setConfigEntry('bonus_active' , postRequestParameter('bonus_active'));
+ setConfigEntry('bonus_enable_notify' , postRequestParameter('bonus_enable_notify'));
+ setConfigEntry('bonus_disable_notify', postRequestParameter('bonus_disable_notify'));
} else {
- // Prepare contants for the template
- $content['login'] = translateComma(getConfig('login_bonus') , false);
- $content['turbo'] = translateComma(getConfig('turbo_bonus') , false);
- $content['order'] = translateComma(getConfig('bonus_order') , false);
- $content['ref'] = translateComma(getConfig('bonus_ref') , false);
- $content['stats'] = translateComma(getConfig('bonus_stats') , false);
- $content['notify'] = translateComma(getConfig('bonus_notify_points'), false);
-
// Transfer options to template
- $content['member_selection'] = addMemberSelectionBox(getConfig('bonus_userid'), false, true, true, 'bonus_userid');
+ $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), false, true, true, 'bonus_userid');
// Initialize array for the points list
- //die("*".getConfig('turbo_rates')."*");
$RANKS = explode(';', getConfig('turbo_rates'));
// Automatically calculate bonus points for ranks 2 and 3 when not set
if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
// Generate list
- $OUT = "<ol start=\"2\">\n";
- $cnt = 0;
+ $OUT = '<ol start="2">';
+ $count = '0';
foreach ($RANKS as $k => $rate) {
- if (!empty($rate)) {
+ if (!empty($rate)) {
// Print only when something is in
- $OUT .= " <li><input type=\"text\" name=\"rate[".($k + 2)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\" value=\"".$rate."\"> <div class=\"admin_notes\">({?POINTS?})</div?</li>\n";
+ $OUT .= '<li><input type="text" name="rate[' . ($k + 2) . ']" class="form_field" size="4" maxlength="7" value="' . $rate . '" /> <div class="notice">({?POINTS?})</div></li>';
} // END - if
- $cnt++;
+ $count++;
} // END - foreach
// Maxmium entries
$max = 10;
- if ($cnt >= 8) $max = $cnt+3;
+ if ($count >= 8) $max = $count+3;
// Add more empty fields
- for ($i = $cnt; $i < $max; $i++) {
- $OUT .= " <li><input type=\"text\" name=\"rate[".($i+2)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\" /> <div class=\"admin_notes\">({?POINTS?})</div></li>\n";
+ for ($i = $count; $i < $max; $i++) {
+ $OUT .= ' <li><input type="text" name="rate[' . ($i+2) . ']" class="form_field" size="4" maxlength="7" /> <div class="notice">({?POINTS?})</div></li>';
} // END - for
- $OUT .= "</ol>\n";
+ $OUT .= '</ol>';
$content['trates_list'] = $OUT;
// Selection boxes
- $content['login_timeout_selection'] = createTimeSelections(getConfig('login_timeout') , 'login_timeout' , 'WDh');
- $content['bonus_timeout_selection'] = createTimeSelections(getConfig('bonus_timeout') , 'bonus_timeout' , 'WDh');
- $content['wait_selection'] = createTimeSelections(getConfig('bonus_notify_wait'), 'bonus_notify_wait', 'ms' );
+ $content['login_timeout_selection'] = createConfigurationTimeSelections('login_timeout' , 'WDh');
+ $content['bonus_timeout_selection'] = createConfigurationTimeSelections('bonus_timeout' , 'WDh');
+ $content['wait_selection'] = createConfigurationTimeSelections('bonus_notify_wait', 'ms' );
// Init Y/N selections
- foreach (array('active','login_yn','stats_yn','order_yn','ref_yn','click_yn','en_notify','di_notify','new_mem_notify','include_own') as $entry) {
+ foreach (array('active','login_yn','stats_yn','order_yn','ref_yn','click_yn','enable_notify','disable_notify','new_member_notify','include_own') as $entry) {
$content[$entry . '_y'] = '';
$content[$entry . '_n'] = '';
$content[$entry . '_' . strtolower(getConfig('bonus_' . $entry))] = ' checked="checked"';