Browse Source

Add Romaji titles

spaghetti 8 years ago
parent
commit
7336fb839c

+ 1
- 0
classes/requests.class.php View File

@@ -94,6 +94,7 @@ class Requests {
94 94
           LastVote,
95 95
           CategoryID,
96 96
           Title,
97
+          TitleRJ,
97 98
           TitleJP,
98 99
           Image,
99 100
           Description,

+ 2
- 1
classes/text.class.php View File

@@ -736,7 +736,8 @@ class Text {
736 736
                 if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
737 737
                   $Str .= " onmouseover=\"getCover(event)\" cover=\"".ImageTools::process($Group['WikiImage'], true)."\" onmouseleave=\"ungetCover(event)\"";
738 738
                 }
739
-                $Str .= '>'.$Group['Name'].'</a>';
739
+                $Name = empty($Group['Name']) ? (empty($Group['NameRJ']) ? $Group['NameJP'] : $Group['NameRJ']) : $Group['Name'];
740
+                $Str .= '>'.$Name.'</a>';
740 741
               } else {
741 742
                 $Str .= '[torrent]'.str_replace('[inlineurl]', '', $Block['Val']).'[/torrent]';
742 743
               }

+ 29
- 9
classes/torrent_form.class.php View File

@@ -216,10 +216,14 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
216 216
         </td>
217 217
       </tr>
218 218
       <tr id="title_tr">
219
-        <td class="label">Title:</td>
219
+        <td class="label">English Title:</td>
220 220
         <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?>/></td>
221 221
       </tr>
222
-      <tr>
222
+      <tr id="title_rj_tr">
223
+        <td class="label">Romaji Title:</td>
224
+        <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
225
+      </tr>
226
+      <tr id="title_jp_tr">
223 227
         <td class="label">Japanese Title:</td>
224 228
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
225 229
       </tr>
@@ -474,10 +478,14 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
474 478
         </td>
475 479
       </tr>
476 480
       <tr id="title_tr">
477
-        <td class="label">Title:</td>
481
+        <td class="label">English Title:</td>
478 482
         <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?>/></td>
479 483
       </tr>
480
-      <tr>
484
+      <tr id="title_rj_tr">
485
+        <td class="label">Romaji Title:</td>
486
+        <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
487
+      </tr>
488
+      <tr id="title_jp_tr">
481 489
         <td class="label">Japanese Title:</td>
482 490
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
483 491
       </tr>
@@ -723,10 +731,14 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
723 731
         </td>
724 732
       </tr>
725 733
       <tr id="title_tr">
726
-        <td class="label">Title:</td>
734
+        <td class="label">English Title:</td>
727 735
         <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?> /></td>
728 736
       </tr>
729
-      <tr>
737
+      <tr id="title_rj_tr">
738
+        <td class="label">Romaji Title:</td>
739
+        <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
740
+      </tr>
741
+      <tr id="title_jp_tr">
730 742
         <td class="label">Japanese Title:</td>
731 743
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP']) ?>" <?=$this->Disabled?>/></td>
732 744
       </tr>
@@ -895,7 +907,11 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
895 907
         <td class="label">Title:</td>
896 908
         <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title']) ?>" <?=$this->Disabled?> /></td>
897 909
       </tr>
898
-      <tr>
910
+      <tr id="title_rj_tr">
911
+        <td class="label">Romaji Title:</td>
912
+        <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
913
+      </tr>
914
+      <tr id="title_jp_tr">
899 915
         <td class="label">Japanese Title:</td>
900 916
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP'])?>" <?=$this->Disabled?>/></td>
901 917
       </tr>
@@ -961,10 +977,14 @@ new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDesc
961 977
 ?>    <table cellpadding="3" cellspacing="1" border="0" class="layout slice" width="100%">
