#29 Add additional fields to Other category torrents

Merged
spaghetti merged 1 commits from tricidious:other-creators into master 8 years ago

+ 24
- 0
classes/torrent_form.class.php View File

@@ -916,6 +916,30 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
916 916
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP'])?>" <?=$this->Disabled?>/></td>
917 917
       </tr>
918 918
 <? } ?>
919
+      <tr>
920
+        <td class="label">Creators/Authors (Optional):</td>
921
+        <td id="idolfields">
922
+      <?      if (!empty($Torrent['Artists'])) {
923
+          foreach ($Torrent['Artists'] as $Num => $Artist) { ?>
924
+            <input type="text" id="idols_<?=$Num?>" name="idols[]" size="45" value="<?=display_str($Artist['name'])?>" <?=$this->Disabled?> />
925
+            <? if ($Num == 0) { ?>
926
+              <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
927
+            <? }
928
+            }
929
+          } else { ?>
930
+            <input type="text" id="idols_0" name="idols[]" size="45" value="" <?=$this->Disabled?> />
931
+            <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
932
+      <?        } ?>
933
+        </td>
934
+      </tr>
935
+      <tr>
936
+        <td class="label">Publisher (Optional):</td>
937
+        <td><input type="text" id="studio" name="studio" size="60" value="<?=display_str($Torrent['Studio']) ?>" <?=$this->Disabled?>/></td>
938
+      </tr>
939
+      <tr>
940
+        <td class="label">DLsite ID:</td>
941
+        <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=display_str($Torrent['DLsiteID'])?>" <?=$this->Disabled?>/></td>
942
+      </tr>
919 943
       <tr>
920 944
         <td class="label">Censored?:</td>
921 945
         <td>

+ 0
- 4
sections/artist/artist.php View File

