************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
if (isset($_POST['ok'])) {
// Replace commata with decimal dot
- $_POST['doubler_charge'] = str_replace(",", ".", ($_POST['doubler_charge'] / 100));
- $_POST['doubler_ref'] = str_replace(",", ".", ($_POST['doubler_ref'] / 100));
- $_POST['doubler_min'] = str_replace(",", ".", $_POST['doubler_min']);
- $_POST['doubler_max'] = str_replace(",", ".", $_POST['doubler_max']);
- $_POST['doubler_left'] = str_replace(",", ".", $_POST['doubler_left']);
+ $_POST['doubler_charge'] = REVERT_COMMA(($_POST['doubler_charge'] / 100));
+ $_POST['doubler_ref'] = REVERT_COMMA(($_POST['doubler_ref'] / 100));
+ $_POST['doubler_min'] = REVERT_COMMA($_POST['doubler_min']);
+ $_POST['doubler_max'] = REVERT_COMMA($_POST['doubler_max']);
+ $_POST['doubler_left'] = REVERT_COMMA($_POST['doubler_left']);
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data for the template
// - Charge rate
- define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false));
- // - Referral rate
- define('__DOUBLER_REFERRAL', TRANSLATE_COMMA(($_CONFIG['doubler_ref'] * 100), false));
+ define('__DOUBLER_CHARGE', TRANSLATE_COMMA((getConfig('doubler_charge') * 100), false));
+ // - Referal rate
+ define('__DOUBLER_REFERRAL', TRANSLATE_COMMA((getConfig('doubler_ref') * 100), false));
// - Minimum points to double
- define('__DOUBLER_MINIMUM', TRANSLATE_COMMA($_CONFIG['doubler_min'], false));
+ define('__DOUBLER_MINIMUM', TRANSLATE_COMMA(getConfig('doubler_min'), false));
// - Maximum points to double
- define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA($_CONFIG['doubler_max'], false));
+ define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA(getConfig('doubler_max'), false));
// - Points left on users account after doubling
- define('__DOUBLER_LEFT', TRANSLATE_COMMA($_CONFIG['doubler_left'], false));
+ define('__DOUBLER_LEFT', TRANSLATE_COMMA(getConfig('doubler_left'), false));
// - Max payouts to check per click/reset
- define('__DOUBLER_MAX_SENT', $_CONFIG['doubler_max_sent']);
+ define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent'));
// - Group sending
- define('__DOUBLER_GROUP_SENT', $_CONFIG['doubler_group_sent']);
+ define('__DOUBLER_GROUP_SENT', getConfig('doubler_group_sent'));
// Take points from jackpot (Y/N)
- switch ($_CONFIG['doubler_jackpot'])
+ switch (getConfig('doubler_jackpot'))
{
- case 'Y':
- define('__DOUBLER_JACKPOT_Y', ' checked');
+ case "Y":
+ define('__DOUBLER_JACKPOT_Y', " checked=\"checked\"");
define('__DOUBLER_JACKPOT_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_JACKPOT_Y', "");
- define('__DOUBLER_JACKPOT_N', ' checked');
+ define('__DOUBLER_JACKPOT_N', " checked=\"checked\"");
break;
}
// Take points from own account (Y/N)
- switch ($_CONFIG['doubler_own'])
+ switch (getConfig('doubler_own'))
{
- case 'Y':
- define('__DOUBLER_OWN_Y', ' checked');
+ case "Y":
+ define('__DOUBLER_OWN_Y', " checked=\"checked\"");
define('__DOUBLER_OWN_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_OWN_Y', "");
- define('__DOUBLER_OWN_N', ' checked');
+ define('__DOUBLER_OWN_N', " checked=\"checked\"");
break;
}
// Mail send mode
- switch ($_CONFIG['doubler_send_mode'])
+ switch (getConfig('doubler_send_mode'))
{
case "DIRECT":
- define('__DOUBLER_SEND_DIRECT', ' checked');
+ define('__DOUBLER_SEND_DIRECT', " checked=\"checked\"");
define('__DOUBLER_SEND_RESET' , "");
break;
case "RESET":
define('__DOUBLER_SEND_DIRECT', "");
- define('__DOUBLER_SEND_RESET' , ' checked');
+ define('__DOUBLER_SEND_RESET' , " checked=\"checked\"");
break;
}
// Take points from own account (Y/N)
- switch ($_CONFIG['doubler_sent_all'])
+ switch (getConfig('doubler_sent_all'))
{
- case 'Y':
- define('__DOUBLER_SENT_ALL_Y', ' checked');
+ case "Y":
+ define('__DOUBLER_SENT_ALL_Y', " checked=\"checked\"");
define('__DOUBLER_SENT_ALL_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_SENT_ALL_Y', "");
- define('__DOUBLER_SENT_ALL_N', ' checked');
+ define('__DOUBLER_SENT_ALL_N', " checked=\"checked\"");
break;
}
// Transfer options (!!!) to __MEMBER_SELECTION
- ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true);
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
// Number of rows to display (option lines!!!)
- define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new']));
- define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_pay']));
- define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_old']));
+ define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/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', ADD_OPTION_LINES("/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', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
// Timeout selection box or input box?
- define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['doubler_timeout'] , "doubler_timeout" , "WDh"));
+ define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('doubler_timeout') , "doubler_timeout" , "WDh"));
// Load template
LOAD_TEMPLATE("admin_config_doubler");