962 978
 <?    if ($this->NewTorrent) { ?>
963 979
       <tr id="title_tr">
964
-        <td class="label">Title:</td>
980
+        <td class="label">English Title:</td>
965 981
         <td><input type="text" id="title" name="title" size="60" value="<?=display_str($Torrent['Title'])?>" <?=$this->Disabled?> /></td>
966 982
       </tr>
967
-      <tr>
983
+      <tr id="title_rj_tr">
984
+        <td class="label">Romaji Title:</td>
985
+        <td><input type="text" id="title_rj" name="title_rj" size="60" value="<?=display_str($Torrent['TitleRJ']) ?>" <?=$this->Disabled?>/></td>
986
+      </tr>
987
+      <tr id="title_jp_tr">
968 988
         <td class="label">Japanese Title:</td>
969 989
         <td><input type="text" id="title_jp" name="title_jp" size="60" value="<?=display_str($Torrent['TitleJP'])?>" <?=$this->Disabled?> /></td>
970 990
       </tr>

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

@@ -81,7 +81,7 @@ class Torrents {
81 81
       $QueryID = G::$DB->get_query_id();
82 82
       G::$DB->query("
83 83
         SELECT
84
-          ID, Name, Year, CatalogueNumber, Pages, Studio, Series, DLSiteID, TagList, WikiImage, CategoryID
84
+          ID, Name, NameRJ, NameJP, Year, CatalogueNumber, Pages, Studio, Series, DLSiteID, TagList, WikiImage, CategoryID
85 85
         FROM torrents_group
86 86
         WHERE ID IN ($IDs)");
87 87
 
@@ -177,6 +177,8 @@ class Torrents {
177 177
     return array(
178 178
       'GroupID' => $Group['ID'],
179 179
       'GroupName' => $Group['Name'],
180
+      'GroupNameRJ' => $Group['NameRJ'],
181
+      'GroupNameJP' => $Group['NameJP'],
180 182
       'GroupYear' => $Group['Year'],
181 183
       'GroupCategoryID' => $Group['CategoryID'],
182 184
       'GroupCatalogueNumber' => $Group['CatalogueNumber'],

+ 4
- 1
classes/torrentsearch.class.php View File

@@ -51,7 +51,9 @@ class TorrentSearch {
51 51
     'dlsiteid' => 1,
52 52
     'filelist' => 1,
53 53
     'groupname' => 1,
54
+    'groupnamerj' => 1,
54 55
     'groupnamejp' => 1,
56
+    'advgroupname' => 1,
55 57
     'language' => 1,
56 58
     'media' => 1,
57 59
     'resolution' => 1,
@@ -74,7 +76,8 @@ class TorrentSearch {
74 76
 
75 77
   // Some form field names don't match the ones in the index
76 78
   private static $FormsToFields = array(
77
-    'searchstr' => '(groupname,groupnamejp,artistname,studio,series,dlsiteid,cataloguenumber,yearfulltext)');
79
+    'searchstr' => '(groupname,groupnamerj,groupnamejp,artistname,studio,series,dlsiteid,cataloguenumber,yearfulltext)',
80
+    'advgroupname' => '(groupname,groupnamerj,groupnamejp)');
78 81
 
79 82
   // Specify the operator type to use for fields. Empty key sets the default
80 83
   private static $FieldOperators = array(

+ 7
- 1
sections/artist/artist.php View File

@@ -77,6 +77,7 @@ if (empty($LoggedUser['DisableRequests'])) {
77 77
         r.ID,
78 78
         r.CategoryID,
79 79
         r.Title,
80
+        r.TitleRJ,
80 81
         r.TitleJP,
81 82
         r.CatalogueNumber,
82 83
         r.DLSiteID,
@@ -212,6 +213,9 @@ foreach ($TorrentList as $Group) {
212 213
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
213 214
       $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover()" ';
214 215
     }
216
+
217
+    $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
218
+
215 219
     $DisplayName .= "dir=\"ltr\">$GroupName</a>";
216 220
 
217 221
     if ($GroupYear) {
@@ -312,6 +316,8 @@ foreach ($TorrentList as $Group) {
312 316
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
313 317
       $DisplayName .= "onmouseover=\"getCover(event)\" cover=\"".ImageTools::process($WikiImage, true)."\" onmouseleave=\"ungetCover(event)\" ";
314 318
     }
319
+
320
+    $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
315 321
     $DisplayName .= "dir=\"ltr\">$GroupName</a>";
316 322
 
317 323
     if ($GroupYear) {
@@ -713,7 +719,7 @@ if ($NumRequests > 0) {
713 719
   $Tags = Requests::get_tags(array_keys($Requests));
714 720
   foreach ($Requests as $RequestID => $Request) {
715 721
       $CategoryName = $Categories[$Request['CategoryID'] - 1];
716
-      $Title = display_str($Request['Title']);
722
+      $Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? display_str($Request['TitleJP']) : display_str($Request['TitleRJ'])) : display_str($Request['Title']);
717 723
       if ($CategoryName != 'Other') {
718 724
         $ArtistForm = Requests::get_artists($RequestID);
719 725
         $ArtistLink = Artists::display_artists($ArtistForm, true, true);

+ 2
- 0
sections/bookmarks/torrents.php View File

@@ -72,6 +72,8 @@ foreach ($GroupIDs as $GroupID) {
72 72
 
73 73
   $DisplayName = Artists::display_artists($Artists);
74 74
 
75
+  $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
76
+
75 77
   $DisplayName .= '<a href="torrents.php?id='.$GroupID.'" class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
76 78
   if ($GroupYear > 0) {
77 79
     $DisplayName = "$DisplayName [$GroupYear]";

+ 1
- 0
sections/collages/torrent_collage.php View File

@@ -74,6 +74,7 @@ foreach ($GroupIDs as $GroupID) {
74 74
   if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
75 75
     $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover(event)" ';
76 76
   }
77
+  $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
77 78
   $DisplayName .= "dir=\"ltr\">$GroupName</a>";
78 79
   if ($GroupYear > 0) {
79 80
     $DisplayName = "$DisplayName [$GroupYear]";

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

@@ -33,6 +33,7 @@ if (!$NewRequest) {
33 33
     // Define these variables to simplify _GET['groupid'] requests later on
34 34
     $CategoryID = $Request['CategoryID'];
35 35
     $Title = $Request['Title'];
36
+    $TitleRJ = $Request['TitleRJ'];
36 37
     $TitleJP = $Request['TitleJP'];
37 38
     $CatalogueNumber = $Request['CatalogueNumber'];
38 39
     $DLsiteID = $Request['DLsiteID'];
@@ -75,6 +76,7 @@ if ($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
75 76
   $DB->query("
76 77
     SELECT
77 78
       tg.Name,
79
+      tg.NameRJ,
78 80
       tg.NameJP,
79 81
       tg.Year,
80 82
       tg.Studio,
@@ -88,7 +90,7 @@ if ($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
88 90
       JOIN torrents_tags AS tt ON tt.GroupID = tg.ID
89 91
       JOIN tags AS t ON t.ID = tt.TagID
90 92
     WHERE tg.ID = ".$_GET['groupid']);
91
-  if (list($Title, $TitleJP, $Year, $Studio, $Series, $CatalogueNumber, $DLsiteID, $Image, $Tags, $CategoryID) = $DB->next_record()) {
93
+  if (list($Title, $TitleRJ, $TitleJP, $Year, $Studio, $Series, $CatalogueNumber, $DLsiteID, $Image, $Tags, $CategoryID) = $DB->next_record()) {
92 94
     $GroupID = trim($_REQUEST['groupid']);
93 95
     $CategoryName = $Categories[$CategoryID - 1];
94 96
     $Disabled = 'readonly="readonly"';
@@ -173,10 +175,16 @@ View::show_header(($NewRequest ? 'Create a request' : 'Edit a request'), 'reques
173 175
             <input type="text" id="title" name="title" size="45" value="<?=(!empty($Title) ? $Title : '')?>" <?=$Disabled?>/>
174 176
           </td>
175 177
         </tr>
178
+        <tr>
179
+          <td class="label">Romaji Title</td>
180
+          <td>
181
+            <input type="text" id="title_rj" name="title_rj" size="45" value="<?=(!empty($TitleRJ) ? $TitleRJ : '')?>" <?=$Disabled?>/>
182
+          </td>
183
+        </tr>
176 184
         <tr>
177 185
           <td class="label">Japanese Title</td>
178 186
           <td>
179
-            <input type="text" id="title_jp" name="title_jp" size="45" value="<?=isset($TitleJP)?$TitleJP:''?>" <?=$Disabled?>/>
187
+            <input type="text" id="title_jp" name="title_jp" size="45" value="<?=!empty($TitleJP)?$TitleJP:''?>" <?=$Disabled?>/>
180 188
           </td>
181 189
         </tr>
182 190
         <tr id="dlsiteid_tr">

+ 17
- 7
sections/requests/request.php View File

@@ -27,6 +27,8 @@ if ($Request['CategoryID'] === '0') {
27 27
   $CategoryName = $Categories[$Request['CategoryID'] - 1];
28 28
 }
29 29
 
30
+$Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? $Request['TitleJP'] : $Request['TitleRJ']) : $Request['Title'];
31
+
30 32
 //Do we need to get artists?
31 33
 if ($CategoryName != 'Other') {
32 34
   $ArtistForm = Requests::get_artists($RequestID);
@@ -34,23 +36,31 @@ if ($CategoryName != 'Other') {
34 36
   $ArtistLink = Artists::display_artists($ArtistForm, true, true);
35 37
 
36 38
   if ($IsFilled) {
37
-    $DisplayLink = "$ArtistLink<a href=\"torrents.php?torrentid=$Request[TorrentID]\" dir=\"ltr\">$Request[Title]</a>";
39
+    $DisplayLink = "$ArtistLink<a href=\"torrents.php?torrentid=$Request[TorrentID]\" dir=\"ltr\">$Title</a>";
38 40
   } else {
39
-    $DisplayLink = $ArtistLink.'<span dir="ltr">'.$Request['Title']."</span>";
41
+    $DisplayLink = $ArtistLink.'<span dir="ltr">'.$Title."</span>";
40 42
   }
41 43
 
42
-  $FullName = $ArtistName.$Request['Title'];
44
+  $FullName = $ArtistName.$Title;
43 45
 
44 46
 } else {
45 47
   if ($IsFilled) {
46
-    $DisplayLink = "<a href=\"torrents.php?torrentid=$Request[TorrentID]\" dir=\"ltr\">$Request[Title]</a>";
48
+    $DisplayLink = "<a href=\"torrents.php?torrentid=$Request[TorrentID]\" dir=\"ltr\">$Title</a>";
47 49
   } else {
48
-    $DisplayLink = "<span dir=\"ltr\">$Request[Title]</span>";
50
+    $DisplayLink = "<span dir=\"ltr\">$Title</span>";
49 51
   }
50
-  $FullName = $Request['Title'];
52
+  $FullName = $Title;
51 53
 }
52 54
 
53
-$Extra = '<br />'.$Request['TitleJP'];
55
+$Extra = "";
56
+
57
+if (!empty($Request['TitleRJ']) && $Request['TitleRJ'] != $Title) {
58
+  $Extra .= '<br />' . $Request['TitleRJ'];
59
+}
60
+
61
+if (!empty($Request['TitleJP']) && $Request['TitleJP'] != $Title) {
62
+  $Extra .= '<br />' . $Request['TitleJP'];
63
+}
54 64
 
55 65
 if (!empty($Request['CatalogueNumber'])) {
56 66
   $Extra .= "<br />[$Request[CatalogueNumber]]";

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

@@ -491,6 +491,8 @@ View::show_header($Title, 'requests');
491 491
       $IsFilled = false;
492 492
     }
493 493
 
494
+    $Title = empty($Request['Title']) ? (empty($Request['TitleRJ']) ? $Request['TitleJP'] : $Request['TitleRJ']) : $Request['Title'];
495
+
494 496
     if ($CategoryName != 'Other') {
495 497
       $ArtistForm = Requests::get_artists($RequestID);
496 498
       $ArtistLink = Artists::display_artists($ArtistForm, true, true);
@@ -498,7 +500,7 @@ View::show_header($Title, 'requests');
498 500
       if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
499 501
         $FullName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($Request['Image']).'" onmouseleave="ungetCover(event)" ';
500 502
       }
501
-      $FullName .= "dir=\"ltr\">$Request[Title]</span></a>";
503
+      $FullName .= "dir=\"ltr\">$Title</span></a>";
502 504
 
503 505
       $ExtraInfo = '';
504 506
 
@@ -513,7 +515,7 @@ View::show_header($Title, 'requests');
513 515
         $FullName .= " $ExtraInfo";
514 516
       }
515 517
     } else {
516
-      $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\" dir=\"ltr\">$Request[Title]</a>";
518
+      $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\" dir=\"ltr\">$Title</a>";
517 519
     }
518 520
     $Tags = $Request['Tags'];
519 521
 ?>

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

@@ -53,15 +53,19 @@ if (empty($CategoryID)) {
53 53
   error(0);
54 54
 }
55 55
 
56
-if (empty($_POST['title'])) {
57
-  $Err = 'You forgot to enter the title!';
58
-} else {
56
+if (empty($_POST['title']) && empty($_POST['title_rj']) && empty($_POST['title_jp'])) {
57
+  $Err = 'You must enter at least one title!';
58
+}
59
+
60
+if (!empty($_POST['title'])) {
59 61
   $Title = trim($_POST['title']);
60 62
 }
61 63
 
62
-if (empty($_POST['title_jp'])) {
63
-  $Err = 'You forgot to enter the Japanese title!';
64
-} else {
64
+if (!empty($_POST['title_rj'])) {
65
+  $TitleRJ = trim($_POST['title_rj']);
66
+}
67
+
68
+if (!empty($_POST['title_jp'])) {
65 69
   $TitleJP = trim($_POST['title_jp']);
66 70
 }
67 71
 
@@ -240,10 +244,10 @@ if (!isset($GroupID)) $GroupID = '';
240 244
 if ($NewRequest) {
241 245
   $DB->query('
242 246
     INSERT INTO requests (
243
-      UserID, TimeAdded, LastVote, CategoryID, Title, TitleJP, Image, Description,
247
+      UserID, TimeAdded, LastVote, CategoryID, Title, TitleRJ, TitleJP, Image, Description,
244 248
       CatalogueNumber, DLSiteID, Visible, GroupID)
245 249
     VALUES
246
-      ('.$LoggedUser['ID'].", '".sqltime()."', '".sqltime()."', $CategoryID, '".db_string($Title)."', '".db_string($TitleJP)."', '".db_string($Image)."', '".db_string($Description)."',
250
+      ('.$LoggedUser['ID'].", '".sqltime()."', '".sqltime()."', $CategoryID, '".db_string($Title)."', '".db_string($TitleRJ)."', '".db_string($TitleJP)."', '".db_string($Image)."', '".db_string($Description)."',
247 251
           '".db_string($CatalogueNumber)."', '".db_string($DLSiteID)."', '1', '$GroupID')");
248 252
 
249 253
   $RequestID = $DB->inserted_id();
@@ -253,6 +257,7 @@ if ($NewRequest) {
253 257
     UPDATE requests
254 258
     SET CategoryID = $CategoryID,
255 259
       Title = '".db_string($Title)."',
260
+      TitleRJ = '".db_string($TitleRJ)."',
256 261
       TitleJP = '".db_string($TitleJP)."',
257 262
       Image = '".db_string($Image)."',
258 263
       Description = '".db_string($Description)."',
@@ -409,12 +414,12 @@ if ($NewRequest) {
409 414
     WHERE ID = ".$LoggedUser['ID']);
410 415
   $Cache->delete_value('user_stats_'.$LoggedUser['ID']);
411 416
 
412
-
417
+  $AnnounceTitle = empty($Title) ? (empty($TitleRJ) ? $TitleJP : $TitleRJ) : $Title;
413 418
 
414 419
   if ($CategoryName != 'Other') {
415
-    $Announce = "\"$Title\"".(isset($ArtistForm)?(' - '.Artists::display_artists($ArtistForm, false, false)):'').' '.site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
420
+    $Announce = "\"$AnnounceTitle\"".(isset($ArtistForm)?(' - '.Artists::display_artists($ArtistForm, false, false)):'').' '.site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
416 421
   } else {
417
-    $Announce = "\"$Title\" - ".site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
422
+    $Announce = "\"$AnnounceTitle\" - ".site_url()."requests.php?action=view&id=$RequestID - ".implode(' ', $Tags);
418 423
   }
419 424
   send_irc('PRIVMSG '.BOT_REQUEST_CHAN.' '.$Announce);
420 425
 

+ 7
- 2
sections/top10/torrents.php View File

@@ -153,6 +153,8 @@ $BaseQuery = '
153 153
     t.ID,
154 154
     g.ID,
155 155
     g.Name,
156
+    g.NameRJ,
157
+    g.NameJP,
156 158
     g.CategoryID,
157 159
     g.WikiImage,
158 160
     g.TagList,
@@ -447,7 +449,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
447 449
   $Artists = Artists::get_artists($GroupIDs);
448 450
 
449 451
   foreach ($Details as $Detail) {
450
-    list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TagsList,
452
+    list($TorrentID, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP, $GroupCategoryID, $WikiImage, $TagsList,
451 453
       $Media, $Year, $Snatched, $Seeders, $Leechers, $Data, $Size) = $Detail;
452 454
 
453 455
     $IsBookmarked = Bookmarks::has_bookmarked('torrent', $GroupID);
@@ -466,7 +468,10 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
466 468
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
467 469
       $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover()" ';
468 470
     }
469
-    $DisplayName .= "dir=\"ltr\">$GroupName</a>";
471
+
472
+
473
+    $Name = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
474
+    $DisplayName .= "dir=\"ltr\">$Name</a>";
470 475
 
471 476
     // append extra info to torrent title
472 477
     $ExtraInfo = '';

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

@@ -179,7 +179,7 @@ View::show_header('Browse Torrents', 'browse');
179 179
         <tr id="album_torrent_name" class="ftr_advanced<?=$HideAdvanced?>">
180 180
           <td class="label"><!--Torrent name:--></td>
181 181
           <td colspan="3" class="ft_groupname">
182
-            <input type="search" spellcheck="false" size="65" name="groupname" class="inputtext smaller fti_advanced" placeholder="Torrent name" value="<?Format::form('groupname')?>" />
182
+            <input type="search" spellcheck="false" size="65" name="advgroupname" class="inputtext smaller fti_advanced" placeholder="Torrent name" value="<?Format::form('advgroupname')?>" />
183 183
           </td>
184 184
         </tr>
185 185
         <tr id="catalogue_number" class="ftr_advanced<?=$HideAdvanced?>">
@@ -482,7 +482,7 @@ View::show_header('Browse Torrents', 'browse');
482 482
   $GroupPages = $GroupInfo['Pages'];
483 483
   $GroupStudio = $GroupInfo['Studio'];
484 484
   $GroupDLsiteID = $GroupInfo['DLSiteID'];
485
-  $GroupName = $GroupInfo['Name'];
485
+  $GroupName = empty($GroupInfo['Name']) ? (empty($GroupInfo['NameRJ']) ? $GroupInfo['NameJP'] : $GroupInfo['NameRJ']) : $GroupInfo['Name'];
486 486
   if ($GroupResults) {
487 487
     $Torrents = $GroupInfo['Torrents'];
488 488
     $GroupTime = $MaxSize = $TotalLeechers = $TotalSeeders = $TotalSnatched = 0;

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

@@ -21,11 +21,19 @@ $TorrentDetails = $TorrentCache[0];
21 21
 $TorrentList = $TorrentCache[1];
22 22
 
23 23
 // Group details
24
-list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameJP, $GroupYear,
24
+list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP, $GroupYear,
25 25
   $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupPages, $GroupCategoryID,
26 26
   $GroupDLsiteID, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
27 27
   $TagPositiveVotes, $TagNegativeVotes, $Screenshots, $GroupFlags) = array_values($TorrentDetails);
28 28
 
29
+if (!$GroupName) {
30
+  if (!$GroupNameRJ) {
31
+    $GroupName = $GroupNameJP;
32
+  } else {
33
+    $GroupName = $GroupNameRJ;
34
+  }
35
+}
36
+
29 37
 $DisplayName = "<span dir=\"ltr\">$GroupName</span><br />";
30 38
 $AltName = $GroupName; // Goes in the alt text of the image
31 39
 $Title = $GroupName; // goes in <title>
@@ -33,6 +41,10 @@ $WikiBody = Text::full_format($WikiBody);
33 41
 
34 42
 $Artists = Artists::get_artist($GroupID);
35 43
 
44
+if ($GroupNameRJ && $GroupNameRJ != $GroupName) {
45
+  $DisplayName .= "<span dir=\"ltr\">$GroupNameRJ</span><br />";
46
+}
47
+
36 48
 if ($GroupNameJP && $GroupNameJP != $GroupName) {
37 49
   $DisplayName .= "<span dir=\"ltr\">$GroupNameJP</span><br />";
38 50
 }

+ 9
- 2
sections/torrents/editgroup.php View File

@@ -40,6 +40,7 @@ $DB->query("
40 40
 $DB->query("
41 41
   SELECT
42 42
     tg.Name,
43
+    tg.NameRJ,
43 44
     tg.NameJP,
44 45
     wt.Image,
45 46
     wt.Body,
@@ -59,7 +60,7 @@ $DB->query("
59 60
 if (!$DB->has_results()) {
60 61
   error(404);
61 62
 }
62
-list($Name, $NameJP, $Image, $Body, $WikiImage, $WikiBody, $Year, $Studio, $Series, $DLsiteID, $CatalogueNumber, $Pages, $CategoryID, $DLsiteID) = $DB->next_record();
63
+list($Name, $NameRJ, $NameJP, $Image, $Body, $WikiImage, $WikiBody, $Year, $Studio, $Series, $DLsiteID, $CatalogueNumber, $Pages, $CategoryID, $DLsiteID) = $DB->next_record();
63 64
 
64 65
 $DB->query("
65 66
   SELECT
@@ -296,11 +297,17 @@ if ($CategoryID != 5) { ?>
296 297
           <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
297 298
           <input type="hidden" name="groupid" value="<?=$GroupID?>" />
298 299
           <tr>
299
-            <td class="label">Title: </td>
300
+            <td class="label">English Title: </td>
300 301
             <td>
301 302
               <input type="text" name="name" size="70" value="<?=$Name?>" />
302 303
             </td>
303 304
           </tr>
305
+          <tr>
306
+            <td class="label">Romaji Title: </td>
307
+            <td>
308
+              <input type="text" name="namerj" size="70" value="<?=$NameRJ?>" />
309
+            </td>
310
+          </tr>
304 311
           <tr>
305 312
             <td class="label">Japanese Title: </td>
306 313
             <td>

+ 1
- 0
sections/torrents/functions.php View File

@@ -22,6 +22,7 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0, $PersonalProp
22 22
     $SQL .= "
23 23
         g.ID,
24 24
         g.Name,
25
+        g.NameRJ,
25 26
         g.NameJP,
26 27
         g.Year,
27 28
         g.Studio,

+ 25
- 11
sections/torrents/rename.php View File

@@ -4,6 +4,7 @@ authorize();
4 4
 $GroupID = $_POST['groupid'];
5 5
 $OldGroupID = $GroupID;
6 6
 $NewName = $_POST['name'];
7
+$NewRJ = $_POST['namerj'];
7 8
 $NewJP = $_POST['namejp'];
8 9
 
9 10
 $DB->query("
@@ -17,30 +18,43 @@ if (!$GroupID || !is_number($GroupID)) {
17 18
   error(404);
18 19
 }
19 20
 
20
-if (empty($NewName) || empty($NewJP)) {
21
-  error('Torrent groups must have a name');
22
-}
23
-
24 21
 if (!($Contributed || check_perms('torrents_edit'))) {
25 22
   error(403);
26 23
 }
27 24
 
28
-$DB->query("
29
-  SELECT Name
30
-  FROM torrents_group
31
-  WHERE ID = $GroupID");
32
-list($OldName) = $DB->next_record(MYSQLI_NUM, false);
25
+if (empty($NewName) && empty($NewRJ) && empty($NewJP)) {
26
+  error('Torrent groups must have a name');
27
+}
33 28
 
34 29
 $DB->query("
35 30
   UPDATE torrents_group
36 31
   SET Name = '".db_string($NewName)."',
32
+  NameRJ = '".db_string($NewRJ)."',
37 33
   NameJP = '".db_string($NewJP)."'
38 34
   WHERE ID = '$GroupID'");
39 35
 $Cache->delete_value("torrents_details_$GroupID");
40 36
 
41 37
 Torrents::update_hash($GroupID);
42 38
 
43
-Misc::write_log("Torrent Group $GroupID ($OldName) was renamed to \"$NewName\" from \"$OldName\" by ".$LoggedUser['Username']);
44
-Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "renamed to \"$NewName\" from \"$OldName\"", 0);
39
+$DB->query("
40
+  SELECT Name, NameRJ, NameJP
41
+  FROM torrents_group
42
+  WHERE ID = $GroupID");
43
+list($OldName, $OldRJ, $OldJP) = $DB->next_record(MYSQLI_NUM, false);
44
+
45
+if ($OldName != $NewName) {
46
+  Misc::write_log("Torrent Group $GroupID ($OldName)'s title was changed to \"$NewName\" from \"$OldName\" by ".$LoggedUser['Username']);
47
+  Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "title changed to \"$NewName\" from \"$OldName\"", 0);
48
+}
49
+
50
+if ($OldRJ != $NewRJ) {
51
+  Misc::write_log("Torrent Group $GroupID ($OldRJ)'s romaji title was changed to \"$NewRJ\" from \"$OldRJ\" by ".$LoggedUser['Username']);
52
+  Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "romaji title changed to \"$NewRJ\" from \"$OldRJ\"", 0);
53
+}
54
+
55
+if ($OldJP != $NewJP) {
56
+  Misc::write_log("Torrent Group $GroupID ($OldJP)'s japanese title was changed to \"$NewJP\" from \"$OldJP\" by ".$LoggedUser['Username']);
57
+  Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "japanese title changed to \"$NewJP\" from \"$OldJP\"", 0);
58
+}
45 59
 
46 60
 header("Location: torrents.php?id=$GroupID");

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

@@ -515,6 +515,7 @@ foreach ($Categories as $CatKey => $CatName) {
515 515
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
516 516
       $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage).'" onmouseleave="ungetCover()" ';
517 517
     }
518
+    $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
518 519
     $DisplayName .= 'dir="ltr">'.$GroupName.'</a>';
519 520
     if ($GroupYear) {
520 521
       $DisplayName .= " [$GroupYear]";

+ 13
- 7
sections/upload/upload_handle.php View File

@@ -38,6 +38,7 @@ $Type = $Categories[(int)$_POST['type']];
38 38
 $TypeID = $_POST['type'] + 1;
39 39
 $Properties['CategoryName'] = $Type;
40 40
 $Properties['Title'] = $_POST['title'];
41
+$Properties['TitleRJ'] = $_POST['title_rj'];
41 42
 $Properties['TitleJP'] = $_POST['title_jp'];
42 43
 $Properties['Year'] = $_POST['year'];
43 44
 
@@ -145,12 +146,12 @@ switch ($Type) {
145 146
   default:
146 147
     if (!isset($_POST['groupid']) || !$_POST['groupid']) {
147 148
       $Validate->SetFields('title',
148
-        '1','string','Title must be between 1 and 200 characters.', array('maxlength'=>200, 'minlength'=>1));
149
+        '0','string','Title must be between 1 and 300 characters.', array('maxlength'=>300, 'minlength'=>1));
150
+      $Validate->SetFields('title_rj',
151
+        '0','string', 'Romaji Title must be between 1 and 300 characters.', array('maxlength'=>300, 'minlength'=>1));
149 152
 
150
-    if (isset($_POST['title_jp'])) {
151 153
       $Validate->SetFields('title_jp',
152
-        '1','string','Japanese Title must be between 1 and 512 bytes.', array('maxlength'=>512, 'minlength'=>1));
153
-    }
154
+        '0','string','Japanese Title must be between 1 and 512 bytes.', array('maxlength'=>512, 'minlength'=>1));
154 155
 
155 156
       $Validate->SetFields('tags',
156 157
         '1','string','You must enter at least five tag. Maximum length is 1500 characters.', array('maxlength'=>1500, 'minlength'=>2));
@@ -174,6 +175,10 @@ if (count(explode(',', $Properties['TagList'])) < 5) {
174 175
   $Err = 'You must enter at least 5 tags.';
175 176
 }
176 177
 
178
+if (!(isset($_POST['title']) || isset($_POST['title_rj']) || isset($_POST['title_jp']))) {
179
+  $Err = 'You must enter at least one title.';
180
+}
181
+
177 182
 $File = $_FILES['file_input']; // This is our torrent file
178 183
 $TorrentName = $File['tmp_name'];
179 184
 
@@ -448,9 +453,9 @@ if (!isset($GroupID) || !$GroupID) {
448 453
   // Create torrent group
449 454
   $DB->query("
450 455
     INSERT INTO torrents_group
451
-      (CategoryID, Name, NameJP, Year, Series, Studio, CatalogueNumber, Pages, Time, WikiBody, WikiImage, DLsiteID)
456
+      (CategoryID, Name, NameRJ, NameJP, Year, Series, Studio, CatalogueNumber, Pages, Time, WikiBody, WikiImage, DLsiteID)
452 457
     VALUES
453
-      ($TypeID, ".$T['Title'].", ".$T['TitleJP'].", ".$T['Year'].", ".$T['Series'].", ".$T['Studio'].", ".$T['CatalogueNumber'].", " . $T['Pages'] . ", '".sqltime()."', '".db_string($Body)."', ".$T['Image'].", ".$T['DLsiteID'].")");
458
+      ($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'].")");
454 459
   $GroupID = $DB->inserted_id();
455 460
   if ($Type == 'Movies' || $Type == 'Anime' || $Type == 'Manga' || $Type == 'Games') {
456 461
     foreach ($ArtistForm as $Num => $Artist) {
@@ -696,7 +701,8 @@ $Announce = '';
696 701
 if ($Type != 'Other') {
697 702
   $Announce .= Artists::display_artists($ArtistForm, false);
698 703
 }
699
-$Announce .= trim($Properties['Title']).' ';
704
+$Announce .= empty($Properties['Title']) ? (empty($Properties['TitleRJ']) ? trim($Properties['TitleJP']) : trim($Properties['TitleRJ'])) : trim($Properties['Title']);
705
+$Announce .= ' ';
700 706
 if ($Type != 'Other') {
701 707
   $Announce .= '['.Torrents::torrent_info($Properties, false, false, false).']';
702 708
 }

+ 14
- 4
sections/user/user.php View File

@@ -690,6 +690,8 @@ if (check_paranoia_here('snatched')) {
690 690
       SELECT
691 691
         g.ID,
692 692
         g.Name,
693
+        g.NameRJ,
694
+        g.NameJP,
693 695
         g.WikiImage
694 696
       FROM xbt_snatched AS s
695 697
         INNER JOIN torrents AS t ON t.ID = s.fid
@@ -715,10 +717,12 @@ if (check_paranoia_here('snatched')) {
715 717
       <span style="float: right;"><a onclick="$('#recent_snatches_images').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); wall('#recent_snatches_images', '.collage_image', [2,3]); return false;" class="brackets">Show</a></span>&nbsp;
716 718
     </div>
717 719
     <div id="recent_snatches_images" class="collage_images hidden">
718
-<?    foreach ($RecentSnatches as $RS) { ?>
720
+<?    foreach ($RecentSnatches as $RS) {
721
+        $RSName = empty($RS['Name']) ? (empty($RS['NameRJ']) ? $RS['NameJP'] : $RS['NameRJ']) : $RS['Name'];
722
+ ?>
719 723
       <div style='width: 100px;' class='collage_image' >
720 724
         <a href="torrents.php?id=<?=$RS['ID']?>">
721
-          <img class="tooltip" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="100%" />
725
+          <img class="tooltip" title="<?=display_str($RS['Artist'])?><?=display_str($RSName)?>" src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RSName)?>" width="100%" />
722 726
         </a>
723 727
       </div>
724 728
 <?    } ?>
@@ -735,6 +739,8 @@ if (check_paranoia_here('uploads')) {
735 739
       SELECT
736 740
         g.ID,
737 741
         g.Name,
742
+        g.NameRJ,
743
+        g.NameJP,
738 744
         g.WikiImage
739 745
       FROM torrents_group AS g
740 746
         INNER JOIN torrents AS t ON t.GroupID = g.ID
@@ -758,10 +764,12 @@ if (check_paranoia_here('uploads')) {
758 764
       <span style="float: right;"><a onclick="$('#recent_uploads_images').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); wall('#recent_uploads_images', '.collage_image', [2,3]); return false;" class="brackets">Show</a></span>&nbsp;
759 765
     </div>
760 766
     <div id="recent_uploads_images" class="collage_images hidden">
761
-<?    foreach ($RecentUploads as $RU) { ?>
767
+<?    foreach ($RecentUploads as $RU) {
768
+        $RUName = empty($RU['Name']) ? (empty($RU['NameRJ']) ? $RU['NameJP'] : $RU['NameRJ']) : $RU['Name'];
769
+?>
762 770
       <div style='width: 100px;' class='collage_image' >
763 771
         <a href="torrents.php?id=<?=$RU['ID']?>">
764
-          <img class="tooltip" title="<?=$RU['Artist']?><?=$RU['Name']?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="100%" />
772
+          <img class="tooltip" title="<?=$RU['Artist']?><?=$RUName?>" src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RUName?>" width="100%" />
765 773
         </a>
766 774
       </div>
767 775
 <?    } ?>
@@ -912,6 +920,8 @@ if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_
912 920
       } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
913 921
         $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title] [$Request[Year]]</a>";
914 922
       } else {
923
+        if (!$Request['Title']) { $Request['Title'] = $Request['TitleRJ']; }
924
+        if (!$Request['Title']) { $Request['Title'] = $Request['TitleJP']; }
915 925
         $FullName = "<a href=\"requests.php?action=view&amp;id=$RequestID\">$Request[Title]</a>";
916 926
       }
917 927
 ?>

Loading…
Cancel
Save