form_sanitizer($_POST['calc_b'], 512000, "calc_b") * form_sanitizer($_POST['calc_c'], 1, "calc_c"),
"download_types" => form_sanitizer($_POST['download_types'], '.pdf,.gif,.jpg,.png,.zip,.rar,.tar,.bz2,.7z', "download_types"),
"download_screen_max_w" => form_sanitizer($_POST['download_screen_max_w'], 1024, "download_screen_max_w"),
"download_screen_max_h" => form_sanitizer($_POST['download_screen_max_h'], 768, "download_screen_max_h"),
"download_screen_max_b" => form_sanitizer($_POST['calc_bb'], 153600, "calc_bb") * form_sanitizer($_POST['calc_cc'], 1, "calc_cc"),
"download_thumb_max_h" => form_sanitizer($_POST['download_thumb_max_h'], 100, 'download_thumb_max_h'),
"download_thumb_max_w" => form_sanitizer($_POST['download_thumb_max_w'], 100, 'download_thumb_max_w'),
"download_screenshot" => form_sanitizer($_POST['download_screenshot'], 0, 'download_screenshot'),
"download_stats" => form_sanitizer($_POST['download_stats'], 0, 'download_stats'),
"download_pagination" => form_sanitizer($_POST['download_pagination'], 15, 'download_pagination'),
"download_allow_submission" => form_sanitizer($_POST['download_allow_submission'], 0, "download_allow_submission"),
"download_screenshot_required" => isset($_POST['download_screenshot_required']) ? 1 : 0,
"download_extended_required" => isset($_POST['download_extended_required']) ? 1 : 0,
];
if (\defender::safe()) {
foreach ($StoreArray as $key => $value) {
$result = NULL;
if (\defender::safe()) {
$Array = ["settings_name" => $key, "settings_value" => $value, "settings_inf" => "downloads"];
dbquery_insert(DB_SETTINGS_INF, $Array, 'update', ["primary_key" => "settings_name"]);
}
}
addNotice('success', $locale['900']);
} else {
// send message your settings was not safe.
addNotice('danger', $locale['901']);
addNotice('danger', $locale['696']);
addNotice('danger', $locale['900']);
}
redirect(FUSION_SELF.$aidlink."§ion=download_settings");
}
$calc_opts = $locale['1020'];
$calc_c = calculate_byte($dl_settings['download_max_b']);
$calc_b = $dl_settings['download_max_b'] / $calc_c;
$calc_cc = calculate_byte($dl_settings['download_screen_max_b']);
$calc_bb = $dl_settings['download_screen_max_b'] / $calc_cc;
$choice_opts = ['1' => $locale['yes'], '0' => $locale['no']];
$mime = mimeTypes();
$mime_opts = [];
foreach ($mime as $m => $Mime) {
$ext = ".$m";
$mime_opts[$ext] = $ext;
}
echo "
".$locale['download_description']."
";
echo openform('settingsform', 'post', FUSION_REQUEST);
echo "\n
\n";
openside("");
echo form_text('download_pagination', $locale['download_939'], $dl_settings['download_pagination'], [
'max_length' => 4,
'type' => 'number',
'inline' => TRUE,
'inner_width' => '150px',
'width' => '150px'
]);
closeside();
openside('');
echo "
".form_text('download_screen_max_w', '', $dl_settings['download_screen_max_w'], [
'class' => 'pull-left',
'max_length' => 4,
'type' => 'number',
'width' => '150px'
])."
".form_text('download_screen_max_h', '', $dl_settings['download_screen_max_h'], [
'class' => 'pull-left',
'max_length' => 4,
'type' => 'number',
'width' => '150px'
])."
(".$locale['download_604'].")
\n
";
echo "
".form_text('download_thumb_max_w', '', $dl_settings['download_thumb_max_w'], [
'class' => 'pull-left',
'max_length' => 4,
'type' => 'number',
'width' => '150px'
])."
".form_text('download_thumb_max_h', '', $dl_settings['download_thumb_max_h'], [
'class' => 'pull-left',
'max_length' => 4,
'type' => 'number',
'width' => '150px'
])."
(".$locale['download_604'].")
";
echo "
".form_text('calc_b', '', $calc_b, [
'required' => TRUE,
'type' => 'number',
'inline' => TRUE,
'error_text' => $locale['error_rate'],
'width' => '100px',
'max_length' => 4,
'class' => 'pull-left m-r-10'
])."
".form_select('calc_c', '', $calc_c, [
'options' => $calc_opts,
'placeholder' => $locale['choose'],
'class' => 'pull-left',
'inner_width' => '100%',
'width' => '180px'
])."
";
echo "
".form_text('calc_bb', '', $calc_bb, [
'required' => TRUE,
'type' => 'number',
'error_text' => $locale['error_rate'],
'width' => '100px',
'max_length' => 4,
'class' => 'pull-left m-r-10'
])."
".form_select('calc_cc', '', $calc_cc, [
'options' => $calc_opts,
'placeholder' => $locale['choose'],
'class' => 'pull-left',
'inner_width' => '100%',
'width' => '180px'
])."
";
closeside();
openside('');
echo form_select('download_allow_submission', $locale['download_0046'], $dl_settings['download_allow_submission'], [
'inline' => TRUE, 'options' => [$locale['disable'], $locale['enable']]]);
echo form_checkbox('download_screenshot_required', $locale['download_0047'], $dl_settings['download_screenshot_required'], ['inline' => TRUE]);
echo form_checkbox('download_extended_required', $locale['download_0048'], $dl_settings['download_extended_required'], ['inline' => TRUE]);
closeside();
echo "
\n";
openside('');
echo form_select('download_screenshot', $locale['download_938'], $dl_settings['download_screenshot'], ['options' => $choice_opts]);
echo form_select('download_stats', $locale['download_940'], $dl_settings['download_stats'], ['options' => $choice_opts]);
closeside();
openside();
echo form_select('download_types[]', $locale['download_932'], $dl_settings['download_types'], [
'options' => $mime_opts,
'input_id' => 'dltype',
'error_text' => $locale['error_type'],
'placeholder' => $locale['choose'],
'multiple' => TRUE,
'tags' => TRUE,
'width' => '100%',
'delimiter' => '|'
]);
closeside();
echo "
\n
\n";
echo form_button('savesettings', $locale['750'], $locale['750'], ['class' => 'btn-success', 'icon' => 'fa fa-hdd-o']);
echo closeform();
add_to_jquery("
$('#shortdesc_display').show();
$('#calc_upload').bind('click', function() {
if ($('#calc_upload').attr('checked')) {
$('#download_filesize').attr('readonly', 'readonly');
$('#download_filesize').val('');
} else {
$('#download_filesize').removeAttr('readonly');
}
});
");