Browse Source

Bring up to date with Oppaitime's repo

pjc 5 years ago
parent
commit
323b2b1224

+ 7
- 1
classes/torrent_form.class.php View File

@@ -414,8 +414,14 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
414 414
 <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']??''), 60, 8); ?>
415 415
         </td>
416 416
       </tr>
417
+      <tr id="censored_tr">
418
+        <td class="label">Aligned Sequence?</td>
419
+        <td>
420
+          <input type="checkbox" name="censored" value="1" <?=(($Torrent['Censored'] ?? 0) ? 'checked ' : '')?>/>
421
+        </td>
422
+      </tr>
417 423
       <tr id="anon_tr">
418
-        <td class="label tooltip" title="Checking this will hide your username from other users on the torrent details page. Stats will still be attributed to you.">Upload Anonymously</td>
424
+        <td class="label tooltip" title="Checking this will hide your username from other users on the torrent details page. Stats will still be attributed to you.">Upload Anonymously?</td>
419 425
         <td><input type="checkbox" name="anonymous" value="1" <?=(($Torrent['Anonymous'] ?? false) ? 'checked ' : '')?>/></td>
420 426
       </tr>
421 427
     </table>

+ 1
- 3
classes/torrents.class.php View File

@@ -675,11 +675,9 @@ class Torrents {
675 675
     if (!empty($Data['Archive'])) {
676 676
       $Info[] = $Data['Archive'];
677 677
     }
678
-    /*
679 678
     if (isset($Data['Censored']) && !$Data['Censored']) {
680
-      $Info[] = $HTMLy ? Format::torrent_label('Uncensored') : 'Uncensored';
679
+      $Info[] = $HTMLy ? Format::torrent_label('Unaligned') : 'Unaligned';
681 680
     }
682
-    */
683 681
     if ($Data['IsLeeching']) {
684 682
       $Info[] = $HTMLy ? Format::torrent_label('Leeching') : 'Leeching';
685 683
     } else if ($Data['IsSeeding']) {

+ 1
- 1
gazelle.sql View File

@@ -1078,7 +1078,7 @@ CREATE TABLE `torrents` (
1078 1078
   `Language` varchar(20) DEFAULT NULL,
1079 1079
   `Censored` tinyint(1) NOT NULL DEFAULT '1',
1080 1080
   `Anonymous` tinyint(1) NOT NULL DEFAULT '0',
1081
-  `info_hash` blob NOT NULL DEFAULT NULL,
1081
+  `info_hash` blob NOT NULL,
1082 1082
   `FileCount` int(6) NOT NULL DEFAULT NULL,
1083 1083
   `FileList` mediumtext,
1084 1084
   `FilePath` varchar(255) NOT NULL DEFAULT '',

+ 3
- 3
sections/torrents/browse.php View File

@@ -254,9 +254,9 @@ View::show_header('Browse Torrents', 'browse');
254 254
               <option value="0"<?Format::selected('freetorrent', 0)?>>Normal</option>
255 255
             </select>
256 256
             <select name="censored" class="ft_censored fti_advanced">
257
-              <option value="">Original?</option>
258
-              <option value="1"<?Format::selected('censored', 1)?>>Original</option>
259
-              <option value="0"<?Format::selected('censored', 0)?>>Not Original</option>
257
+              <option value="">Aligned Sequence?</option>
258
+              <option value="1"<?Format::selected('censored', 1)?>>Aligned</option>
259
+              <option value="0"<?Format::selected('censored', 0)?>>Unaligned</option>
260 260
             </select>
261 261
           </td>
262 262
         </tr>

+ 1
- 1
sections/torrents/details.php View File

@@ -497,7 +497,7 @@ foreach ($TorrentList as $Torrent) {
497 497
     $ExtraInfo.=$AddExtra.'<strong class="torrent_label tl_reported tooltip" title="Type: '.ucfirst($Reports[0]['Type']).'<br>Comment: '.htmlentities(htmlentities($Reports[0]['UserComment'])).'">Reported</strong>';
498 498
     $AddExtra=' / ';
499 499
   }
500
-  #if (!$Censored) { $ExtraInfo .= $AddExtra.Format::torrent_label('Uncensored'); $AddExtra=' / '; }
500
+  if (!$Censored) { $ExtraInfo .= $AddExtra.Format::torrent_label('Unaligned'); $AddExtra=' / '; }
501 501
   if (!empty($BadTags)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Tags'); $AddExtra=' / '; }
502 502
   if (!empty($BadFolders)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Folders'); $AddExtra=' / '; }
503 503
   if (!empty($BadFiles)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad File Names'); $AddExtra=' / '; }

+ 3
- 3
sections/torrents/user.php View File

@@ -383,9 +383,9 @@ $Pages = Format::get_pages($Page, $TorrentCount, TORRENTS_PER_PAGE);
383 383
           <td class="label"><strong>Misc:</strong></td>
384 384
           <td class="nobr" colspan="3">
385 385
             <select name="censored" class="ft_censored">
386
-              <option value="3">Original?</option>
387
-              <option value="1"<?Format::selected('censored', 1)?>>Original</option>
388
-              <option value="0"<?Format::selected('censored', 0)?>>Not Original</option>
386
+              <option value="3">Aligned Sequence?</option>
387
+              <option value="1"<?Format::selected('censored', 1)?>>Aligned</option>
388
+              <option value="0"<?Format::selected('censored', 0)?>>Unaligned</option>
389 389
             </select>
390 390
           </td>
391 391
         </tr>

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

@@ -74,6 +74,7 @@ if (isset($_POST['release'])) {
74 74
 
75 75
 $Properties['GroupDescription'] = trim($_POST['album_desc']);
76 76
 $Properties['TorrentDescription'] = $_POST['release_desc'];
77
+$Properties['MediaInfo'] = '';
77 78
 #$Properties['MediaInfo'] = $_POST['mediainfo'];
78 79
 $Properties['Screenshots'] = isset($_POST['screenshots']) ? $_POST['screenshots'] : "";
79 80
 
@@ -81,6 +82,7 @@ if ($_POST['album_desc']) {
81 82
   $Properties['GroupDescription'] = trim($_POST['album_desc']);
82 83
 } elseif ($_POST['desc']) {
83 84
   $Properties['GroupDescription'] = trim($_POST['desc']);
85
+  $Properties['MediaInfo'] = '';
84 86
   #$Properties['MediaInfo'] = $_POST['mediainfo'];
85 87
 }
86 88
 
@@ -150,7 +152,7 @@ switch ($Type) {
150 152
 
151 153
     $Validate->SetFields('release_desc',
152 154
       '0','string','The release description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
153
-    */
155
+  */
154 156
 
155 157
   default:
156 158
     if (!isset($_POST['groupid']) || !$_POST['groupid']) {
@@ -375,20 +377,6 @@ if ((!isset($GroupID) || !$GroupID)) {
375 377
 if (!isset($GroupID) || !$GroupID) {
376 378
   // Create torrent group
377 379
   $DB->query("
378
-    INSERT INTO torrents_group
379
-      (CategoryID, Name, NameRJ, NameJP, Year,
380
-      Series, Studio, CatalogueNumber, Pages, Time,
381
-      WikiBody, WikiImage)
382
-    VALUES
383
-      ( ?, ?, ?, ?, ?,
384
-        ?, ?, ?, ?, NOW(),
385
-        ?, ? )",
386
-    $TypeID, $T['Title'], $T['TitleRJ'], $T['TitleJP'], $T['Year'],
387
-    $T['Series'], $T['Studio'], $T['CatalogueNumber'], $T['Pages'],
388
-    $Body, $T['Image']);
389
-
390
-    /* Original DB query
391
-      $DB->query("
392 380
     INSERT INTO torrents_group
393 381
       (CategoryID, Name, NameRJ, NameJP, Year,
394 382
       Series, Studio, CatalogueNumber, Pages, Time,
@@ -400,8 +388,6 @@ if (!isset($GroupID) || !$GroupID) {
400 388
     $TypeID, $T['Title'], $T['TitleRJ'], $T['TitleJP'], $T['Year'],
401 389
     $T['Series'], $T['Studio'], $T['CatalogueNumber'], $T['Pages'],
402 390
     $Body, $T['Image'], $T['DLsiteID']);
403
-    */
404
-
405 391
   $GroupID = $DB->inserted_id();
406 392
   foreach ($ArtistForm as $Num => $Artist) {
407 393
     $DB->query("
@@ -512,20 +498,6 @@ if (($Type == 'Movies' || $Type == 'Anime') && ($T['Container'] == 'ISO' || $T['
512 498
 
513 499
 // Torrent
514 500
 $DB->query("
515
-  INSERT INTO torrents
516
-    (GroupID, UserID, Media, Container, Codec, Resolution,
517
-    Anonymous, Archive, info_hash, FileCount, FileList, FilePath, Size, Time,
518
-    Description, FreeTorrent, FreeLeechType)
519
-  VALUES
520
-    ( ?, ?, ?, ?, ?, ?,
521
-      ?, ?, ?, ?, ?, ?, ?, NOW(),
522
-      ?, ?, ? )",
523
-  $GroupID, $LoggedUser['ID'], $T['Media'], $T['Container'], $T['Codec'], $T['Resolution'],
524
-  $T['Anonymous'], $T['Archive'], $InfoHash, $NumFiles, $FileString, $FilePath, $TotalSize,
525
-  $T['TorrentDescription'], $T['FreeTorrent'], $T['FreeLeechType']);
526
-
527
-  /* Original DB query
528
-  $DB->query("
529 501
   INSERT INTO torrents
530 502
     (GroupID, UserID, Media, Container, Codec, Resolution,
531 503
     AudioFormat, Subbing, Language, Subber, Censored,
@@ -540,28 +512,17 @@ $DB->query("
540 512
   $T['AudioFormat'], $T['Subbing'], $T['Language'], $T['Subber'], $T['Censored'],
541 513
   $T['Anonymous'], $T['Archive'], $InfoHash, $NumFiles, $FileString, $FilePath, $TotalSize,
542 514
   $T['TorrentDescription'], $T['MediaInfo'], $T['FreeTorrent'], $T['FreeLeechType']);
543
-  */
544 515
 
545 516
 $Cache->increment('stats_torrent_count');
546 517
 $TorrentID = $DB->inserted_id();
547 518
 $Tor->Dec['comment'] = 'https://'.SITE_DOMAIN.'/torrents.php?torrentid='.$TorrentID;
548 519
 
549
-# Mitigate $TorrentID = 0 bug on some uploads
550
-# @todo Investigate this further and properly fix
551
-if ($TorrentID !== 0) {
552
-  Tracker::update_tracker('add_torrent', [
553
-    'id'          => $TorrentID,
554
-    'info_hash'   => rawurlencode($InfoHash),
555
-    'freetorrent' => $T['FreeTorrent']
556
-  ]);
557
-  $Debug->set_flag('upload: ocelot updated');
558
-} else {
559
-  $TorrentID_debug = $DB->query("
560
-    SELECT MAX(ID) FROM torrents
561
-  ");
562
-  var_dump($TorrentID_debug);
563
-  error(0);
564
-}
520
+Tracker::update_tracker('add_torrent', [
521
+  'id'          => $TorrentID,
522
+  'info_hash'   => rawurlencode($InfoHash),
523
+  'freetorrent' => $T['FreeTorrent']
524
+]);
525
+$Debug->set_flag('upload: ocelot updated');
565 526
 
566 527
 // Prevent deletion of this torrent until the rest of the upload process is done
567 528
 // (expire the key after 10 minutes to prevent locking it for too long in case there's a fatal error below)

+ 0
- 14
static/styles/beluga/style.css View File

@@ -55,20 +55,6 @@
55 55
   letter-spacing: -2px;
56 56
 }
57 57
 .group .cats_other { background-color: #4DC593; }
58
-/* Unused categories
59
-.cats_audio:after {
60
-  content: "AUD";
61
-  color: #77C5D4;
62
-  font-size: 18px;
63
-}
64
-.group .cats_audio { background-color: #77C5D4; }
65
-.cats_other:after {
66
-  content: "OTH";
67
-  color: #0D5968;
68
-  font-size: 19px;
69
-}
70
-.group .cats_other { background-color: #0D5968; }
71
-*/
72 58
 
73 59
 body {
74 60
   width: 100%;

+ 0
- 6
static/styles/kuro/style.css View File

@@ -5,14 +5,8 @@
5 5
 .cats_rna { width: 36px; height: 36px; background: url('/static/common/caticons/rna.png') no-repeat center center; }
6 6
 .cats_protein { width: 36px; height: 36px; background: url('/static/common/caticons/protein.png') no-repeat center center; }
7 7
 .cats_other { width: 36px; height: 36px; background: url('/static/common/caticons/other.png') no-repeat center center; }
8
-/* Unused categories
9
-.cats_ebooks { width: 28px; height: 28px; background: url('images/ebook.png') no-repeat center center; }
10
-.cats_elearningvideos { width: 28px; height: 28px; background: url('images/elearning.png') no-repeat center center; }
11
-.cats_music { width: 28px; height: 28px; background: url('images/music.png') no-repeat center center; }
12
-*/
13 8
 
14 9
 /* Global */
15
-
16 10
 * {
17 11
   padding: 0em;
18 12
   margin: 0em;

+ 0
- 5
static/styles/oppai/style.css View File

@@ -9,11 +9,6 @@
9 9
 .cats_rna { width: 36px; height: 36px; background: url('/static/common/caticons/rna.png') no-repeat center center; }
10 10
 .cats_protein { width: 36px; height: 36px; background: url('/static/common/caticons/protein.png') no-repeat center center; }
11 11
 .cats_other { width: 36px; height: 36px; background: url('/static/common/caticons/other.png') no-repeat center center; }
12
-/* Unused categories
13
-.cats_ebooks { width: 28px; height: 28px; background: url('images/ebook.png') no-repeat center center; }
14
-.cats_elearningvideos { width: 28px; height: 28px; background: url('images/elearning.png') no-repeat center center; }
15
-.cats_music { width: 28px; height: 28px; background: url('images/music.png') no-repeat center center; }
16
-*/
17 12
 
18 13
 /* Global */
19 14
 * {

Loading…
Cancel
Save