Browse Source

Miscellaneous Changes

* Added a new category
* Add deletion support to batch tag updater
* Bug fixes
spaghetti 5 years ago
parent
commit
46a904d950
60 changed files with 300 additions and 207 deletions
  1. 23
    14
      classes/autoenable.class.php
  2. 1
    3
      classes/cache.class.php
  3. 1
    1
      classes/config.template
  4. 1
    1
      classes/debug.class.php
  5. 6
    6
      classes/torrent_form.class.php
  6. 1
    1
      gazelle.sql
  7. 11
    3
      sections/ajax/autofill/manga.php
  8. 8
    6
      sections/bookmarks/torrents.php
  9. 4
    4
      sections/collages/edit.php
  10. 2
    2
      sections/collages/new.php
  11. 8
    6
      sections/collages/torrent_collage.php
  12. 1
    1
      sections/forums/forum.php
  13. 1
    1
      sections/forums/main.php
  14. 10
    10
      sections/login/disabled.php
  15. 0
    1
      sections/login/login.php
  16. 4
    5
      sections/reports/ajax_add_notes.php
  17. 9
    9
      sections/reports/compose.php
  18. 4
    4
      sections/reportsv2/report.php
  19. 1
    1
      sections/requests/new_edit.php
  20. 2
    2
      sections/requests/take_new_edit.php
  21. 1
    2
      sections/rules/upload.php
  22. 8
    4
      sections/schedule/hourly/bonus_points.php
  23. 1
    1
      sections/schedule/index.php
  24. 5
    2
      sections/store/100k_points.php
  25. 5
    2
      sections/store/10k_points.php
  26. 5
    2
      sections/store/1k_points.php
  27. 3
    2
      sections/store/1m_points.php
  28. 14
    13
      sections/store/store.php
  29. 3
    2
      sections/store/upload_1000GB.php
  30. 3
    2
      sections/store/upload_100GB.php
  31. 3
    2
      sections/store/upload_10GB.php
  32. 3
    2
      sections/store/upload_1GB.php
  33. 1
    1
      sections/tools/development/misc_values.php
  34. 3
    3
      sections/tools/managers/enable_requests.php
  35. 50
    19
      sections/tools/misc/tags.php
  36. 1
    1
      sections/torrents/details.php
  37. 1
    1
      sections/torrents/edit.php
  38. 3
    17
      sections/torrents/editgroup.php
  39. 11
    1
      sections/torrents/functions.php
  40. 2
    1
      sections/torrents/notify.php
  41. 8
    8
      sections/upload/upload_handle.php
  42. 1
    1
      sections/user/invite.php
  43. 4
    4
      sections/user/user.php
  44. 1
    1
      sections/userhistory/email_history_userview.php
  45. 1
    1
      sections/userhistory/ip_history_userview.php
  46. 6
    1
      sections/userhistory/subscribed_collages.php
  47. 1
    1
      sections/userhistory/subscriptions.php
  48. 1
    1
      sections/wiki/article.php
  49. 0
    7
      static/functions/browse.js
  50. 1
    0
      static/functions/comments.js
  51. 11
    1
      static/functions/global.js
  52. 0
    1
      static/functions/reports.js
  53. 4
    0
      static/functions/requests.js
  54. 1
    1
      static/functions/u2f.js
  55. 11
    0
      static/functions/upload.js
  56. 1
    1
      static/functions/validate_upload.js
  57. 13
    9
      static/styles/beluga/style.css
  58. 2
    2
      static/styles/genaviv/style.css
  59. 4
    0
      static/styles/global.css
  60. 5
    6
      static/styles/oppai/style.css

+ 23
- 14
classes/autoenable.class.php View File