@@ -652,7 +652,6 @@ if ($NumRequests > 0) {
652 652
   foreach ($Requests as $RequestID => $Request) {
653 653
       $CategoryName = $Categories[$Request['CategoryID'] - 1];
654 654
       $Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? display_str($Request['TitleJP']) : display_str($Request['TitleRJ'])) : display_str($Request['Title']);
655
-      if ($CategoryName != 'Other') {
656 655
       $ArtistForm = Requests::get_artists($RequestID);
657 656
       $ArtistLink = Artists::display_artists($ArtistForm, true, true);
658 657
       $FullName = $ArtistLink."<a href=\"requests.php?action=view&amp;id=$RequestID\"><span dir=\"ltr\">$Title</span></a>";
@@ -663,9 +662,6 @@ if ($NumRequests > 0) {
663 662
       if ($Request['DLSiteID']) {
664 663
         $FullName.= " [$Request[DLSiteID]]";
665 664
       }
666
-      } else {
667
-        $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\" dir=\"ltr\">$Title</a>";
668
-      }
669 665
 
670 666
       if (!empty($Tags[$RequestID])) {
671 667
         $ReqTagList = [];

+ 0
- 2
sections/requests/new_edit.php View File

@@ -53,9 +53,7 @@ if (!$NewRequest) {
53 53
       error(403);
54 54
     }
55 55
 
56
-    if ($CategoryName != 'Other') {
57 56
     $ArtistForm = Requests::get_artists($RequestID);
58
-    }
59 57
 
60 58
     $Tags = implode(', ', $Request['Tags']);
61 59
   }

+ 3
- 12
sections/requests/request.php View File

@@ -30,7 +30,6 @@ if ($Request['CategoryID'] === '0') {
30 30
 $Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? $Request['TitleJP'] : $Request['TitleRJ']) : $Request['Title'];
31 31
 
32 32
 //Do we need to get artists?
33
-if ($CategoryName != 'Other') {
34 33
 $ArtistForm = Requests::get_artists($RequestID);
35 34
 $ArtistName = Artists::display_artists($ArtistForm, false, true);
36 35
 $ArtistLink = Artists::display_artists($ArtistForm, true, true);
@@ -43,15 +42,6 @@ if ($CategoryName != 'Other') {
43 42
 
44 43
 $FullName = $ArtistName.$Title;
45 44
 
46
-} else {
47
-  if ($IsFilled) {
48
-    $DisplayLink = "<a href=\"torrents.php?torrentid=$Request[TorrentID]\" dir=\"ltr\">$Title</a>";
49
-  } else {
50
-    $DisplayLink = "<span dir=\"ltr\">$Title</span>";
51
-  }
52
-  $FullName = $Title;
53
-}
54
-
55 45
 $Extra = "";
56 46
 
57 47
 if (!empty($Request['TitleRJ']) && $Request['TitleRJ'] != $Title) {
@@ -135,7 +125,6 @@ $encoded_artist = urlencode($encoded_artist);
135 125
     </div>
136 126
 <?
137 127
   }
138
-  if ($CategoryName != 'Other') {
139 128
   $ArtistVariant = "";
140 129
   switch ($CategoryName) {
141 130
     case "Movies":
@@ -150,6 +139,9 @@ $encoded_artist = urlencode($encoded_artist);
150 139
     case "Games":
151 140
       $ArtistVariant = "Developers";
152 141
       break;
142
+    case "Other":
143
+      $ArtistVariant = "Creators";
144
+      break;
153 145
     default:
154 146
       $ArtistVariant = "Artists";
155 147
   }
@@ -164,7 +156,6 @@ $encoded_artist = urlencode($encoded_artist);
164 156
 <?    } ?>
165 157
       </ul>
166 158
     </div>
167
-<?  } ?>
168 159
     <div class="box box_tags">
169 160
       <div class="head"><strong>Tags</strong></div>
170 161
       <ul class="stats nobullet">

+ 0
- 4
sections/requests/requests.php View File

@@ -493,7 +493,6 @@ View::show_header($Title, 'requests');
493 493
 
494 494
     $Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? $Request['TitleJP'] : $Request['TitleRJ']) : $Request['Title'];
495 495
 
496
-    if ($CategoryName != 'Other') {
497 496
     $ArtistForm = Requests::get_artists($RequestID);
498 497
     $ArtistLink = Artists::display_artists($ArtistForm, true, true);
499 498
     $FullName = "$ArtistLink<a href=\"requests.php?action=view&amp;id=$RequestID\"><span ";
@@ -514,9 +513,6 @@ View::show_header($Title, 'requests');
514 513
     if ($ExtraInfo) {
515 514
       $FullName .= " $ExtraInfo";
516 515
     }
517
-    } else {
518
-      $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\" dir=\"ltr\">$Title</a>";
519
-    }
520 516
     $Tags = $Request['Tags'];
521 517
 ?>
522 518
     <tr class="request">

+ 0
- 7
sections/requests/take_fill.php View File

@@ -89,7 +89,6 @@ if ($RequestCategoryID !== '0' && $TorrentCategoryID !== $RequestCategoryID) {
89 89
 
90 90
 $CategoryName = $Categories[$RequestCategoryID - 1];
91 91
 
92
-if ($CategoryName != 'Other') {
93 92
 if ($RequestCatalogueNumber) {
94 93
   if (str_replace('-', '', strtolower($TorrentCatalogueNumber)) !== str_replace('-', '', strtolower($RequestCatalogueNumber))) {
95 94
     $Err = "This request requires the catalogue number $RequestCatalogueNumber";
@@ -102,8 +101,6 @@ if ($CategoryName != 'Other') {
102 101
   }
103 102
 }
104 103
 
105
-}
106
-
107 104
 // Fill request
108 105
 if (!empty($Err)) {
109 106
   error($Err);
@@ -117,13 +114,9 @@ $DB->query("
117 114
     TimeFilled = '".sqltime()."'
118 115
   WHERE ID = $RequestID");
119 116
 
120
-if ($CategoryName != 'Other') {
121 117
 $ArtistForm = Requests::get_artists($RequestID);
122 118
 $ArtistName = Artists::display_artists($ArtistForm, false, true);
123 119
 $FullName = $ArtistName.$Title;
124
-} else {
125
-  $FullName = $Title;
126
-}
127 120
 
128 121
 $DB->query("
129 122
   SELECT UserID

+ 2
- 11
sections/requests/take_new_edit.php View File

@@ -106,8 +106,7 @@ if (empty($_POST['description'])) {
106 106
   $Description = trim($_POST['description']);
107 107
 }
108 108
 
109
-if ($CategoryName != 'Other') {
110
-  if (empty($_POST['artists'])) {
109
+if (empty($_POST['artists']) && $CategoryName != 'Other') {
111 110
   $Err = 'You did not enter any artists.';
112 111
 } else {
113 112
   $Artists = $_POST['artists'];
@@ -125,8 +124,6 @@ if ($CategoryName != 'Other') {
125 124
   $DLSiteID = '';
126 125
 }
127 126
 
128
-}
129
-
130 127
 // GroupID
131 128
 if (!empty($_POST['groupid'])) {
132 129
   $GroupID = $_POST['groupid'];
@@ -150,7 +147,6 @@ if (!empty($_POST['groupid'])) {
150 147
 }
151 148
 
152 149
 //For refilling on error
153
-if ($CategoryName != 'Other') {
154 150
 $ArtistNames = [];
155 151
 $ArtistForm = [];
156 152
 for ($i = 0; $i < count($Artists); $i++) {
@@ -164,7 +160,6 @@ if ($CategoryName != 'Other') {
164 160
 if (!isset($ArtistNames[0])) {
165 161
   unset($ArtistForm);
166 162
 }
167
-}
168 163
 
169 164
 if (!empty($Err)) {
170 165
   error($Err);
@@ -291,7 +286,7 @@ if ($GroupID) {
291 286
  * 2. For each artist that didn't exist, create an artist.
292 287
  * 3. Create a row in the requests_artists table for each artist, based on the ID.
293 288
  */
294
-if (isset($CategoryName) && $CategoryName != "Other" && isset($ArtistForm)) {
289
+if (isset($ArtistForm)) {
295 290
   foreach ($ArtistForm as $Num => $Artist) {
296 291
     //1. See if each artist given already exists and if it does, grab the ID.
297 292
     $DB->query("
@@ -416,11 +411,7 @@ if ($NewRequest) {
416 411
 
417 412
   $AnnounceTitle = empty($Title) ? (empty($TitleRJ) ? $TitleJP : $TitleRJ) : $Title;
418 413
 
419
-  if ($CategoryName != 'Other') {
420 414
   $Announce = "\"$AnnounceTitle\"".(isset($ArtistForm)?(' - '.Artists::display_artists($ArtistForm, false, false)):'').' '.site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
421
-  } else {
422
-    $Announce = "\"$AnnounceTitle\" - ".site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
423
-  }
424 415
   send_irc('PRIVMSG '.BOT_REQUEST_CHAN.' '.$Announce);
425 416
 
426 417
 } else {

+ 0
- 4
sections/requests/take_unfill.php View File

@@ -45,13 +45,9 @@ $DB->query("
45 45
 
46 46
 $CategoryName = $Categories[$CategoryID - 1];
47 47
 
48
-if ($CategoryName != 'Other') {
49 48
 $ArtistForm = Requests::get_artists($RequestID);
50 49
 $ArtistName = Artists::display_artists($ArtistForm, false, true);
51 50
 $FullName = $ArtistName.$Title;
52
-} else {
53
-  $FullName = $Title;
54
-}
55 51
 
56 52
 $RequestVotes = Requests::get_votes_array($RequestID);
57 53
 

+ 0
- 5
sections/torrents/details.php View File

@@ -243,10 +243,6 @@ $Index++;
243 243
 <?    } ?>
244 244
 
245 245
   </div>
246
-<?
247
-if ($Categories[$GroupCategoryID - 1] != 'Other') {
248
-  $ShownWith = false;
249
-?>
250 246
     <div class="box box_artists">
251 247
       <div class="head"><strong>Artists</strong>
252 248
       <?=check_perms('torrents_edit') ? '<span class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets float_right">Edit</a></span>' : ''?>
@@ -276,7 +272,6 @@ if ($Categories[$GroupCategoryID - 1] != 'Other') {
276 272
     </div>
277 273
 <?
278 274
     }
279
-  }
280 275
 ?>
281 276
     <div class="box box_tags">
282 277
       <div class="head">

+ 0
- 4
sections/torrents/user.php View File

@@ -506,11 +506,7 @@ foreach ($Categories as $CatKey => $CatName) {
506 506
 
507 507
     $TorrentTags = new Tags($TagList);
508 508
 
509
-    if ($Categories[$GroupCategoryID-1] != 'Other') {
510 509
     $DisplayName = Artists::display_artists($Artists);
511
-    } else {
512
-      $DisplayName = '';
513
-    }
514 510
     $DisplayName .= '<a href="torrents.php?id='.$GroupID.'&amp;torrentid='.$TorrentID.'" ';
515 511
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
516 512
       $DisplayName .= 'onmouseover="getCover(event)" data-cover="'.ImageTools::process($WikiImage).'" onmouseleave="ungetCover()" ';

+ 8
- 9
sections/upload/upload_handle.php View File

@@ -95,6 +95,10 @@ if ($Type == 'Movies' || $Type == 'Manga' || $Type == 'Anime' || $Type == 'Games
95 95
   } else {
96 96
     $Artists = $_POST['idols'];
97 97
   }
98
+} elseif ($Type == 'Other') {
99
+  if (!empty($_POST['idols'])) {
100
+    $Artists = $_POST['idols'];
101
+  }
98 102
 }
99 103
 
100 104
 if (!empty($_POST['requestid'])) {
@@ -193,7 +197,7 @@ if (!is_uploaded_file($TorrentName) || !filesize($TorrentName)) {
193 197
 //Multiple artists!
194 198
 
195 199
 $LogName = '';
196
-if (empty($Properties['GroupID']) && empty($ArtistForm) && ($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games')) {
200
+if (empty($Properties['GroupID']) && empty($ArtistForm)) {
197 201
   $ArtistNames = [];
198 202
   $ArtistForm = [];
199 203
   for ($i = 0; $i < count($Artists); $i++) {
@@ -205,7 +209,7 @@ if (empty($Properties['GroupID']) && empty($ArtistForm) && ($Type == 'Movies' ||
205 209
     }
206 210
   }
207 211
   $LogName .= Artists::display_artists($ArtistForm, false, true, false);
208
-} elseif (($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games') && empty($ArtistForm)) {
212
+} elseif (empty($ArtistForm)) {
209 213
   $DB->query("
210 214
     SELECT ta.ArtistID, ag.Name
211 215
     FROM torrents_artists AS ta
@@ -327,7 +331,6 @@ if (!preg_match('/^'.IMAGE_REGEX.'$/i', $Properties['Image'])) {
327 331
   $T['Image'] = "''";
328 332
 }
329 333
 
330
-if ($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games') {
331 334
 // Does it belong in a group?
332 335
 if ($Properties['GroupID']) {
333 336
   $DB->query("
@@ -408,7 +411,6 @@ if ($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games
408 411
     //}
409 412
   }
410 413
 }
411
-}
412 414
 
413 415
 //Needs to be here as it isn't set for add format until now
414 416
 $LogName .= $Properties['Title'];
@@ -417,7 +419,7 @@ $LogName .= $Properties['Title'];
417 419
 $IsNewGroup = !isset($GroupID) || !$GroupID;
418 420
 
419 421
 //----- Start inserts
420
-if ((!isset($GroupID) || !$GroupID) && ($Type != 'Other')) {
422
+if ((!isset($GroupID) || !$GroupID)) {
421 423
   //array to store which artists we have added already, to prevent adding an artist twice
422 424
   $ArtistsAdded = [];
423 425
   foreach ($ArtistForm as $Num => $Artist) {
@@ -454,7 +456,6 @@ if (!isset($GroupID) || !$GroupID) {
454 456
     VALUES
455 457
       ($TypeID, ".$T['Title'].", ".$T['TitleRJ'].", ".$T['TitleJP'].", ".$T['Year'].", ".$T['Series'].", ".$T['Studio'].", ".$T['CatalogueNumber'].", " . $T['Pages'] . ", '".sqltime()."', '".db_string($Body)."', ".$T['Image'].", ".$T['DLsiteID'].")");
456 458
   $GroupID = $DB->inserted_id();
457
-  if ($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games') {
458 459
   foreach ($ArtistForm as $Num => $Artist) {
459 460
     $DB->query("
460 461
       INSERT IGNORE INTO torrents_artists (GroupID, ArtistID, UserID)
@@ -462,7 +463,6 @@ if (!isset($GroupID) || !$GroupID) {
462 463
     $Cache->increment('stats_album_count');
463 464
     $Cache->delete_value('artist_groups_'.$Artist['id']);
464 465
   }
465
-  }
466 466
   $Cache->increment('stats_group_count');
467 467
 
468 468
   // Add screenshots
@@ -694,9 +694,8 @@ if (function_exists('fastcgi_finish_request')) {
694 694
 //--------------------------- IRC announce and feeds ---------------------------//
695 695
 $Announce = '';
696 696
 
697
-if ($Type != 'Other') {
698 697
 $Announce .= Artists::display_artists($ArtistForm, false);
699
-}
698
+
700 699
 $Announce .= empty($Properties['Title']) ? (empty($Properties['TitleRJ']) ? trim($Properties['TitleJP']) : trim($Properties['TitleRJ'])) : trim($Properties['Title']);
701 700
 $Announce .= ' ';
702 701
 if ($Type != 'Other') {

Loading…
Cancel
Save