<?php
/************************************************************************
- * MXChange v0.2.1 Start: 02/12/2005 *
- * ================ Last change: 02/12/2005 *
+ * Mailer v0.2.1-FINAL Start: 02/12/2005 *
+ * =================== Last change: 02/12/2005 *
* *
* -------------------------------------------------------------------- *
* File : what-config_doubler.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 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
- require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Add description as navigation point
-ADD_DESCR('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
if (isFormSent()) {
- // Replace commata with decimal dot
- REQUEST_SET_POST('doubler_charge', convertCommaToDot((REQUEST_POST('doubler_charge') / 100)));
- REQUEST_SET_POST('doubler_ref' , convertCommaToDot((REQUEST_POST('doubler_ref') / 100)));
- REQUEST_SET_POST('doubler_min' , convertCommaToDot(REQUEST_POST('doubler_min')));
- REQUEST_SET_POST('doubler_max' , convertCommaToDot(REQUEST_POST('doubler_max')));
- REQUEST_SET_POST('doubler_left' , convertCommaToDot(REQUEST_POST('doubler_left')));
+ // Replace german decimal comma with computer decimal dot
+ convertCommaToDotInPostDataArray(array('doubler_charge', 'doubler_ref', 'doubler_min', 'doubler_max', 'doubler_left'));
// Save settings
- ADMIN_SAVE_SETTINGS_POST();
+ adminSaveSettingsFromPostData();
} else {
- // Prepare data for the template
- // - Charge rate
- define('__DOUBLER_CHARGE', translateComma((getConfig('doubler_charge') * 100), false));
- // - Referal rate
- define('__DOUBLER_REFERRAL', translateComma((getConfig('doubler_ref') * 100), false));
- // - Minimum points to double
- define('__DOUBLER_MINIMUM', translateComma(getConfig('doubler_min'), false));
- // - Maximum points to double
- define('__DOUBLER_MAXIMUM', translateComma(getConfig('doubler_max'), false));
- // - Points left on users account after doubling
- define('__DOUBLER_LEFT', translateComma(getConfig('doubler_left'), false));
- // - Max payouts to check per click/reset
- define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent'));
- // - Group sending
- define('__DOUBLER_GROUP_SENT', getConfig('doubler_group_sent'));
-
- // Take points from jackpot (Y/N)
- switch (getConfig('doubler_jackpot'))
- {
- case 'Y':
- define('__DOUBLER_JACKPOT_Y', ' checked="checked"');
- define('__DOUBLER_JACKPOT_N', '');
- break;
-
- case 'N':
- define('__DOUBLER_JACKPOT_Y', '');
- define('__DOUBLER_JACKPOT_N', ' checked="checked"');
- break;
- }
-
- // Take points from own account (Y/N)
- switch (getConfig('doubler_own'))
- {
- case 'Y':
- define('__DOUBLER_OWN_Y', ' checked="checked"');
- define('__DOUBLER_OWN_N', '');
- break;
-
- case 'N':
- define('__DOUBLER_OWN_Y', '');
- define('__DOUBLER_OWN_N', ' checked="checked"');
- break;
- }
-
- // Mail send mode
- switch (getConfig('doubler_send_mode'))
- {
- case 'DIRECT':
- define('__DOUBLER_SEND_DIRECT', ' checked="checked"');
- define('__DOUBLER_SEND_RESET' , '');
- break;
-
- case "RESET":
- define('__DOUBLER_SEND_DIRECT', '');
- define('__DOUBLER_SEND_RESET' , ' checked="checked"');
- break;
- }
-
- // Take points from own account (Y/N)
- switch (getConfig('doubler_sent_all'))
- {
- case 'Y':
- define('__DOUBLER_SENT_ALL_Y', ' checked="checked"');
- define('__DOUBLER_SENT_ALL_N', '');
- break;
+ // Init other selections
+ foreach (array('send_mode_direct','send_mode_reset') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
- case 'N':
- define('__DOUBLER_SENT_ALL_Y', '');
- define('__DOUBLER_SENT_ALL_N', ' checked="checked"');
- break;
- }
+ // Set current selections
+ foreach (array('send_mode') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
+ } // END - foreach
- // Transfer options (!!!) to __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, 'doubler_uid'));
+ // Transfer options
+ $content['doubler_userid'] = addMemberSelectionBox(getConfig('doubler_userid'), false, true, true, 'doubler_userid');
// Number of rows to display (option lines!!!)
- define('__DOUBLER_DISPLAY_NEW', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
- define('__DOUBLER_DISPLAY_PAY', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
- define('__DOUBLER_DISPLAY_OLD', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
+ foreach (array('new','pay','old') as $entry) {
+ $content['display_' . $entry] = generateOptionList(
+ '/ARRAY/',
+ array(
+ 5,
+ 10,
+ 20,
+ 30,
+ 40,
+ 50,
+ 100
+ ), array(
+ 5,
+ 10,
+ 20,
+ 30,
+ 40,
+ 50,
+ 100
+ ),
+ getConfig('doubler_display_' . $entry)
+ );
+ } // END - foreach
// Timeout selection box or input box?
- define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout') , 'doubler_timeout' , 'WDh'));
+ $content['timeout_selection'] = createConfigurationTimeSelections('doubler_timeout', 'WDh');
// Load template
- LOAD_TEMPLATE('admin_config_doubler');
+ loadTemplate('admin_config_doubler', false, $content);
}
-//
+// [EOF]
?>