@@ -11,10 +11,10 @@ class AutoEnable {
11 11
     const CACHE_KEY_NAME = 'num_enable_requests';
12 12
 
13 13
     // The default request rejected message
14
-    const REJECTED_MESSAGE = "Your request to re-enable your account has been rejected.<br />This may be because a request is already pending for your username, or because a recent request was denied.<br /><br />You are encouraged to discuss this with staff by visiting %s on %s";
14
+    const REJECTED_MESSAGE = "Your request to re-enable your account has been rejected.<br>This may be because a request is already pending for your username, or because a recent request was denied.<br><br>You are encouraged to discuss this with staff by visiting %s on %s";
15 15
 
16 16
     // The default request received message
17
-    const RECEIVED_MESSAGE = "Your request to re-enable your account has been received. You can expect a reply message in your email within 48 hours.<br />If you do not receive an email after 48 hours have passed, please visit us on IRC for assistance.";
17
+    const RECEIVED_MESSAGE = "Your request to re-enable your account has been received. Most requests are responded to within minutes. Remember to check your spam.<br>If you do not receive an email after 48 hours have passed, please visit us on IRC for assistance.";
18 18
 
19 19
     /**
20 20
      * Handle a new enable request
@@ -31,7 +31,7 @@ class AutoEnable {
31 31
 
32 32
         // Get the user's ID
33 33
         G::$DB->query("
34
-                SELECT um.ID
34
+                SELECT um.ID, ui.BanReason
35 35
                 FROM users_main AS um
36 36
                 JOIN users_info ui ON ui.UserID = um.ID
37 37
                 WHERE um.Username = '$Username'
@@ -39,7 +39,7 @@ class AutoEnable {
39 39
 
40 40
         if (G::$DB->has_results()) {
41 41
             // Make sure the user can make another request
42
-            list($UserID) = G::$DB->next_record();
42
+            list($UserID, $BanReason) = G::$DB->next_record();
43 43
             G::$DB->query("
44 44
             SELECT 1 FROM users_enable_requests
45 45
             WHERE UserID = '$UserID'
@@ -51,9 +51,8 @@ class AutoEnable {
51 51
                     OR
52 52
                     (
53 53
                       Timestamp > NOW() - INTERVAL 2 MONTH
54
-                        AND
55
-                          (Outcome = '".self::DENIED."'
56
-                             OR Outcome = '".self::DISCARDED."')
54
+                      AND
55
+                      Outcome = '".self::DENIED."'
57 56
                     )
58 57
                   )");
59 58
         }
@@ -75,12 +74,16 @@ class AutoEnable {
75 74
                 (UserID, Email, IP, UserAgent, Timestamp)
76 75
                 VALUES (?, ?, ?, ?, NOW())",
77 76
                 $UserID, Crypto::encrypt($Email), Crypto::encrypt($IP), $UserAgent);
77
+            $RequestID = G::$DB->inserted_id();
78 78
 
79 79
             // Cache the number of requests for the modbar
80 80
             G::$Cache->increment_value(self::CACHE_KEY_NAME);
81 81
             setcookie('username', '', time() - 60 * 60, '/', '', false);
82 82
             $Output = self::RECEIVED_MESSAGE;
83 83
             Tools::update_user_notes($UserID, sqltime() . " - Enable request " . G::$DB->inserted_id() . " received from $IP\n\n");
84
+            if ($BanReason == 3) {
85
+              //self::handle_requests([$RequestID], self::APPROVED, "Automatically approved (inactivity)");
86
+            }
84 87
         }
85 88
 
86 89
         return $Output;
@@ -140,8 +143,8 @@ class AutoEnable {
140 143
                     $Token = db_string(Users::make_secret());
141 144
                     G::$DB->query("
142 145
                         UPDATE users_enable_requests
143
-                        SET Token = '$Token'
144
-                        WHERE ID = '$ID'");
146
+                        SET Token = ?
147
+                        WHERE ID = ?", $Token, $ID);
145 148
                     $TPL->set('TOKEN', $Token);
146 149
                 }
147 150
 
@@ -159,11 +162,17 @@ class AutoEnable {
159 162
         }
160 163
 
161 164
         // User notes stuff
165
+        $StaffID = G::$LoggedUser['ID'] ?? 0;
162 166
         G::$DB->query("
163 167
             SELECT Username
164 168
             FROM users_main
165
-            WHERE ID = '" . G::$LoggedUser['ID'] . "'");
166
-        list($StaffUser) = G::$DB->next_record();
169
+            WHERE ID = ?", $StaffID);
170
+        if (G::$DB->has_results()) {
171
+          list($StaffUser) = G::$DB->next_record();
172
+        } else {
173
+          $StaffUser = "System";
174
+          $StaffID = 0;
175
+        }
167 176
 
168 177
         foreach ($UserInfo as $User) {
169 178
             list($ID, $UserID) = $User;
@@ -176,9 +185,9 @@ class AutoEnable {
176 185
         G::$DB->query("
177 186
                 UPDATE users_enable_requests
178 187
                 SET HandledTimestamp = NOW(),
179
-                    CheckedBy = '".G::$LoggedUser['ID']."',
180
-                    Outcome = '$Status'
181
-                WHERE ID IN (".implode(',', $IDs).")");
188
+                    CheckedBy = ?,
189
+                    Outcome = ?
190
+                WHERE ID IN (".implode(',', $IDs).")", $StaffID, $Status);
182 191
         G::$Cache->decrement_value(self::CACHE_KEY_NAME, count($IDs));
183 192
     }
184 193
 

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

@@ -102,9 +102,7 @@ class Cache extends MemcacheCompat {
102 102
   // Wrapper for Memcache::add, with the zlib option removed and default duration of 30 days
103 103
   public function add_value($Key, $Value, $Duration = 2592000) {
104 104
     $StartTime = microtime(true);
105
-    $AddParams = [$Key, $Value, false, $Duration];
106
-    if (is_subclass_of($this, 'Memcached')) unset($AddParams[2]);
107
-    $Added = $this->add(...$AddParams);
105
+    $Added = $this->add($Key, $Value, 0, $Duration);
108 106
     $this->Time += (microtime(true) - $StartTime) * 1000;
109 107
     return $Added;
110 108
   }

+ 1
- 1
classes/config.template View File

@@ -162,7 +162,7 @@ $CategoryIcons = ['music.png', 'apps.png', 'ebook.png', 'audiobook.png', 'elearn
162 162
 
163 163
 $Media = ['TV', 'DVD', 'Bluray', 'HD DVD', 'VHS', 'VCD', 'LD', 'Web'];
164 164
 $MediaManga = ['Scan', 'Web'];
165
-$Platform = ['Windows', 'OS X', 'Linux', 'Multi-Platform', 'Flash', 'Java', 'Android', 'iOS', '3DS'];
165
+$Platform = ['Windows', 'OS X', 'Linux', 'BSD', 'Flash', 'Java', 'Android', 'iOS', '3DS'];
166 166
 $Containers = ['AVI', 'MKV', 'MP4', 'OGM', 'WMV', 'ISO', 'VOB IFO', 'TS', 'M2TS'];
167 167
 $ContainersGames = ['ISO', 'BIN-CUE', 'Installer', 'Loose'];
168 168
 $Codecs = ['h264', '10-bit h264', 'XviD', 'DivX', 'WMV', 'DVD5', 'DVD9', 'HEVC', 'MPEG-2'];

+ 1
- 1
classes/debug.class.php View File

@@ -139,7 +139,7 @@ class DEBUG {
139 139
     $Return = [];
140 140
     foreach ($Array as $Key => $Val) {
141 141
       $Return[$Key] = '';
142
-      if (!is_int($Key) || $Key != $LastKey + 1) {
142
+      if (!is_int($Key) || !is_int($LastKey) || $Key != $LastKey + 1) {
143 143
         $Return[$Key] .= "'$Key' => ";
144 144
       }
145 145
         if ($Val === true) {

+ 6
- 6
classes/torrent_form.class.php View File

@@ -274,6 +274,12 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
274 274
         <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=display_str($Torrent['DLsiteID']??'')?>" <?=$this->Disabled?>/></td>
275 275
       </tr>
276 276
 <? } ?>
277
+      <tr id="mediainfo_tr">
278
+        <td class="label">Media Info</td>
279
+        <td>
280
+          <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()"  rows="8" cols="60"><?=display_str($Torrent['MediaInfo']??'')?></textarea>
281
+        </td>
282
+      </tr>
277 283
       <tr id="media_tr">
278 284
         <td class="label">Media</td>
279 285
         <td>
@@ -496,12 +502,6 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
496 502
           <input type="checkbox" name="censored" value="1" <?=(($Torrent['Censored'] ?? 1) ? 'checked ' : '')?>/>
497 503
         </td>
498 504
       </tr>
499
-      <tr id="mediainfo_tr">
500
-        <td class="label">Media Info</td>
501
-        <td>
502
-          <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()"  rows="8" cols="60"><?=display_str($Torrent['MediaInfo']??'')?></textarea>
503
-        </td>
504
-      </tr>
505 505
 <?    if ($this->NewTorrent) { ?>
506 506
       <tr id="tags_tr">
507 507
         <td class="label tooltip" title="Comma seperated list of tags">Tags</td>

+ 1
- 1
gazelle.sql View File

@@ -730,7 +730,7 @@ CREATE TABLE `requests` (
730 730
 CREATE TABLE `requests_artists` (
731 731
   `RequestID` int(10) unsigned NOT NULL,
732 732
   `ArtistID` int(10) NOT NULL,
733
-  PRIMARY KEY (`RequestID`)
733
+  PRIMARY KEY (`RequestID`, `ArtistID`)
734 734
 ) ENGINE=InnoDB CHARSET=utf8mb4;
735 735
 
736 736
 CREATE TABLE `requests_tags` (

+ 11
- 3
sections/ajax/autofill/manga.php View File

@@ -23,6 +23,7 @@ if ($Cache->get_value('manga_fill_json_'.$gid)) {
23 23
   $data = json_encode(["method" => "gdata", "gidlist" => [[$gid, $token]], "namespace" => 1]);
24 24
   $curl = curl_init('http://api.e-hentai.org/api.php');
25 25
   curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
26
+  curl_setopt($curl, CURLOPT_TIMEOUT, 10);
26 27
   curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
27 28
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
28 29
   curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Content-Length: '.strlen($data)]);
@@ -76,16 +77,23 @@ if ($Cache->get_value('manga_fill_json_'.$gid)) {
76 77
     }
77 78
   }
78 79
 
80
+  $title = html_entity_decode($json['title'], ENT_QUOTES);
81
+  $title = preg_replace("/\(([^()]*+|(?R))*\)/","", $title);
82
+  $title = trim(preg_replace("/\[([^\[\]]*+|(?R))*\]/","", $title));
83
+  $title_jp = html_entity_decode($json['title_jpn'], ENT_QUOTES);
84
+  $title_jp = preg_replace("/\(([^()]*+|(?R))*\)/","", $title_jp);
85
+  $title_jp = trim(preg_replace("/\[([^\[\]]*+|(?R))*\]/","", $title_jp));
86
+
79 87
   $json_str = [
80 88
     'id'          => $gid,
81
-    'title'       => html_entity_decode($json['title'], ENT_QUOTES),
82
-    'title_jp'    => html_entity_decode($json['title_jpn'], ENT_QUOTES),
89
+    'title'       => $title,
90
+    'title_jp'    => $title_jp,
83 91
     'artists'     => $artists,
84 92
     'circle'      => $circle,
85 93
     'censored'    => $censored,
86 94
     'year'        => NULL,
87 95
     'tags'        => $tags,
88
-    'lang'        => $lang??'Japanese',
96
+    'lang'        => $lang ?? 'Japanese',
89 97
     'pages'       => $json['filecount'],
90 98
     'description' => '',
91 99
     'cover'       => $cover

+ 8
- 6
sections/bookmarks/torrents.php View File

@@ -210,13 +210,15 @@ foreach ($GroupIDs as $GroupID) {
210 210
 
211 211
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? (int)$LoggedUser['CollageCovers'] : 10;
212 212
 $CollagePages = [];
213
-for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
214
-  $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
215
-  $CollagePage = '';
216
-  foreach ($Groups as $Group) {
217
-    $CollagePage .= $Group;
213
+if ($CollageCovers > 0) {
214
+  for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
215
+    $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
216
+    $CollagePage = '';
217
+    foreach ($Groups as $Group) {
218
+      $CollagePage .= $Group;
219
+    }
220
+    $CollagePages[] = $CollagePage;
218 221
   }
219
-  $CollagePages[] = $CollagePage;
220 222
 }
221 223
 
222 224
 View::show_header($Title, 'browse,collage,wall');

+ 4
- 4
sections/collages/edit.php View File

@@ -17,13 +17,13 @@ if ($CategoryID == 0 && $UserID != $LoggedUser['ID'] && !check_perms('site_colla
17 17
   error(403);
18 18
 }
19 19
 
20
-View::show_header('Edit collection');
20
+View::show_header('Edit collection', 'bbcode');
21 21
 
22 22
 if (!empty($Err)) {
23 23
   if (isset($ErrNoEscape)) {
24
-    echo '<div class="save_message error">'.$Err.'</div>';
24
+    echo '<div class="box save_message error">'.$Err.'</div>';
25 25
   } else {
26
-    echo '<div class="save_message error">'.display_str($Err).'</div>';
26
+    echo '<div class="box save_message error">'.display_str($Err).'</div>';
27 27
   }
28 28
 }
29 29
 ?>
@@ -65,7 +65,7 @@ if ($CategoryID > 0 || check_perms('site_collages_delete')) { ?>
65 65
       <tr>
66 66
         <td class="label">Description</td>
67 67
         <td>
68
-          <textarea name="description" id="description" cols="60" rows="10"><?=$Description?></textarea>
68
+          <textarea class="bbcode_editor" name="description" id="description" cols="60" rows="10"><?=$Description?></textarea>
69 69
         </td>
70 70
       </tr>
71 71
       <tr>

+ 2
- 2
sections/collages/new.php View File

@@ -1,5 +1,5 @@
1 1
 <?
2
-View::show_header('Create a collection');
2
+View::show_header('Create a collection', 'bbcode');
3 3
 
4 4
 if (!check_perms('site_collages_renamepersonal')) {
5 5
   $ChangeJS = " onchange=\"if ( this.options[this.selectedIndex].value == '0') { $('#namebox').ghide(); $('#personal').gshow(); } else { $('#namebox').gshow(); $('#personal').ghide(); }\"";
@@ -66,7 +66,7 @@ if (($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('
66 66
       <tr>
67 67
         <td class="label">Description</td>
68 68
         <td>
69
-          <textarea name="description" id="description" cols="60" rows="10"><?=display_str($Description)?></textarea>
69
+          <textarea class="bbcode_editor" name="description" id="description" cols="60" rows="10"><?=display_str($Description)?></textarea>
70 70
         </td>
71 71
       </tr>
72 72
       <tr>

+ 8
- 6
sections/collages/torrent_collage.php View File

@@ -236,13 +236,15 @@ if (!check_perms('site_collages_delete')
236 236
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1));
237 237
 $CollagePages = [];
238 238
 
239
-for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
240
-  $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
241
-  $CollagePage = '';
242
-  foreach ($Groups as $Group) {
243
-    $CollagePage .= $Group;
239
+if ($CollageCovers) {
240
+  for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
241
+    $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
242
+    $CollagePage = '';
243
+    foreach ($Groups as $Group) {
244
+      $CollagePage .= $Group;
245
+    }
246
+    $CollagePages[] = $CollagePage;
244 247
   }
245
-  $CollagePages[] = $CollagePage;
246 248
 }
247 249
 
248 250
 View::show_header($Name, 'browse,collage,bbcode,recommend,wall');

+ 1
- 1
sections/forums/forum.php View File

@@ -152,7 +152,7 @@ $Pages = Format::get_pages($Page, $Forums[$ForumID]['NumTopics'], TOPICS_PER_PAG
152 152
 echo $Pages;
153 153
 ?>
154 154
   </div>
155
-  <table class="forum_index" width="100%">
155
+  <table class="forum_index alternate_rows" width="100%">
156 156
     <tr class="colhead">
157 157
       <td style="width: 2%;"></td>
158 158
       <td>Latest</td>

+ 1
- 1
sections/forums/main.php View File

@@ -23,7 +23,7 @@ foreach ($Forums as $Forum) {
23 23
   </table>
24 24
 <? } ?>
25 25
 <h3><?=$ForumCats[$CategoryID]?></h3>
26
-  <table class="forum_index">
26
+  <table class="forum_index alternate_rows">
27 27
     <tr class="colhead">
28 28
       <td style="width: 2%;"></td>
29 29
       <td style="max-width: 25%;">Forum</td>

+ 10
- 10
sections/login/disabled.php View File

@@ -9,29 +9,29 @@ if (isset($_POST['email']) && FEATURE_EMAIL_REENABLE) {
9 9
     $Output = "Please enter a valid email address.";
10 10
   }
11 11
 
12
-  $Output .= "<br /><br /><a href='login.php?action=disabled'>Back</a>";
12
+  $Output .= "<br><br><a href='login.php?action=disabled'>Back</a>";
13 13
 }
14 14
 
15 15
 if ((empty($_POST['submit']) || empty($_POST['username'])) && !isset($Output)) {
16 16
 ?>
17 17
 <p class="warning">
18
-Your account has been disabled.<br />
19
-This is either due to inactivity or rule violation(s).<br /><br /></p>
18
+Your account has been disabled.<br>
19
+This is either due to inactivity or rule violation(s).<br><br></p>
20 20
 <? if (FEATURE_EMAIL_REENABLE) { ?>
21
-If you believe your account was in good standing and was disabled for inactivity, you may request it be re-enabled via email using the form below.<br />
22
-Please note that you will need access to the email account associated with your account at <?=SITE_NAME?> for this to work;<br />
23
-if you do not, please see the section after this form.<br /><br />
21
+If you believe your account was in good standing and was disabled for inactivity, you may request it be re-enabled via email using the form below.<br>
22
+Please use an email service that actually delivers mail. Outlook/Hotmail is known not to.<br>
23
+Most requests are handled within minutes. If a day or two goes by without a response, try again with a different email or try asking in IRC.<br><br>
24 24
 <form action="" method="POST">
25 25
   <input type="email" class="inputtext" placeholder="Email Address" name="email" required /> <input type="submit" value="Submit" />
26 26
   <input type="hidden" name="username" value="<?=$_COOKIE['username']?>" />
27 27
 </form><br /><br />
28 28
 <? } ?>
29
-If you are unsure why your account is disabled, or you wish to discuss this with staff, come to our IRC network at: <?=BOT_SERVER?><br />
30
-And join <?=BOT_DISABLED_CHAN?><br /><br />
31
-<strong>Be honest.</strong> At this point, lying will get you nowhere.<br /><br /><br />
29
+If you are unsure why your account is disabled, or you wish to discuss this with staff, come to our IRC network at: <?=BOT_SERVER?><br>
30
+And join <?=BOT_DISABLED_CHAN?><br><br>
31
+<strong>Be honest.</strong> At this point, lying will get you nowhere.<br /><br><br>
32 32
 </p>
33 33
 
34
-<strong>Before joining the disabled channel, please read our <br /> <span style="color: gold;">Golden Rules</span> which can be found <a style="color: #1464F4;" href="#" onclick="toggle_visibility('golden_rules')">here</a>.</strong> <br /><br />
34
+<strong>Before joining the disabled channel, please read our <br> <span>Golden Rules</span> which can be found <a style="color: #1464F4;" href="#" onclick="toggle_visibility('golden_rules')">here</a>.</strong> <br><br>
35 35
 
36 36
 <script type="text/javascript">
37 37
 function toggle_visibility(id) {

+ 0
- 1
sections/login/login.php View File

@@ -1,6 +1,5 @@
1 1
 <? View::show_header('Login'); ?>
2 2
   <span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
3
-  <noscript><span class="warning"><?=SITE_NAME?> requires JavaScript to function properly. Please enable JavaScript in your browser.</span><br /><br /></noscript>
4 3
 <?
5 4
 if (!$Banned) {
6 5
 ?>

+ 4
- 5
sections/reports/ajax_add_notes.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-if (!check_perms('site_moderate_forums') || empty($_POST['id'])) {
3
+if (!check_perms('admin_reports') || empty($_POST['id'])) {
4 4
   print
5 5
     json_encode(
6 6
       array(
@@ -12,13 +12,12 @@ if (!check_perms('site_moderate_forums') || empty($_POST['id'])) {
12 12
 
13 13
 $ID = (int)$_POST['id'];
14 14
 
15
-$Notes = str_replace("<br />", "\n", $_POST['notes']);
16
-$Notes = db_string($Notes);
15
+$Notes = $_POST['notes'];
17 16
 
18 17
 $DB->query("
19 18
   UPDATE reports
20
-  SET Notes = '$Notes'
21
-  WHERE ID = '$ID'");
19
+  SET Notes = ?
20
+  WHERE ID = ?", $Notes, $ID);
22 21
 print
23 22
   json_encode(
24 23
     array(

+ 9
- 9
sections/reports/compose.php View File

@@ -1,5 +1,5 @@
1 1
 <?
2
-if (!check_perms('site_moderate_forums')) {
2
+if (!check_perms('admin_reports')) {
3 3
   error(403);
4 4
 }
5 5
 
@@ -30,7 +30,7 @@ if (!empty($LoggedUser['DisablePM']) && !isset($StaffIDs[$ToID])) {
30 30
 $DB->query("
31 31
   SELECT Username
32 32
   FROM users_main
33
-  WHERE ID = '$ToID'");
33
+  WHERE ID = ?", $ToID);
34 34
 list($ComposeToUsername) = $DB->next_record();
35 35
 if (!$ComposeToUsername) {
36 36
   error(404);
@@ -43,7 +43,7 @@ switch ($Type) {
43 43
     $DB->query("
44 44
       SELECT Username
45 45
       FROM users_main
46
-      WHERE ID = $ThingID");
46
+      WHERE ID = ?", $ThingID);
47 47
     if (!$DB->has_results()) {
48 48
       $Error = 'No user with the reported ID found';
49 49
     } else {
@@ -57,7 +57,7 @@ switch ($Type) {
57 57
     $DB->query("
58 58
       SELECT Title
59 59
       FROM requests
60
-      WHERE ID = $ThingID");
60
+      WHERE ID = ?", $ThingID);
61 61
     if (!$DB->has_results()) {
62 62
       $Error = 'No request with the reported ID found';
63 63
     } else {
@@ -70,7 +70,7 @@ switch ($Type) {
70 70
     $DB->query("
71 71
       SELECT Name
72 72
       FROM collages
73
-      WHERE ID = $ThingID");
73
+      WHERE ID = ?", $ThingID);
74 74
     if (!$DB->has_results()) {
75 75
       $Error = 'No collage with the reported ID found';
76 76
     } else {
@@ -83,7 +83,7 @@ switch ($Type) {
83 83
     $DB->query("
84 84
       SELECT Title
85 85
       FROM forums_topics
86
-      WHERE ID = $ThingID");
86
+      WHERE ID = ?", $ThingID);
87 87
     if (!$DB->has_results()) {
88 88
       $Error = 'No forum thread with the reported ID found';
89 89
     } else {
@@ -110,7 +110,7 @@ switch ($Type) {
110 110
             AND p2.ID <= p.ID
111 111
         ) AS PostNum
112 112
       FROM forums_posts AS p
113
-      WHERE p.ID = $ThingID");
113
+      WHERE p.ID = ?", $ThingID);
114 114
     if (!$DB->has_results()) {
115 115
       $Error = 'No forum post with the reported ID found';
116 116
     } else {
@@ -123,7 +123,7 @@ switch ($Type) {
123 123
     $DB->query("
124 124
       SELECT 1
125 125
       FROM comments
126
-      WHERE ID = $ThingID");
126
+      WHERE ID = ?", $ThingID);
127 127
     if (!$DB->has_results()) {
128 128
       $Error = 'No comment with the reported ID found';
129 129
     } else {
@@ -142,7 +142,7 @@ if (isset($Error)) {
142 142
 $DB->query("
143 143
   SELECT Reason
144 144
   FROM reports
145
-  WHERE ID = $ReportID");
145
+  WHERE ID = ?", $ReportID);
146 146
 list($Reason) = $DB->next_record();
147 147
 
148 148
 $Body = "You reported $TypeLink for the reason:\n[quote]{$Reason}[/quote]";

+ 4
- 4
sections/reportsv2/report.php View File

@@ -32,10 +32,10 @@ if (!isset($_GET['id']) || !is_number($_GET['id'])) {
32 32
   }
33 33
 
34 34
   // Group details
35
-  list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameJP, $GroupYear,
36
-    $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID,
37
-    $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
38
-    $Screenshots, $GroupFlags) = array_values($GroupDetails);
35
+  list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP,
36
+    $GroupYear, $GroupStudio, $GroupSeries, $GroupCatalogueNumber,
37
+    $GroupCategoryID, $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs,
38
+    $TorrentTagUserIDs, $Screenshots, $GroupFlags) = array_values($GroupDetails);
39 39
 
40 40
   $DisplayName = $GroupName;
41 41
   $AltName = $GroupName; // Goes in the alt text of the image

+ 1
- 1
sections/requests/new_edit.php View File

@@ -158,7 +158,7 @@ View::show_header(($NewRequest ? 'Create a request' : 'Edit a request'), 'bbcode
158 158
 <?
159 159
       }
160 160
     } else {
161
-?>            <input type="text" id="artist_0" name="artists[]"<? Users::has_autocomplete_enabled('other'); ?> size="45" onblur="CheckVA();" <?=$Disabled?>/>
161
+?>            <input type="text" id="artist_0" name="artists[]"<? Users::has_autocomplete_enabled('other'); ?> size="45" <?=$Disabled?>/>
162 162
 <? if (empty($Disabled)) { ?>
163 163
             <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
164 164
 <? } ?>

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

@@ -252,8 +252,8 @@ if ($NewRequest) {
252 252
     UPDATE requests
253 253
     SET CategoryID = $CategoryID,
254 254
       Title = '".db_string($Title)."',
255
-      TitleRJ = '".db_string($TitleRJ)."',
256
-      TitleJP = '".db_string($TitleJP)."',
255
+      TitleRJ = '".db_string($TitleRJ??"")."',
256
+      TitleJP = '".db_string($TitleJP??"")."',
257 257
       Image = '".db_string($Image)."',
258 258
       Description = '".db_string($Description)."',
259 259
       CatalogueNumber = '".db_string($CatalogueNumber)."',

+ 1
- 2
sections/rules/upload.php View File

@@ -394,7 +394,6 @@ View::show_header('Uploading Rules', 'rules');
394 394
             <li id="r5.1.2"><a href="#5.1"><strong>&uarr;</strong></a> <a href="#5.1.2">5.1.2.</a>
395 395
               <strong>Some examples of acceptable content are:</strong>
396 396
               <ul>
397
-                <li>Erotic Audio</li>
398 397
                 <li>Official Image Packs</li>
399 398
                 <li>Sex Manuals</li>
400 399
               </ul>
@@ -405,7 +404,7 @@ View::show_header('Uploading Rules', 'rules');
405 404
           </ul>
406 405
         </div>
407 406
 
408
-      <h5 id="h5.3"><a href="#h5.3k"><strong>&uarr;</strong></a> <a href="#h5.3">5.3.</a> Duplicates &amp; Trumping</h5>
407
+      <h5 id="h5.2"><a href="#h5.2k"><strong>&uarr;</strong></a> <a href="#h5.2">5.2.</a> Duplicates &amp; Trumping</h5>
409 408
         <div class="box pad" style="padding: 10px 10px 10px 20px;">
410 409
           <ul>
411 410
             <li id="r5.2.1"><a href="#5.2"><strong>&uarr;</strong></a> <a href="#5.2.1">5.2.1.</a>

+ 8
- 4
sections/schedule/hourly/bonus_points.php View File

@@ -3,6 +3,7 @@
3 3
 
4 4
 $getUsers = $DB->query("
5 5
   SELECT um.ID,
6
+         um.BonusPoints,
6 7
          COUNT(DISTINCT x.fid) AS Torrents,
7 8
          SUM(t.Size) AS Size,
8 9
          SUM(xs.seedtime) AS Seedtime,
@@ -21,11 +22,14 @@ $getUsers = $DB->query("
21 22
   GROUP BY um.ID");
22 23
 if ($DB->has_results()) {
23 24
   $QueryPart = '';
24
-  while (list($UserID, $NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record()) {
25
-    $Points = intval((0.5 + (0.55*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3)))**0.95);
25
+  while (list($UserID, $BonusPoints, $NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record()) {
26
+    $Points = (0.5 + (0.55*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3)))**0.95;
27
+    $Points = intval(max(min($Points, ($Points * 2) - ($BonusPoints/1440)), 0));
26 28
     if ($Points > 100000) $Points = 0;
27
-    $QueryPart .= "WHEN $UserID THEN BonusPoints+$Points ";
28
-    $Cache->delete_value('user_info_heavy_'.$UserID);
29
+    if ($Points > 0) {
30
+      $QueryPart .= "WHEN $UserID THEN BonusPoints+$Points ";
31
+      $Cache->delete_value('user_info_heavy_'.$UserID);
32
+    }
29 33
   }
30 34
 
31 35
   $DB->query("

+ 1
- 1
sections/schedule/index.php View File

@@ -27,7 +27,7 @@ function run_all_in($Dir) {
27 27
   }
28 28
 }
29 29
 
30
-if ((!isset($_REQUEST['key']) || $_REQUEST['key'] != SCHEDULE_KEY) && !$AS) {
30
+if ((!isset($_REQUEST['key']) || $_REQUEST['key'] != SCHEDULE_KEY) && (!isset($argv[1]) || $argv[1] != SCHEDULE_KEY) && !$AS) {
31 31
   error(403);
32 32
 }
33 33
 

+ 5
- 2
sections/store/100k_points.php View File

@@ -2,6 +2,9 @@
2 2
 $Purchase = "100,000 bonus points";
3 3
 $UserID = $LoggedUser['ID'];
4 4
 
5
+$GiB = 1024 * 1024 * 1024;
6
+$Cost = 130 * $GiB;
7
+
5 8
 $DB->query("
6 9
   SELECT Uploaded
7 10
   FROM users_main
@@ -9,11 +12,11 @@ $DB->query("
9 12
 if ($DB->has_results()) {
10 13
   list($Upload) = $DB->next_record();
11 14
 
12
-  if ($Upload >= 107374182400) {
15
+  if ($Upload >= $Cost) {
13 16
     $DB->query("
14 17
       UPDATE users_main
15 18
       SET BonusPoints = BonusPoints + 100000,
16
-          Uploaded    = Uploaded - 107374182400
19
+          Uploaded    = Uploaded - $Cost
17 20
       WHERE ID = $UserID");
18 21
     $DB->query("
19 22
       UPDATE users_info

+ 5
- 2
sections/store/10k_points.php View File

@@ -2,6 +2,9 @@
2 2
 $Purchase = "10,000 bonus points";
3 3
 $UserID = $LoggedUser['ID'];
4 4
 
5
+$GiB = 1024 * 1024 * 1024;
6
+$Cost = 13 * $GiB;
7
+
5 8
 $DB->query("
6 9
   SELECT Uploaded
7 10
   FROM users_main
@@ -9,11 +12,11 @@ $DB->query("
9 12
 if ($DB->has_results()) {
10 13
   list($Upload) = $DB->next_record();
11 14
 
12
-  if ($Upload >= 10737418240) {
15
+  if ($Upload >= $Cost) {
13 16
     $DB->query("
14 17
       UPDATE users_main
15 18
       SET BonusPoints = BonusPoints + 10000,
16
-          Uploaded    = Uploaded - 10737418240
19
+          Uploaded    = Uploaded - $Cost
17 20
       WHERE ID = $UserID");
18 21
     $DB->query("
19 22
       UPDATE users_info

+ 5
- 2
sections/store/1k_points.php View File

@@ -2,6 +2,9 @@
2 2
 $Purchase = "1,000 bonus points";
3 3
 $UserID = $LoggedUser['ID'];
4 4
 
5
+$GiB = 1024 * 1024 * 1024;
6
+$Cost = intval(1.3 * $GiB);
7
+
5 8
 $DB->query("
6 9
   SELECT Uploaded
7 10
   FROM users_main
@@ -9,11 +12,11 @@ $DB->query("
9 12
 if ($DB->has_results()) {
10 13
   list($Upload) = $DB->next_record();
11 14
 
12
-  if ($Upload >= 1073741824) {
15
+  if ($Upload >= $Cost) {
13 16
     $DB->query("
14 17
       UPDATE users_main
15 18
       SET BonusPoints = BonusPoints + 1000,
16
-          Uploaded    = Uploaded - 1073741824
19
+          Uploaded    = Uploaded - $Cost
17 20
       WHERE ID = $UserID");
18 21
     $DB->query("
19 22
       UPDATE users_info

+ 3
- 2
sections/store/1m_points.php View File

@@ -3,6 +3,7 @@ $Purchase = "1,000,000 bonus points";
3 3
 $UserID = $LoggedUser['ID'];
4 4
 
5 5
 $GiB = 1024*1024*1024;
6
+$Cost = 1300 * $GiB;
6 7
 
7 8
 $DB->query("
8 9
   SELECT Uploaded
@@ -11,11 +12,11 @@ $DB->query("
11 12
 if ($DB->has_results()) {
12 13
   list($Upload) = $DB->next_record();
13 14
 
14
-  if ($Upload >= 1000*$GiB) {
15
+  if ($Upload >= $Cost) {
15 16
     $DB->query("
16 17
       UPDATE users_main
17 18
       SET BonusPoints = BonusPoints + 1000000,
18
-          Uploaded    = Uploaded - ".(1000*$GiB)."
19
+          Uploaded    = Uploaded - $Cost
19 20
       WHERE ID = $UserID");
20 21
     $DB->query("
21 22
       UPDATE users_info

+ 14
- 13
sections/store/store.php View File

@@ -3,9 +3,10 @@ $UserID = $LoggedUser['ID'];
3 3
 $PermID = $LoggedUser['PermissionID'];
4 4
 
5 5
 if (!$LoggedUser['DisablePoints']) {
6
-  $PointsRate = 0.5;
6
+  $PointsRate = 0;
7 7
   $getTorrents = $DB->query("
8
-    SELECT COUNT(DISTINCT x.fid) AS Torrents,
8
+    SELECT um.BonusPoints,
9
+           COUNT(DISTINCT x.fid) AS Torrents,
9 10
            SUM(t.Size) AS Size,
10 11
            SUM(xs.seedtime) AS Seedtime,
11 12
            SUM(t.Seeders) AS Seeders
@@ -22,10 +23,10 @@ if (!$LoggedUser['DisablePoints']) {
22 23
       AND x.Remaining = 0
23 24
     GROUP BY um.ID", $UserID);
24 25
   if ($DB->has_results()) {
25
-    list($NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
26
-    $PointsRate += (0.55*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3));
26
+    list($BonusPoints, $NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
27
+    $PointsRate = (0.5 + (0.55*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3)))**0.95;
27 28
   }
28
-  $PointsRate = intval($PointsRate**0.95);
29
+  $PointsRate = intval(max(min($PointsRate, ($PointsRate * 2) - ($BonusPoints/1440)), 0));
29 30
   $PointsPerHour = number_format($PointsRate) . " ".BONUS_POINTS."/hour";
30 31
   $PointsPerDay = number_format($PointsRate*24) . " ".BONUS_POINTS."/day";
31 32
 } else {
@@ -52,7 +53,7 @@ View::show_header('Store');
52 53
           <a href="store.php?item=upload_1GB">1GiB Upload</a>
53 54
         </td>
54 55
         <td class="nobr">
55
-          1,000 <?=BONUS_POINTS?>
56
+          1,300 <?=BONUS_POINTS?>
56 57
         </td>
57 58
         <td class="nobr">
58 59
           Purchase 1GiB of upload
@@ -63,7 +64,7 @@ View::show_header('Store');
63 64
           <a href="store.php?item=upload_10GB">10GiB Upload</a>
64 65
         </td>
65 66
         <td class="nobr">
66
-          10,000 <?=BONUS_POINTS?>
67
+          13,000 <?=BONUS_POINTS?>
67 68
         </td>
68 69
         <td class="nobr">
69 70
           Purchase 10GiB of upload
@@ -74,7 +75,7 @@ View::show_header('Store');
74 75
           <a href="store.php?item=upload_100GB">100GiB Upload</a>
75 76
         </td>
76 77
         <td class="nobr">
77
-          100,000 <?=BONUS_POINTS?>
78
+          130,000 <?=BONUS_POINTS?>
78 79
         </td>
79 80
         <td class="nobr">
80 81
           Purchase 100GiB of upload
@@ -85,7 +86,7 @@ View::show_header('Store');
85 86
           <a href="store.php?item=upload_1000GB">1,000GiB Upload</a>
86 87
         </td>
87 88
         <td class="nobr">
88
-          1,000,000 <?=BONUS_POINTS?>
89
+          1,300,000 <?=BONUS_POINTS?>
89 90
         </td>
90 91
         <td class="nobr">
91 92
           Purchase 1,000GiB of upload
@@ -96,7 +97,7 @@ View::show_header('Store');
96 97
           <a href="store.php?item=1k_points">1,000 <?=BONUS_POINTS?></a>
97 98
         </td>
98 99
         <td class="nobr">
99
-          1GiB Upload
100
+          1.3GiB Upload
100 101
         </td>
101 102
         <td class="nobr">
102 103
           Purchase 1,000 <?=BONUS_POINTS?>
@@ -107,7 +108,7 @@ View::show_header('Store');
107 108
           <a href="store.php?item=10k_points">10,000 <?=BONUS_POINTS?></a>
108 109
         </td>
109 110
         <td class="nobr">
110
-          10GiB Upload
111
+          13GiB Upload
111 112
         </td>
112 113
         <td class="nobr">
113 114
           Purchase 10,000 <?=BONUS_POINTS?>
@@ -118,7 +119,7 @@ View::show_header('Store');
118 119
           <a href="store.php?item=100k_points">100,000 <?=BONUS_POINTS?></a>
119 120
         </td>
120 121
         <td class="nobr">
121
-          100GiB Upload
122
+          130GiB Upload
122 123
         </td>
123 124
         <td class="nobr">
124 125
           Purchase 100,000 <?=BONUS_POINTS?>
@@ -129,7 +130,7 @@ View::show_header('Store');
129 130
           <a href="store.php?item=1m_points">1,000,000 <?=BONUS_POINTS?></a>
130 131
         </td>
131 132
         <td class="nobr">
132
-          1,000GiB Upload
133
+          1,300GiB Upload
133 134
         </td>
134 135
         <td class="nobr">
135 136
           Purchase 1,000,000 <?=BONUS_POINTS?>

+ 3
- 2
sections/store/upload_1000GB.php View File

@@ -1,6 +1,7 @@
1 1
 <?
2 2
 $Purchase = "1000GiB of upload";
3 3
 $UserID = $LoggedUser['ID'];
4
+$Cost = 1300000;
4 5
 
5 6
 $DB->query("
6 7
   SELECT BonusPoints
@@ -9,10 +10,10 @@ $DB->query("
9 10
 if ($DB->has_results()) {
10 11
   list($Points) = $DB->next_record();
11 12
 
12
-  if ($Points >= 1000000) {
13
+  if ($Points >= $Cost) {
13 14
     $DB->query("
14 15
       UPDATE users_main
15
-      SET BonusPoints = BonusPoints - 1000000,
16
+      SET BonusPoints = BonusPoints - $Cost,
16 17
           Uploaded    = Uploaded + 1073741824000
17 18
       WHERE ID = $UserID");
18 19
     $DB->query("

+ 3
- 2
sections/store/upload_100GB.php View File

@@ -1,6 +1,7 @@
1 1
 <?
2 2
 $Purchase = "100GiB of upload";
3 3
 $UserID = $LoggedUser['ID'];
4
+$Cost = 130000;
4 5
 
5 6
 $DB->query("
6 7
   SELECT BonusPoints
@@ -9,10 +10,10 @@ $DB->query("
9 10
 if ($DB->has_results()) {
10 11
   list($Points) = $DB->next_record();
11 12
 
12
-  if ($Points >= 100000) {
13
+  if ($Points >= $Cost) {
13 14
     $DB->query("
14 15
       UPDATE users_main
15
-      SET BonusPoints = BonusPoints - 100000,
16
+      SET BonusPoints = BonusPoints - $Cost,
16 17
           Uploaded    = Uploaded + 107374182400
17 18
       WHERE ID = $UserID");
18 19
     $DB->query("

+ 3
- 2
sections/store/upload_10GB.php View File

@@ -1,6 +1,7 @@
1 1
 <?
2 2
 $Purchase = "10GiB of upload";
3 3
 $UserID = $LoggedUser['ID'];
4
+$Cost = 13000;
4 5
 
5 6
 $DB->query("
6 7
   SELECT BonusPoints
@@ -9,10 +10,10 @@ $DB->query("
9 10
 if ($DB->has_results()) {
10 11
   list($Points) = $DB->next_record();
11 12
 
12
-  if ($Points >= 10000) {
13
+  if ($Points >= $Cost) {
13 14
     $DB->query("
14 15
       UPDATE users_main
15
-      SET BonusPoints = BonusPoints - 10000,
16
+      SET BonusPoints = BonusPoints - $Cost,
16 17
           Uploaded    = Uploaded + 10737418240
17 18
       WHERE ID = $UserID");
18 19
     $DB->query("

+ 3
- 2
sections/store/upload_1GB.php View File

@@ -1,6 +1,7 @@
1 1
 <?
2 2
 $Purchase = "1GiB of upload";
3 3
 $UserID = $LoggedUser['ID'];
4
+$Cost = 1300;
4 5
 
5 6
 $DB->query("
6 7
   SELECT BonusPoints
@@ -9,10 +10,10 @@ $DB->query("
9 10
 if ($DB->has_results()) {
10 11
   list($Points) = $DB->next_record();
11 12
 
12
-  if ($Points >= 1000) {
13
+  if ($Points >= $Cost) {
13 14
     $DB->query("
14 15
       UPDATE users_main
15
-      SET BonusPoints = BonusPoints - 1000,
16
+      SET BonusPoints = BonusPoints - $Cost,
16 17
           Uploaded    = Uploaded + 1073741824
17 18
       WHERE ID = $UserID");
18 19
     $DB->query("

+ 1
- 1
sections/tools/development/misc_values.php View File

@@ -40,7 +40,7 @@ if (isset($_POST['submit'])) {
40 40
   $Name = db_string($_POST['name']);
41 41
         $DB->query("DELETE FROM misc WHERE Name = '" . $Name . "'");
42 42
     } else {
43
-        $Val->SetFields('name', '1', 'regex', 'The name must be separated by underscores. No spaces are allowed.', array('regex' => '/^[a-z][_a-z0-9]{0,63}$/i'));
43
+        $Val->SetFields('name', '1', 'regex', 'The name must be separated by underscores. No spaces are allowed.', array('regex' => '/^[a-z][:_a-z0-9]{0,63}$/i'));
44 44
         $Val->SetFields('first', '1', 'string', 'You must specify the first value.');
45 45
         $Val->SetFields('second', '1', 'string', 'You must specify the second value.');
46 46
 

+ 3
- 3
sections/tools/managers/enable_requests.php View File

@@ -312,9 +312,9 @@ if ($NumResults > 0) { ?>
312 312
 ?>
313 313
     </div>
314 314
 <div style="padding-bottom: 11px;">
315
-    <input type="submit" id="outcome" value="Approve Selected" />
316
-    <input type="submit" id="outcome" value="Reject Selected" />
317
-    <input type="submit" id="outcome" value="Discard Selected" />
315
+    <input type="submit" id="multi" value="Approve Selected" />
316
+    <input type="submit" id="multi" value="Reject Selected" />
317
+    <input type="submit" id="multi" value="Discard Selected" />
318 318
 </div>
319 319
 <? } else { ?>
320 320
     <h2 align="center">No new pending auto enable requests<?=($_GET['view'] == 'main') ? '' : ' in this view'?></h2>

+ 50
- 19
sections/tools/misc/tags.php View File

@@ -5,18 +5,19 @@ if (!check_perms('users_mod')) {
5 5
 }
6 6
 
7 7
 // validation functions
8
-$Val->SetFields('tag', true, 'string', 'Enter a single tag to search for.', array('maxlength'=>'200', 'minlength'=>'2'));
9
-$Val->SetFields('replace', true, 'string', 'Enter a single replacement tag.', array('maxlength'=>'200', 'minlength'=>'2'));
8
+$Val->SetFields('tag', true, 'string', 'Enter a single tag to search for.', ['maxlength'=>'200', 'minlength'=>'2']);
9
+$Val->SetFields('replace', false, 'string', 'Enter a single replacement tag.', ['maxlength'=>'200', 'minlength'=>'2']);
10 10
 
11 11
 echo $Val->GenerateJS('tagform');
12 12
 
13 13
 // some constants to make programmers' lives easier
14 14
 define('MODE_RENAME', 0);
15 15
 define('MODE_MERGE', 1);
16
+define('MODE_DELETE', 2);
16 17
 
17 18
 ?>
18 19
 <div class="thin">
19
-  <h3>Merge/Rename Tags</h3>
20
+  <h3>Merge/Rename/Delete Tags</h3>
20 21
   <form action="tools.php" method="get" name="tagform" id="tagform" onsubmit="return formVal();">
21 22
     <input type="hidden" name="action" value="edit_tags" />
22 23
     <table>
@@ -28,7 +29,7 @@ define('MODE_MERGE', 1);
28 29
           <input type="text" name="tag" id="tag" />
29 30
         </td>
30 31
         <td class="label">
31
-          Rename to/merge with tag:
32
+          Rename to/merge with tag (empty to delete):
32 33
         </td>
33 34
         <td>
34 35
           <input type="text" name="replace" id="replace" />
@@ -39,7 +40,7 @@ define('MODE_MERGE', 1);
39 40
       </tr>
40 41
       <tr>
41 42
         <td class="center" colspan="5">
42
-          <input type="submit" value="Rename/Merge Tags" />
43
+          <input type="submit" value="Process Tag" />
43 44
         </td>
44 45
       </tr>
45 46
     </table>
@@ -74,8 +75,8 @@ if (isset($_GET['tag']) || isset($_GET['replace'])) {
74 75
     $DB->query("
75 76
       SELECT ID
76 77
       FROM tags
77
-      WHERE Name = '$Tag'
78
-      LIMIT 1;");
78
+      WHERE Name = ?
79
+      LIMIT 1", $Tag);
79 80
     if (!$DB->has_results()) {
80 81
       echo "
81 82
         <div class=\"box pad center\">
@@ -88,17 +89,22 @@ if (isset($_GET['tag']) || isset($_GET['replace'])) {
88 89
     list($TagID) = $DB->next_record();
89 90
 
90 91
     // 2) check if replacement exists
91
-    $DB->query("
92
-      SELECT ID
93
-      FROM tags
94
-      WHERE Name = '$Replacement'
95
-      LIMIT 1;");
96
-    if (!$DB->has_results() ) {
97
-      $Mode = MODE_RENAME;
92
+    $ReplacementID = null;
93
+    if ($Replacement) {
94
+      $DB->query("
95
+        SELECT ID
96
+        FROM tags
97
+        WHERE Name = ?
98
+        LIMIT 1", $Replacement);
99
+      if (!$DB->has_results() ) {
100
+        $Mode = MODE_RENAME;
101
+        list($ReplacementID) = $DB->next_record();
102
+      } else {
103
+        $Mode = MODE_MERGE;
104
+      }
98 105
     } else {
99
-      $Mode = MODE_MERGE;
106
+      $Mode = MODE_DELETE;
100 107
     }
101
-    list($ReplacementID) = $DB->next_record();
102 108
 
103 109
     if ($_GET['list']) {
104 110
       $AffectedTorrents = [];
@@ -113,7 +119,7 @@ if (isset($_GET['tag']) || isset($_GET['replace'])) {
113 119
           LEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID
114 120
           LEFT JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID
115 121
           JOIN torrents_tags AS t ON t.GroupID = tg.ID
116
-        WHERE t.TagID = $TagID;");
122
+        WHERE t.TagID = ?", $TagID);
117 123
       while (list($TorrentID, $ArtistID, $ArtistName, $TorrentName) = $DB->next_record()) {
118 124
         $Row = ($ArtistName ? "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a> - " : '');
119 125
         $Row.= "<a href=\"torrents.php?id=$TorrentID\">".display_str($TorrentName).'</a>';
@@ -131,7 +137,7 @@ if (isset($_GET['tag']) || isset($_GET['replace'])) {
131 137
           LEFT JOIN requests_artists AS ra ON r.ID = ra.RequestID
132 138
           LEFT JOIN artists_group AS ag ON ag.ArtistID = ra.ArtistID
133 139
           JOIN requests_tags AS t ON t.RequestID = r.ID
134
-        WHERE t.TagID = $TagID;");
140
+        WHERE t.TagID = ?", $TagID);
135 141
       while (list($RequestID, $ArtistID, $ArtistName, $RequestName) = $DB->next_record()) {
136 142
         $Row = ($ArtistName ? "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a> - " : '');
137 143
         $Row.= "<a href=\"requests.php?action=viewrequest&amp;id=$RequestID\">".display_str($RequestName).'</a>';
@@ -160,7 +166,32 @@ if (isset($_GET['tag']) || isset($_GET['replace'])) {
160 166
           Torrents::update_hash($GroupID);
161 167
         }
162 168
       }
163
-    } else {
169
+    } elseif ($Mode == MODE_DELETE) {
170
+      // EASY! just delete the tag
171
+      // 5) delete the tag
172
+      $DB->query("
173
+        DELETE FROM tags
174
+        WHERE ID = ?", $TagID);
175
+
176
+      // 6) get a list of the affected groups
177
+      $DB->query("
178
+        SELECT GroupID
179
+        FROM torrents_tags
180
+        WHERE TagID = ?", $TagID);
181
+      $AffectedGroups = $DB->to_array();
182
+
183
+      // 7) remove the tag from the groups
184
+      $DB->query("
185
+        DELETE FROM torrents_tags
186
+        WHERE TagID = ?", $TagID);
187
+      $TotalAffected = $DB->affected_rows();
188
+
189
+      // 8) update the newly tagless groups
190
+      foreach ($AffectedGroups as $AffectedGroup) {
191
+        list($GroupID) = $AffectedGroup;
192
+        Torrents::update_hash($GroupID);
193
+      }
194
+    } elseif ($Mode == MODE_MERGE) {
164 195
       // HARD! merge two tags together and update usage
165 196
       // 5) remove dupe tags from torrents
166 197
       //  (torrents that have both "old tag" and "replacement tag" set)

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

@@ -506,7 +506,7 @@ foreach ($TorrentList as $Torrent) {
506 506
   if (!empty(G::$LoggedUser) && (G::$LoggedUser['ShowMagnets'] ?? false)) {
507 507
     if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
508 508
       $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
509
-      $Tor = new BencodeTorrent($TorrentFile);
509
+      $Tor = new BencodeTorrent($TorrentFile, false, false);
510 510
       $TorrentFileName = $Tor->Dec['info']['name'];
511 511
       $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
512 512
     }

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

@@ -65,7 +65,7 @@ if (($LoggedUser['ID'] != $Properties['UserID'] && !check_perms('torrents_edit')
65 65
   error(403);
66 66
 }
67 67
 
68
-View::show_header('Edit torrent', 'upload,torrent');
68
+View::show_header('Edit torrent', 'upload,torrent,bbcode');
69 69
 
70 70
 $TorrentForm = new TorrentForm($Properties, $Err, false);
71 71
 

+ 3
- 17
sections/torrents/editgroup.php View File

@@ -64,13 +64,13 @@ if (!$Body) {
64 64
   $Image = $WikiImage;
65 65
 }
66 66
 
67
-View::show_header('Edit torrent group', 'upload');
67
+View::show_header('Edit torrent group', 'upload,bbcode');
68 68
 
69 69
 // Start printing form
70 70
 ?>
71 71
 <div class="thin">
72 72
   <div class="header">
73
-    <h2>Edit <a href="torrents.php?id=<?=$GroupID?>"><?=$Name?></a></h2>
73
+    <h2>Edit <a href="torrents.php?id=<?=$GroupID?>"><?=($Name ? $Name : ($NameRJ ? $NameRJ : $NameJP))?></a></h2>
74 74
   </div>
75 75
   <div class="box pad">
76 76
     <form class="edit_form" name="torrent_group" action="torrents.php" method="post">
@@ -81,22 +81,8 @@ View::show_header('Edit torrent group', 'upload');
81 81
         <h3>Image:</h3>
82 82
         <input type="text" name="image" size="92" value="<?=$Image?>" /><br />
83 83
         <h3>Torrent group description:</h3>
84
-        <textarea name="body" cols="91" rows="20"><?=$Body?></textarea><br />
85
-<?/*  if ($CategoryID == 1) { ?>
86
-        <h3>Release type:
87
-          <select id="releasetype" name="releasetype">
88
-<?    foreach ($ReleaseTypes as $Key => $Val) { ?>
89
-            <option value="<?=$Key?>"<?=($Key == $ReleaseType ? ' selected="selected"' : '')?>><?=$Val?></option>
90
-<?    } ?>
91
-          </select>
92
-        </h3>
93
-<?    if (check_perms('torrents_edit_vanityhouse')) { ?>
94
-        <h3>
95
-          <label>Vanity House: <input type="checkbox" name="vanity_house" value="1" <?=($VanityHouse ? 'checked="checked" ' : '')?>/></label>
96
-        </h3>
84
+        <textarea class="bbcode_editor" name="body" cols="91" rows="20"><?=$Body?></textarea><br />
97 85
 <?
98
-    }
99
-  }*/
100 86
   $DB->query("
101 87
     SELECT UserID
102 88
     FROM torrents

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

@@ -413,7 +413,17 @@ function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $G
413 413
         <tr class="<?=(isset($ReleaseType)?'releases_'.$ReleaseType:'')?> groupid_<?=($GroupID)?> edition_<?=($EditionID)?> torrentdetails pad<? if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?> hidden<? } ?>" id="torrent_<?=($TorrentID)?>">
414 414
           <td colspan="5">
415 415
             <blockquote>
416
-              Uploaded by <?=(Users::format_username($UserID, false, false, false))?> <?=time_diff($TorrentTime);?>
416
+              Uploaded by <?
417
+  if ($Anonymous) {
418
+    if (check_perms('users_mod')) { ?>
419
+      <em class="tooltip" title="<?=Users::user_info($UserID)['Username']?>">Anonymous</em>
420
+<?  } else {
421
+      ?><em>Anonymous</em><?
422
+    }
423
+  } else {
424
+    print (Users::format_username($UserID, false, false, false));
425
+  }
426
+?> <?=time_diff($TorrentTime);?>
417 427
 <?  if ($Seeders == 0) {
418 428
     if ($LastActive && time() - strtotime($LastActive) >= 1209600) { ?>
419 429
                 <br /><strong>Last active: <?=time_diff($LastActive);?></strong>

+ 2
- 1
sections/torrents/notify.php View File

@@ -248,6 +248,7 @@ if (empty($Results)) {
248 248
         // If $GroupInfo['ID'] is unset, the torrent group associated with the torrent doesn't exist
249 249
         continue;
250 250
       }
251
+      $GroupName = empty($GroupInfo['Name']) ? (empty($GroupInfo['NameRJ']) ? $GroupInfo['NameJP'] : $GroupInfo['NameRJ']) : $GroupInfo['Name'];
251 252
       $TorrentInfo = $GroupInfo['Torrents'][$TorrentID];
252 253
       // generate torrent's title
253 254
       $DisplayName = '';
@@ -267,7 +268,7 @@ if (empty($Results)) {
267 268
       if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
268 269
          $DisplayName .= 'data-cover="'.ImageTools::process($GroupInfo['WikiImage'], 'thumb').'" ';
269 270
       }
270
-      $DisplayName .= "class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">" . $GroupInfo['Name'] . '</a>';
271
+      $DisplayName .= "class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">" . $GroupName . '</a>';
271 272
 
272 273
       $GroupCategoryID = $GroupInfo['CategoryID'];
273 274
 /*

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

@@ -92,11 +92,11 @@ if (isset($Properties['GroupID'])) {
92 92
 
93 93
 if ($Type == 'Movies' || $Type == 'Manga' || $Type == 'Anime' || $Type == 'Games') {
94 94
   if (empty($_POST['idols'])) {
95
-    $Err = "You didn't enter any goils";
95
+    $Err = "You didn't enter any artists/idols";
96 96
   } else {
97 97
     $Artists = $_POST['idols'];
98 98
   }
99
-} elseif ($Type == 'Other') {
99
+} else {
100 100
   if (!empty($_POST['idols'])) {
101 101
     $Artists = $_POST['idols'];
102 102
   }
@@ -211,8 +211,8 @@ if (empty($Properties['GroupID']) && empty($ArtistForm)) {
211 211
     SELECT ta.ArtistID, ag.Name
212 212
     FROM torrents_artists AS ta
213 213
       JOIN artists_group AS ag ON ta.ArtistID = ag.ArtistID
214
-    WHERE ta.GroupID = ".$Properties['GroupID']."
215
-    ORDER BY ag.Name ASC;");
214
+    WHERE ta.GroupID = ?
215
+    ORDER BY ag.Name ASC", $Properties['GroupID']);
216 216
   $ArtistForm = [];
217 217
   while (list($ArtistID, $ArtistName) = $DB->next_record(MYSQLI_BOTH, false)) {
218 218
     array_push($ArtistForm, array('id' => $ArtistID, 'name' => display_str($ArtistName)));
@@ -468,6 +468,9 @@ if (!$T['GroupID']) {
468 468
 
469 469
 
470 470
 // Use this section to control freeleeches
471
+$T['FreeTorrent'] = '0';
472
+$T['FreeLeechType'] = '0';
473
+
471 474
 $DB->query("
472 475
   SELECT Name, First, Second
473 476
   FROM misc
@@ -481,9 +484,6 @@ if ($DB->has_results()) {
481 484
       break;
482 485
     }
483 486
   }
484
-} else {
485
-  $T['FreeTorrent'] = '0';
486
-  $T['FreeLeechType'] = '0';
487 487
 }
488 488
 
489 489
 // movie and anime ISOs are neutral leech, and receive a BP bounty
@@ -525,7 +525,7 @@ $Debug->set_flag('upload: ocelot updated');
525 525
 $Cache->cache_value("torrent_{$TorrentID}_lock", true, 600);
526 526
 
527 527
 //give BP if necessary
528
-if (($Type == "Movies" || $Type == "Anime") && ($T['Container'] == "'ISO'" || $T['Container'] == "'M2TS'" || $T['Container'] == "'VOB IFO'")) {
528
+if (($Type == "Movies" || $Type == "Anime") && ($T['Container'] == 'ISO' || $T['Container'] == 'M2TS' || $T['Container'] == 'VOB IFO')) {
529 529
   $BPAmt = (int) 2*($TotalSize / (1024*1024*1024))*1000;
530 530
 
531 531
   $DB->query("

+ 1
- 1
sections/user/invite.php View File

@@ -108,7 +108,7 @@ View::show_header('Invites', $JSIncludes);
108 108
       <a href="user.php?action=invitetree<? if ($Sneaky) { echo '&amp;userid='.$UserID; } ?>" class="brackets">Invite tree</a>
109 109
     </div>
110 110
   </div>
111
-<? if ($UserCount >= USER_LIMIT && USER_LIMIT != 0 && !check_perms('site_can_invite_always')) { ?>
111
+<? if ($UserCount >= USER_LIMIT && !check_perms('site_can_invite_always')) { ?>
112 112
   <div class="box pad notice">
113 113
     <p>Because the user limit has been reached you are unable to send invites at this time.</p>
114 114
   </div>

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

@@ -237,7 +237,7 @@ if (check_perms('admin_manage_permissions', $Class)) {
237 237
     <a href="user.php?action=permissions&amp;userid=<?=$UserID?>" class="brackets">Permissions</a>
238 238
 <?
239 239
 }
240
-if (check_perms('users_view_ips', $Class)) {
240
+if ($LoggedUser['ID'] == $UserID || check_perms('users_view_ips', $Class)) {
241 241
 ?>
242 242
     <a href="user.php?action=sessions&amp;userid=<?=$UserID?>" class="brackets">Sessions</a>
243 243
 <?
@@ -1178,7 +1178,7 @@ if (check_perms('users_mod', $Class)) { ?>
1178 1178
           <input type="text" size="20" name="BonusPoints" value="<?=$BonusPoints?>" />
1179 1179
 <?
1180 1180
 if (!$DisablePoints) {
1181
-  $PointsRate = 0.5;
1181
+  $PointsRate = 0;
1182 1182
   $getTorrents = $DB->query("
1183 1183
     SELECT COUNT(DISTINCT x.fid) AS Torrents,
1184 1184
            SUM(t.Size) AS Size,
@@ -1198,9 +1198,9 @@ if (!$DisablePoints) {
1198 1198
     GROUP BY um.ID");
1199 1199
   if ($DB->has_results()) {
1200 1200
     list($NumTorr, $TSize, $TTime, $TSeeds) = $DB->next_record();
1201
-    $PointsRate += (0.67*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3));
1201
+    $PointsRate = (0.5 + (0.55*($NumTorr * (sqrt(($TSize/$NumTorr)/1073741824) * pow(1.5,($TTime/$NumTorr)/(24*365))))) / (max(1, sqrt(($TSeeds/$NumTorr)+4)/3)))**0.95;
1202 1202
   }
1203
-  $PointsRate = intval($PointsRate**0.95);
1203
+  $PointsRate = intval(max(min($PointsRate, ($PointsRate * 2) - ($BonusPoints/1440)), 0));
1204 1204
   $PointsPerHour = number_format($PointsRate)." ".BONUS_POINTS."/hour";
1205 1205
   $PointsPerDay = number_format($PointsRate*24)." ".BONUS_POINTS."/day";
1206 1206
 } else {

+ 1
- 1
sections/userhistory/email_history_userview.php View File

@@ -55,7 +55,7 @@ if (!$Self) {
55 55
   <h2>Email history for <a href="user.php?id=<?=$UserID ?>"><?=$Username ?></a></h2>
56 56
 <? } ?>
57 57
 </div>
58
-<table width="100%">
58
+<table class="alternate_rows" width="100%">
59 59
   <tr class="colhead">
60 60
     <td>Email</td>
61 61
     <td>Expunge</td>

+ 1
- 1
sections/userhistory/ip_history_userview.php View File

@@ -55,7 +55,7 @@ if (!$Self) {
55 55
   <h2>IP history for <a href="user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
56 56
 <? } ?>
57 57
 </div>
58
-<table width="100%">
58
+<table class="alternate_rows" width="100%">
59 59
   <tr class="colhead">
60 60
     <td>IP</td>
61 61
     <td>Expunge</td>

+ 6
- 1
sections/userhistory/subscribed_collages.php View File

@@ -167,7 +167,12 @@ if (!$NumResults) {
167 167
         $TorrentID = key($Torrents);
168 168
         $Torrent = current($Torrents);
169 169
 
170
-        $DisplayName = "<a class=\"torrent_title\" href=\"torrents.php?id=$GroupID\" ";
170
+        $DisplayName = '';
171
+
172
+        if (isset($Artists)) {
173
+          $DisplayName .= '<div class="torrent_artists">'.Artists::display_artists($Artists).'</div> ';
174
+        }
175
+        $DisplayName .= "<a class=\"torrent_title\" href=\"torrents.php?id=$GroupID\" ";
171 176
         if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
172 177
           $DisplayName .= 'data-cover="'.ImageTools::process($WikiImage).'" ';
173 178
         }

+ 1
- 1
sections/userhistory/subscriptions.php View File

@@ -230,7 +230,7 @@ if (!$NumResults) {
230 230
     <tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>">
231 231
 <?      if (Users::has_avatars_enabled()) { ?>
232 232
       <td class="avatar" valign="top">
233
-        <?=Users::show_avatar($Result['LastReadAvatar'], $Result['LastReadUsername'], $HeavyInfo['DisableAvatars'])?>
233
+        <?=Users::show_avatar($Result['LastReadAvatar'], $Result['LastReadUserID'], $Result['LastReadUsername'], $HeavyInfo['DisableAvatars'])?>
234 234
       </td>
235 235
 <?      } ?>
236 236
       <td class="body" valign="top">

+ 1
- 1
sections/wiki/article.php View File

@@ -48,7 +48,7 @@ View::show_header($Title,'wiki,bbcode');
48 48
     <div class="linkbox">
49 49
       <a href="wiki.php?action=create" class="brackets">Create</a>
50 50
 <? if ($Edit <= $LoggedUser['EffectiveClass']) { ?>
51
-      <a href="wiki.php?action=edit&amp;id=<?=$ArticleID?>" class="brackets">Contribute</a>
51
+      <a href="wiki.php?action=edit&amp;id=<?=$ArticleID?>" class="brackets">Edit</a>
52 52
       <a href="wiki.php?action=revisions&amp;id=<?=$ArticleID?>" class="brackets">History</a>
53 53
 <? } ?>
54 54
 <? if (check_perms('admin_manage_wiki') && $_GET['id'] != INDEX_ARTICLE) { ?>

+ 0
- 7
static/functions/browse.js View File

@@ -274,10 +274,3 @@ function ToggleEditionRows() {
274 274
   $('#edition_label').gtoggle();
275 275
   $('#edition_catalogue').gtoggle();
276 276
 }
277
-
278
-$(function() {
279
-  if (!$('.group').length) {
280
-    var els = $('#torrent_table.grouping .colhead td:first-child(), #torrent_table.grouping .colhead_dark td:first-child(), #torrent_table.grouping .torrent td:first-child()')
281
-    for (var i = 0; i < els.length; i++) { els[i].style.display = 'none' }
282
-  }
283
-})

+ 1
- 0
static/functions/comments.js View File

@@ -401,6 +401,7 @@ $(document).ready(function() {
401 401
               par.raw().style.height = par.height()+'px'
402 402
           }
403 403
       })
404
+      if (this.complete) $(this).load()
404 405
     }
405 406
 
406 407
   })

+ 11
- 1
static/functions/global.js View File

@@ -29,7 +29,7 @@ function ratio(a, b) {
29 29
 
30 30
 function save_message(message, err = false) {
31 31
   var messageDiv = document.createElement("div");
32
-  messageDiv.className = err ? "error_message" : "save_message";
32
+  messageDiv.className = err ? "error_message box" : "save_message box";
33 33
   messageDiv.innerHTML = message;
34 34
   $("#content").raw().insertBefore(messageDiv,$("#content").raw().firstChild);
35 35
 }
@@ -360,3 +360,13 @@ $(function() {
360 360
     lightbox.init((e.target.attributes['lightbox-img']||[]).value||e.target.src, (e.target.attributes['lightbox-size']||[]).value||e.target.width)
361 361
   })
362 362
 })
363
+
364
+/*
365
+if ('serviceWorker' in navigator) {
366
+  navigator.serviceWorker.register('sw.js').then(reg => {
367
+    reg.update()
368
+  }).catch(err => {
369
+    console.log("Failed to register service worker: ", err)
370
+  })
371
+}
372
+*/

+ 0
- 1
static/functions/reports.js View File

@@ -10,7 +10,6 @@ function toggleNotes(id) {
10 10
 
11 11
 function saveNotes(id) {
12 12
   var notes = $('#notes_' + id).raw().value;
13
-  notes = notes.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '<br />');
14 13
   var post = new Array();
15 14
   post['id'] = id;
16 15
   post['notes'] = notes;

+ 4
- 0
static/functions/requests.js View File

@@ -139,6 +139,10 @@ function Categories() {
139 139
     $('#artist_tr').gshow();
140 140
     $('#dlsiteid_tr').gshow();
141 141
     $('#cataloguenumber_tr').ghide();
142
+  } else if (cat == "Audio") {
143
+    $('#artist_tr').gshow();
144
+    $('#dlsiteid_tr').ghide();
145
+    $('#cataloguenumber_tr').ghide();
142 146
   } else {
143 147
     $('#artist_tr').ghide();
144 148
     $('#cataloguenumber_tr').ghide();

+ 1
- 1
static/functions/u2f.js View File

@@ -498,7 +498,7 @@ $(function() {
498 498
     var req = JSON.parse($('[name="u2f-request"]').raw().value);
499 499
     var sigs = JSON.parse($('[name="u2f-sigs"]').raw().value);
500 500
     if (req) {
501
-      u2f.register(req.appID, [req], sigs, function(data) {
501
+      u2f.register(req.appId, [req], sigs, function(data) {
502 502
         if (data.errorCode) {
503 503
           console.log('U2F Register Error: ' + Object.keys(u2f.ErrorCodes).find(k => u2f.ErrorCodes[k] == data.errorCode));
504 504
           return;

+ 11
- 0
static/functions/upload.js View File

@@ -65,6 +65,17 @@ function Categories() {
65 65
     'screenshots': {name: 'Screenshots', notes: '<strong class="important_text">Promotional materials from a game\'s store page are NOT screenshots</strong>'},
66 66
     'group_desc': {notes: 'Contains information such as a description of the game, its mechanics, etc.'},
67 67
     'release_desc': {notes: 'Contains information such as <strong>version</strong>, install instructions, patching instructions, etc.'}
68
+  }, {
69
+    'idols': {name: 'Voices (Optional)'},
70
+    'studio': {name: 'Publisher (Optional)'},
71
+    'mediainfo': {},
72
+    'audio': {},
73
+    'year': false,
74
+    'lang': false,
75
+    'dlsite': {},
76
+    'screenshots': {name: 'Samples'},
77
+    'group_desc': {notes: 'Contains information such as a description of the audio work.'},
78
+    'release_desc': {notes: 'Contains information specific to the release.'}
68 79
   }, {
69 80
     'idols': {name: 'Creators/Authors (Optional)'},
70 81
     'studio': {name: 'Publisher (Optional)'},

+ 1
- 1
static/functions/validate_upload.js View File

@@ -23,7 +23,7 @@ $(() => {
23 23
       soft_error('The file selected does not appear to be a .torrent file')
24 24
     }
25 25
     let mi = $('#mediainfo').raw().value
26
-    if (mi && (!mi.includes('General') || !mi.includes('Video'))) {
26
+    if (mi && (!mi.includes('General') || (!mi.includes('Video') && !mi.includes('Audio')))) {
27 27
       soft_error('Your MediaInfo does not appear to be from a valid MediaInfo utility')
28 28
     }
29 29
     if (!$('#image').raw().value) {

+ 13
- 9
static/styles/beluga/style.css View File

@@ -18,14 +18,14 @@
18 18
   padding: 0
19 19
 }
20 20
 
21
-.cats_anime, .cats_movies, .cats_manga, .cats_games, .cats_other {
21
+.cats_anime, .cats_movies, .cats_manga, .cats_games, .cats_audio, .cats_other {
22 22
   width: 38px!important;
23 23
   height: 38px!important;
24 24
   line-height: 38px;
25 25
 }
26 26
 .group .cats_anime:after, .group .cats_movies:after,
27 27
 .group .cats_manga:after, .group .cats_games:after,
28
-.group .cats_other:after {
28
+.group .cats_audio:after, .group .cats_other:after {
29 29
   color: black!important;
30 30
 }
31 31
 .cats_anime:after {
@@ -52,6 +52,12 @@
52 52
   font-size: 16px;
53 53
 }
54 54
 .group .cats_games { background-color: #4DC593; }
55
+.cats_audio:after {
56
+  content: "AUD";
57
+  color: #77C5D4;
58
+  font-size: 18px;
59
+}
60
+.group .cats_audio { background-color: #77C5D4; }
55 61
 .cats_other:after {
56 62
   content: "OTH";
57 63
   color: #0D5968;
@@ -861,10 +867,10 @@ td {
861 867
   padding: 5px
862 868
 }
863 869
 
864
-td:first-child {
870
+#torrents .torrent_table td:first-child, td:first-child {
865 871
   padding-left: 12px;
866 872
 }
867
-td:last-child {
873
+#torrents .torrent_table td:last-child, td:last-child {
868 874
   padding-right: 12px;
869 875
 }
870 876
 
@@ -1030,7 +1036,7 @@ table.slice {
1030 1036
 
1031 1037
 .save_message {
1032 1038
   margin-top: 2px;
1033
-  background-color: #93d4a2;
1039
+  background-color: #93d4a2!important;
1034 1040
   text-align: center;
1035 1041
   color: #fff;
1036 1042
   padding: 10px
@@ -1192,10 +1198,8 @@ span.center_poll {
1192 1198
   white-space: nowrap
1193 1199
 }
1194 1200
 
1195
-#collages .sign,#torrents .sign {
1201
+#collages .sign, #torrents .sign {
1196 1202
   padding: 5px;
1197
-  position: relative;
1198
-  left: -5px
1199 1203
 }
1200 1204
 
1201 1205
 .filter_torrents {
@@ -1953,7 +1957,7 @@ a.last_read > svg {
1953 1957
 .forum_index td {
1954 1958
   position: relative;
1955 1959
 }
1956
-.forum_index .row:nth-child(odd) {
1960
+.alternate_rows .row:nth-child(odd) {
1957 1961
   background: #33363d;
1958 1962
 }
1959 1963
 .forum_index td.read:after, #forums td.unread:after {

+ 2
- 2
static/styles/genaviv/style.css View File

@@ -101,7 +101,7 @@ li#nav_subscriptions.new-subscriptions a {
101 101
 .box.filter_torrents .head a:hover,.box.filter_torrents .head a:focus,.forum_post .colhead a:hover,.forum_post .colhead_dark a:focus,#inbox .box .head a:focus,#inbox .box .head a:hover {
102 102
   color:#32867d
103 103
 }
104
-#request_table .rowb td:first-of-type>a:nth-child(2n),#request_table .rowa td>a:nth-child(2n) {
104
+#request_table .row td:first-of-type > a:nth-child(2n) {
105 105
   color:#32867d
106 106
 }
107 107
 span.r99,.r09,.r10,.r20,.r30,.r40,.r50 {
@@ -687,7 +687,7 @@ form.search_form input[type="submit"],form.search_form input[type="button"] {
687 687
 .hidden,div#quickreplytext br {
688 688
   display:none
689 689
 }
690
-#request_table .rowb td:first-of-type>a,#request_table .rowa td>a {
690
+#request_table .rowa td > a {
691 691
   font-weight:600
692 692
 }
693 693
 .big_info .group_info.clear span {

+ 4
- 0
static/styles/global.css View File

@@ -24,6 +24,10 @@
24 24
   width: 50%;
25 25
 }
26 26
 
27
+#contest div#content > div.flex > div.grow {
28
+  min-width: 50%;
29
+}
30
+
27 31
 input, textarea {
28 32
   border: 1px solid #c7c7c7;
29 33
   background-color: white;

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

@@ -9,6 +9,7 @@
9 9
 .cats_movies { width: 28px; height: 28px; background: url('images/movies.png') no-repeat center center; }
10 10
 .cats_manga { width: 28px; height: 28px; background: url('images/manga.png') no-repeat center center; }
11 11
 .cats_games { width: 28px; height: 28px; background: url('images/games.png') no-repeat center center; }
12
+.cats_audio { width: 28px; height: 28px; background: url('images/audiobook.png') no-repeat center center; }
12 13
 .cats_other { width: 28px; height: 28px; background: url('images/other.png') no-repeat center center; }
13 14
 /* Global */
14 15
 * {
@@ -612,8 +613,7 @@ table.slice {
612 613
 }
613 614
 
614 615
 .error_message {
615
-  border: 1px solid #666;
616
-  padding: 3px 0px 3px 0px;
616
+  padding: 8px 0px;
617 617
   background-color: #AF2525;
618 618
   text-align: center;
619 619
   color: white;
@@ -621,11 +621,10 @@ table.slice {
621 621
 }
622 622
 
623 623
 .save_message {
624
-  border: 1px solid #666;
625
-  padding: 3px 0px 3px 0px;
626
-  background-color: #F4E649;
624
+  padding: 8px 0px;
625
+  background-color: #F8C2E8;
627 626
   text-align: center;
628
-  color: #492802;
627
+  color: #555555;
629 628
   font-weight: bold;
630 629
 }
631 630
 

Loading…
Cancel
Save