BioTorrents.de’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.

ajax_report.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. #declare(strict_types=1);
  3. /*
  4. * The backend to changing the report type when making a report.
  5. * It prints out the relevant report_messages from the array, then
  6. * prints the relevant report_fields and whether they're required.
  7. */
  8. authorize();
  9. ?>
  10. <ul>
  11. <?php
  12. $CategoryID = $_POST['categoryid'];
  13. if (array_key_exists($_POST['type'], $Types[$CategoryID])) {
  14. $ReportType = $Types[$CategoryID][$_POST['type']];
  15. } elseif (array_key_exists($_POST['type'], $Types['master'])) {
  16. $ReportType = $Types['master'][$_POST['type']];
  17. } else {
  18. echo 'HAX IN REPORT TYPE';
  19. error();
  20. }
  21. foreach ($ReportType['report_messages'] as $Message) {
  22. ?>
  23. <li><?=$Message?></li>
  24. <?php
  25. }
  26. ?>
  27. </ul>
  28. <br />
  29. <table class="layout" cellpadding="3" cellspacing="1" border="0" width="100%">
  30. <?php
  31. if (array_key_exists('image', $ReportType['report_fields'])) {
  32. ?>
  33. <tr>
  34. <td class="label">
  35. Image(s)<?=($ReportType['report_fields']['image'] === '1' ? ' <strong class="important_text">*</strong>' : '')?>
  36. </td>
  37. <td>
  38. <input id="image" type="text" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
  39. </td>
  40. </tr>
  41. <?php
  42. }
  43. if (array_key_exists('track', $ReportType['report_fields'])) {
  44. ?>
  45. <tr>
  46. <td class="label">
  47. Track Number(s)<?=($ReportType['report_fields']['track'] === '1' || $ReportType['report_fields']['track'] === '2' ? ' <strong class="important_text">*</strong>' : '')?>
  48. </td>
  49. <td>
  50. <input id="track" type="text" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" /><?=($ReportType['report_fields']['track'] === '1' ? '<input id="all_tracks" type="checkbox" onclick="AllTracks()" /> All' : '')?>
  51. </td>
  52. </tr>
  53. <?php
  54. }
  55. if (array_key_exists('link', $ReportType['report_fields'])) {
  56. ?>
  57. <tr>
  58. <td class="label">
  59. Link(s) to external source<?=($ReportType['report_fields']['link'] === '1' ? ' <strong class="important_text">*</strong>' : '')?>
  60. </td>
  61. <td>
  62. <input id="link" type="text" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
  63. </td>
  64. </tr>
  65. <?php
  66. }
  67. if (array_key_exists('sitelink', $ReportType['report_fields'])) {
  68. ?>
  69. <tr>
  70. <td class="label">
  71. Permalink to <strong>other relevant</strong> torrent(s)<?=($ReportType['report_fields']['sitelink'] === '1' ? ' <strong class="important_text">*</strong>' : '')?>
  72. </td>
  73. <td>
  74. <input id="sitelink" type="text" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
  75. </td>
  76. </tr>
  77. <?php
  78. }
  79. ?>
  80. <tr>
  81. <td class="label">
  82. Comments <strong class="important_text">*</strong>
  83. </td>
  84. <td>
  85. <textarea id="extra" rows="5" cols="60" name="extra"><?=display_str($_POST['extra'])?></textarea>
  86. </td>
  87. </tr>
  88. </table>