- // 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', ' chkecked="checked"');
- define('__DOUBLER_JACKPOT_N', '');
- break;
-
- case 'N':
- define('__DOUBLER_JACKPOT_Y', '');
- define('__DOUBLER_JACKPOT_N', ' chkecked="checked"');
- break;
- }
-
- // Take points from own account (Y/N)
- switch (getConfig('doubler_own'))
- {
- case 'Y':
- define('__DOUBLER_OWN_Y', ' chkecked="checked"');
- define('__DOUBLER_OWN_N', '');
- break;
-
- case 'N':
- define('__DOUBLER_OWN_Y', '');
- define('__DOUBLER_OWN_N', ' chkecked="checked"');
- break;
- }
-
- // Mail send mode
- switch (getConfig('doubler_send_mode'))
- {
- case "DIRECT":
- define('__DOUBLER_SEND_DIRECT', ' chkecked="checked"');
- define('__DOUBLER_SEND_RESET' , '');
- break;
-
- case "RESET":
- define('__DOUBLER_SEND_DIRECT', '');
- define('__DOUBLER_SEND_RESET' , ' chkecked="checked"');
- break;
- }
-
- // Take points from own account (Y/N)
- switch (getConfig('doubler_sent_all'))
- {
- case 'Y':
- define('__DOUBLER_SENT_ALL_Y', ' chkecked="checked"');
- define('__DOUBLER_SENT_ALL_N', '');
- break;
-
- case 'N':
- define('__DOUBLER_SENT_ALL_Y', '');
- define('__DOUBLER_SENT_ALL_N', ' chkecked="checked"');
- break;
- }
-
- // Transfer options (!!!) to __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
+ // Init all Y/N selections
+ foreach (array('jackpot','own','sent_all') as $entry) {
+ $content[$entry . '_y'] = '';
+ $content[$entry . '_n'] = '';
+ $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
+ } // END - foreach
+
+ // Init other selections
+ foreach (array('send_mode_direct','send_mode_reset') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
+
+ // Set current selections
+ foreach (array('send_mode') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
+ } // END - foreach
+
+ // Transfer options
+ $content['form_selection'] = addMemberSelectionBox(getConfig('doubler_userid'), false, true, true, 'doubler_userid');