Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get_extra_torrents.php 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?
  2. //extra torrent files
  3. $ExtraTorrents = array();
  4. $DupeNames = array();
  5. $DupeNames[] = $_FILES['file_input']['name'];
  6. if (isset($_POST['extra_format']) && isset($_POST['extra_bitrate'])) {
  7. for ($i = 1; $i <= 5; $i++) {
  8. if (isset($_FILES["extra_file_$i"])) {
  9. $ExtraFile = $_FILES["extra_file_$i"];
  10. $ExtraTorrentName = $ExtraFile['tmp_name'];
  11. if (!is_uploaded_file($ExtraTorrentName) || !filesize($ExtraTorrentName)) {
  12. $Err = 'No extra torrent file uploaded, or file is empty.';
  13. } elseif (substr(strtolower($ExtraFile['name']), strlen($ExtraFile['name']) - strlen('.torrent')) !== '.torrent') {
  14. $Err = 'You seem to have put something other than an extra torrent file into the upload field. (' . $ExtraFile['name'] . ').';
  15. } elseif (in_array($ExtraFile['name'], $DupeNames)) {
  16. $Err = 'One or more torrents has been entered into the form twice.';
  17. } else {
  18. $j = $i - 1;
  19. $ExtraTorrents[$ExtraTorrentName]['Name'] = $ExtraTorrentName;
  20. $ExtraFormat = $_POST['extra_format'][$j];
  21. if (empty($ExtraFormat)) {
  22. $Err = 'Missing format for extra torrent.';
  23. break;
  24. } else {
  25. $ExtraTorrents[$ExtraTorrentName]['Format'] = db_string(trim($ExtraFormat));
  26. }
  27. $ExtraBitrate = $_POST['extra_bitrate'][$j];
  28. if (empty($ExtraBitrate)) {
  29. $Err = 'Missing bitrate for extra torrent.';
  30. break;
  31. } else {
  32. $ExtraTorrents[$ExtraTorrentName]['Encoding'] = db_string(trim($ExtraBitrate));
  33. }
  34. $ExtraReleaseDescription = $_POST['extra_release_desc'][$j];
  35. $ExtraTorrents[$ExtraTorrentName]['TorrentDescription'] = db_string(trim($ExtraReleaseDescription));
  36. $DupeNames[] = $ExtraFile['name'];
  37. }
  38. }
  39. }
  40. }
  41. ?>