Exemple #1
0
             $temp = $db->query_first("SELECT COUNT(*) AS `files` FROM " . TABLE_PREFIX . "dl_files");
             $db->query_write("UPDATE " . TABLE_PREFIX . "dl_main SET `files`=" . $db->sql_prepare($temp['files']));
             $dl->modify_filecount($_POST['category'], 1);
             $dl->update_counters();
             $vbulletin->url = './downloads.php?do=file&id=' . $id;
             // hook for post-upload checks
             ($hook = vBulletinHook::fetch_hook('dl_post_upload_add')) ? eval($hook) : false;
             eval(print_standard_redirect('ecdownloads_msg_file_added', true, true));
         } else {
             if (!isset($errors)) {
                 if (!isset($upload)) {
                     rename($dl->url . $file['url'], $dl->url . $newfilename);
                 }
                 if ($file['category'] != $_POST['category']) {
                     $dl->modify_filecount($_POST['category'], 1);
                     $dl->modify_filecount_delete($file['category'], -1);
                 }
                 $dl->update_counters();
                 $vbulletin->url = 'downloads.php?do=file&id=' . $_GET['id'];
                 // hook for post-upload checks
                 ($hook = vBulletinHook::fetch_hook('dl_post_upload_edit')) ? eval($hook) : false;
                 eval(print_standard_redirect('ecdownloads_msg_file_edited', true, true));
             }
         }
     }
 }
 if ($_GET['do'] == 'edit' and isset($file)) {
     $_POST = $file;
     $_POST['dname'] = $file['name'];
     $_POST['url'] = $vbulletin->input->clean($file['url'], TYPE_NOHTML);
 }