".$locale['download_0041']); if (iMEMBER && $dl_settings['download_allow_submission']) { $criteriaArray = [ "download_title" => "", "download_cat" => 0, "download_keywords" => "", "download_description_short" => "", "download_description" => "", "download_url" => "", "download_license" => "", "download_os" => "", "download_version" => "", "download_homepage" => "", "download_copyright" => "", ]; if (isset($_POST['submit_download'])) { $criteriaArray = [ 'download_title' => form_sanitizer($_POST['download_title'], '', 'download_title'), 'download_keywords' => form_sanitizer($_POST['download_keywords'], '', 'download_keywords'), 'download_description' => form_sanitizer($_POST['download_description'], '', 'download_description'), 'download_description_short' => form_sanitizer($_POST['download_description_short'], '', 'download_description_short'), 'download_cat' => form_sanitizer($_POST['download_cat'], '0', 'download_cat'), 'download_homepage' => form_sanitizer($_POST['download_homepage'], '', 'download_homepage'), 'download_license' => form_sanitizer($_POST['download_license'], '', 'download_license'), 'download_copyright' => form_sanitizer($_POST['download_copyright'], '', 'download_copyright'), 'download_os' => form_sanitizer($_POST['download_os'], '', 'download_os'), 'download_version' => form_sanitizer($_POST['download_version'], '', 'download_version'), 'download_file' => '', 'download_url' => '', 'download_image' => '', 'download_image_thumb' => '' ]; /** * Download File Section */ if (\defender::safe() && !empty($_FILES['download_file']['name']) && is_uploaded_file($_FILES['download_file']['tmp_name'])) { $upload = form_sanitizer($_FILES['download_file'], '', 'download_file'); $criteriaArray['download_filesize'] = parsebytesize($_FILES['download_file']['size']); if (empty($upload['error']) && !empty($_FILES['download_file']['size'])) { // might be image, might be file if (!empty($upload['image_name'])) { $criteriaArray['download_file'] = $upload['image_name']; } else if (!empty($upload['target_file'])) { $criteriaArray['download_file'] = $upload['target_file']; } else { \defender::stop(); addNotice('warning', $locale['download_0113']); } } unset($upload); } else if (!empty($_POST['download_url']) && empty($data['download_file'])) { $criteriaArray['download_url'] = form_sanitizer($_POST['download_url'], '', 'download_url'); } else if (empty($data['download_file']) && empty($data['download_url'])) { \defender::stop(); addNotice('danger', $locale['download_0111']); } // Screenshot submissions if (\defender::safe() && !empty($_FILES['download_image']['name']) && is_uploaded_file($_FILES['download_image']['tmp_name'])) { $upload = form_sanitizer($_FILES['download_image'], '', 'download_image'); if (empty($upload['error'])) { $criteriaArray['download_image'] = $upload['image_name']; $criteriaArray['download_image_thumb'] = $upload['thumb1_name']; unset($upload); } } else { if ($dl_settings['download_screenshot_required']) { \defender::stop(); \defender::setInputError("download_image"); } } if (defender::safe()) { $inputArray = [ 'submit_type' => 'd', 'submit_user' => $userdata['user_id'], 'submit_datestamp' => time(), 'submit_criteria' => serialize($criteriaArray) ]; dbquery_insert(DB_SUBMISSIONS, $inputArray, "save"); addNotice("success", $locale['download_0042']); redirect(clean_request("submitted=d", ["stype"], TRUE)); } } if (isset($_GET['submitted']) && $_GET['submitted'] == "d") { echo "
".$locale['download_0042']."
"; echo ""; echo "".str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['download_0039'])."
\n"; echo "