Browse Source

Replace a whole bunch of sqltime()s with NOW()s

spaghetti 1 year ago
parent
commit
d8c885dd8d
54 changed files with 155 additions and 166 deletions
  1. 3
    2
      classes/autoenable.class.php
  2. 3
    3
      classes/comments.class.php
  3. 1
    1
      classes/forums.class.php
  4. 10
    10
      classes/misc.class.php
  5. 4
    4
      classes/script_start.php
  6. 1
    1
      classes/subscriptions.class.php
  7. 1
    1
      classes/tools.class.php
  8. 50
    55
      classes/torrents.class.php
  9. 2
    2
      sections/artist/takeedit.php
  10. 1
    1
      sections/blog/index.php
  11. 2
    2
      sections/bookmarks/add.php
  12. 1
    1
      sections/delete/take_delete_email.php
  13. 1
    1
      sections/delete/take_delete_ip.php
  14. 1
    1
      sections/donate/ipn.php
  15. 4
    4
      sections/forums/take_new_thread.php
  16. 3
    3
      sections/login/index.php
  17. 3
    3
      sections/register/index.php
  18. 1
    1
      sections/reports/ajax_resolve_report.php
  19. 1
    1
      sections/reports/takereport.php
  20. 3
    3
      sections/reports/takeresolve.php
  21. 1
    1
      sections/reportsv2/ajax_create_report.php
  22. 1
    1
      sections/reportsv2/ajax_new_report.php
  23. 1
    1
      sections/reportsv2/static.php
  24. 1
    1
      sections/reportsv2/takereport.php
  25. 6
    6
      sections/reportsv2/takeresolve.php
  26. 1
    1
      sections/requests/take_fill.php
  27. 1
    1
      sections/requests/take_new_edit.php
  28. 1
    1
      sections/schedule/daily/ratio_reqs.php
  29. 1
    8
      sections/staffpm/makedonor.php
  30. 5
    5
      sections/staffpm/takepost.php
  31. 3
    3
      sections/tools/data/torrent_stats.php
  32. 1
    1
      sections/tools/index.php
  33. 2
    2
      sections/tools/managers/dnu_alter.php
  34. 2
    2
      sections/tools/managers/email_blacklist_alter.php
  35. 2
    2
      sections/tools/managers/featured_merch.php
  36. 1
    1
      sections/tools/misc/create_user.php
  37. 2
    2
      sections/top10/torrents.php
  38. 1
    1
      sections/torrents/add_tag.php
  39. 1
    1
      sections/torrents/delete_tag.php
  40. 1
    1
      sections/torrents/download.php
  41. 1
    1
      sections/torrents/nonwikiedit.php
  42. 1
    1
      sections/torrents/remove_cover_art.php
  43. 1
    1
      sections/torrents/screenshotedit.php
  44. 3
    3
      sections/torrents/takechangecategory.php
  45. 3
    3
      sections/torrents/takeedit.php
  46. 2
    2
      sections/torrents/takegroupedit.php
  47. 1
    1
      sections/torrents/takenewgroup.php
  48. 1
    1
      sections/upload/insert_extra_torrents.php
  49. 4
    4
      sections/upload/upload_handle.php
  50. 2
    2
      sections/user/takemoderate.php
  51. 2
    2
      sections/userhistory/email_history.php
  52. 1
    1
      sections/userhistory/email_history2.php
  53. 1
    1
      sections/wiki/takecreate.php
  54. 1
    1
      sections/wiki/takeedit.php

+ 3
- 2
classes/autoenable.class.php View File

@@ -73,7 +73,8 @@ class AutoEnable {
73 73
             G::$DB->query("
74 74
                 INSERT INTO users_enable_requests
75 75
                 (UserID, Email, IP, UserAgent, Timestamp)
76
-                VALUES ('$UserID', '".DBCrypt::encrypt($Email)."', '".DBCrypt::encrypt($IP)."', '$UserAgent', '".sqltime()."')");
76
+                VALUES (?, ?, ?, ?, NOW())",
77
+                $UserID, DBCrypt::encrypt($Email), DBCrypt::encrypt($IP), $UserAgent);
77 78
 
78 79
             // Cache the number of requests for the modbar
79 80
             G::$Cache->increment_value(self::CACHE_KEY_NAME);
@@ -174,7 +175,7 @@ class AutoEnable {
174 175
         // Update database values and decrement cache
175 176
         G::$DB->query("
176 177
                 UPDATE users_enable_requests
177
-                SET HandledTimestamp = '".sqltime()."',
178
+                SET HandledTimestamp = NOW(),
178 179
                     CheckedBy = '".G::$LoggedUser['ID']."',
179 180
                     Outcome = '$Status'
180 181
                 WHERE ID IN (".implode(',', $IDs).")");

+ 3
- 3
classes/comments.class.php View File

@@ -29,7 +29,7 @@ class Comments {
29 29
 
30 30
     G::$DB->query("
31 31
       INSERT INTO comments (Page, PageID, AuthorID, AddedTime, Body)
32
-      VALUES ('$Page', $PageID, " . G::$LoggedUser['ID'] . ", '" . sqltime() . "', '" . db_string($Body) . "')");
32
+      VALUES ('$Page', $PageID, " . G::$LoggedUser['ID'] . ", NOW(), '" . db_string($Body) . "')");
33 33
     $PostID = G::$DB->inserted_id();
34 34
 
35 35
     $CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Pages - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
@@ -86,7 +86,7 @@ class Comments {
86 86
       SET
87 87
         Body = '" . db_string($NewBody) . "',
88 88
         EditedUserID = " . G::$LoggedUser['ID'] . ",
89
-        EditedTime = '" . sqltime() . "'
89
+        EditedTime = NOW()
90 90
       WHERE ID = $PostID");
91 91
 
92 92
     // Update the cache
@@ -100,7 +100,7 @@ class Comments {
100 100
 
101 101
     G::$DB->query("
102 102
       INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
103
-      VALUES ('$Page', $PostID, " . G::$LoggedUser['ID'] . ", '" . sqltime() . "', '" . db_string($OldBody) . "')");
103
+      VALUES ('$Page', $PostID, " . G::$LoggedUser['ID'] . ", NOW(), '" . db_string($OldBody) . "')");
104 104
 
105 105
     G::$DB->set_query_id($QueryID);
106 106
 

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

@@ -280,7 +280,7 @@ class Forums {
280 280
       INSERT INTO forums_topic_notes
281 281
         (TopicID, AuthorID, AddedTime, Body)
282 282
       VALUES
283
-        ($TopicID, $UserID, '" . sqltime() . "', '" . db_string($Note) . "')");
283
+        (?, ?, NOW(), ?)", $TopicID, $UserID, $Note);
284 284
     G::$DB->set_query_id($QueryID);
285 285
     return (bool)G::$DB->affected_rows();
286 286
   }

+ 10
- 10
classes/misc.class.php View File

@@ -68,7 +68,7 @@ class Misc {
68 68
         INSERT INTO pm_conversations_users
69 69
           (UserID, ConvID, InInbox, InSentbox, SentDate, ReceivedDate, UnRead)
70 70
         VALUES
71
-          ('$ToID', '$ConvID', '1','0','".sqltime()."', '".sqltime()."', '1')");
71
+          ('$ToID', '$ConvID', '1','0', NOW(), NOW(), '1')");
72 72
       if ($FromID == $ToID) {
73 73
         G::$DB->query("
74 74
           UPDATE pm_conversations_users
@@ -81,7 +81,7 @@ class Misc {
81 81
           INSERT INTO pm_conversations_users
82 82
             (UserID, ConvID, InInbox, InSentbox, SentDate, ReceivedDate, UnRead)
83 83
           VALUES
84
-            ('$FromID', '$ConvID', '0','1','".sqltime()."', '".sqltime()."', '0')");
84
+            ('$FromID', '$ConvID', '0','1', NOW(), NOW(), '0')");
85 85
       }
86 86
       $ToID = array($ToID);
87 87
     } else {
@@ -91,7 +91,7 @@ class Misc {
91 91
         SET
92 92
           InInbox = '1',
93 93
           UnRead = '1',
94
-          ReceivedDate = '".sqltime()."'
94
+          ReceivedDate = NOW()
95 95
         WHERE UserID IN (".implode(',', $ToID).")
96 96
           AND ConvID = '$ConvID'");
97 97
 
@@ -99,7 +99,7 @@ class Misc {
99 99
         UPDATE pm_conversations_users
100 100
         SET
101 101
           InSentbox = '1',
102
-          SentDate = '".sqltime()."'
102
+          SentDate = NOW()
103 103
         WHERE UserID = '$FromID'
104 104
           AND ConvID = '$ConvID'");
105 105
     }
@@ -109,7 +109,7 @@ class Misc {
109 109
       INSERT INTO pm_messages
110 110
         (SenderID, ConvID, SentDate, Body)
111 111
       VALUES
112
-        ('$FromID', '$ConvID', '".sqltime()."', '$Body')");
112
+        ('$FromID', '$ConvID', NOW(), '$Body')");
113 113
 
114 114
     // Update the cached new message count.
115 115
     foreach ($ToID as $ID) {
@@ -181,7 +181,7 @@ class Misc {
181 181
       INSERT INTO forums_topics
182 182
         (Title, AuthorID, ForumID, LastPostTime, LastPostAuthorID, CreatedTime)
183 183
       VALUES
184
-        ('$Title', '$AuthorID', '$ForumID', '".sqltime()."', '$AuthorID', '".sqltime()."')");
184
+        ('$Title', '$AuthorID', '$ForumID', NOW(), '$AuthorID', NOW())");
185 185
     $TopicID = G::$DB->inserted_id();
186 186
     $Posts = 1;
187 187
 
@@ -189,7 +189,7 @@ class Misc {
189 189
       INSERT INTO forums_posts
190 190
         (TopicID, AuthorID, AddedTime, Body)
191 191
       VALUES
192
-        ('$TopicID', '$AuthorID', '".sqltime()."', '$PostBody')");
192
+        ('$TopicID', '$AuthorID', NOW(), '$PostBody')");
193 193
     $PostID = G::$DB->inserted_id();
194 194
 
195 195
     G::$DB->query("
@@ -200,7 +200,7 @@ class Misc {
200 200
         LastPostID = '$PostID',
201 201
         LastPostAuthorID = '$AuthorID',
202 202
         LastPostTopicID = '$TopicID',
203
-        LastPostTime = '".sqltime()."'
203
+        LastPostTime = NOW()
204 204
       WHERE ID = '$ForumID'");
205 205
 
206 206
     G::$DB->query("
@@ -209,7 +209,7 @@ class Misc {
209 209
         NumPosts = NumPosts + 1,
210 210
         LastPostID = '$PostID',
211 211
         LastPostAuthorID = '$AuthorID',
212
-        LastPostTime = '".sqltime()."'
212
+        LastPostTime = NOW()
213 213
       WHERE ID = '$TopicID'");
214 214
 
215 215
     // Bump this topic to head of the cache
@@ -440,7 +440,7 @@ class Misc {
440 440
     $QueryID = G::$DB->get_query_id();
441 441
     G::$DB->query("
442 442
       INSERT INTO log (Message, Time)
443
-      VALUES ('" . db_string($Message) . "', '" . sqltime() . "')");
443
+      VALUES (?, NOW())", $Message);
444 444
     G::$DB->set_query_id($QueryID);
445 445
   }
446 446
 

+ 4
- 4
classes/script_start.php View File

@@ -184,7 +184,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
184 184
   if (strtotime($UserSessions[$SessionID]['LastUpdate']) + 600 < time()) {
185 185
     $DB->query("
186 186
       UPDATE users_main
187
-      SET LastAccess = '".sqltime()."'
187
+      SET LastAccess = NOW()
188 188
       WHERE ID = '$LoggedUser[ID]'");
189 189
     $SessionQuery =
190 190
      "UPDATE users_sessions
@@ -196,7 +196,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
196 196
     $SessionQuery .=
197 197
        "Browser = '$Browser',
198 198
         OperatingSystem = '$OperatingSystem',
199
-        LastUpdate = '".sqltime()."'
199
+        LastUpdate = NOW()
200 200
       WHERE UserID = '$LoggedUser[ID]'
201 201
         AND SessionID = '".db_string($SessionID)."'";
202 202
     $DB->query($SessionQuery);
@@ -254,7 +254,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
254 254
     }
255 255
     $DB->query("
256 256
       UPDATE users_history_ips
257
-      SET EndTime = '".sqltime()."'
257
+      SET EndTime = NOW()
258 258
       WHERE EndTime IS NULL
259 259
         AND UserID = '$LoggedUser[ID]'
260 260
         AND IP = '$CurIP'");
@@ -262,7 +262,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
262 262
       INSERT IGNORE INTO users_history_ips
263 263
         (UserID, IP, StartTime)
264 264
       VALUES
265
-        ('$LoggedUser[ID]', '".DBCrypt::encrypt($NewIP)."', '".sqltime()."')");
265
+        ('$LoggedUser[ID]', '".DBCrypt::encrypt($NewIP)."', NOW())");
266 266
 
267 267
     $ipcc = Tools::geoip($NewIP);
268 268
     $DB->query("

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

@@ -57,7 +57,7 @@ class Subscriptions {
57 57
         INSERT IGNORE INTO users_notify_quoted
58 58
           (UserID, QuoterID, Page, PageID, PostID, Date)
59 59
         VALUES
60
-          ('$UserID', '$QuoterID', '$Page', '$PageID', '$PostID', '" . sqltime() . "')");
60
+          ('$UserID', '$QuoterID', '$Page', '$PageID', '$PostID', NOW())");
61 61
       G::$Cache->delete_value("notify_quoted_$UserID");
62 62
       if ($Page == 'forums') {
63 63
         $URL = site_url() . "forums.php?action=viewthread&postid=$PostID";

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

@@ -174,7 +174,7 @@ class Tools {
174 174
       SET m.Enabled = '2',
175 175
         m.can_leech = '0',
176 176
         i.AdminComment = CONCAT('".sqltime()." - ".($AdminComment ? $AdminComment : 'Disabled by system')."\n\n', i.AdminComment),
177
-        i.BanDate = '".sqltime()."',
177
+        i.BanDate = NOW(),
178 178
         i.BanReason = '$BanReason',
179 179
         i.RatioWatchDownload = ".($BanReason == 2 ? 'm.Downloaded' : "'0'")."
180 180
       WHERE m.ID IN(".implode(',', $UserIDs).') ');

+ 50
- 55
classes/torrents.class.php View File

@@ -238,7 +238,8 @@ class Torrents {
238 238
       INSERT INTO group_log
239 239
         (GroupID, TorrentID, UserID, Info, Time, Hidden)
240 240
       VALUES
241
-        ($GroupID, $TorrentID, $UserID, '".db_string($Message)."', '".sqltime()."', $Hidden)");
241
+        (?, ?, ?, ?, NOW(), ?)",
242
+        $GroupID, $TorrentID, $UserID, $Message, $Hidden);
242 243
     G::$DB->set_query_id($QueryID);
243 244
   }
244 245
 
@@ -317,10 +318,10 @@ class Torrents {
317 318
       UPDATE reportsv2
318 319
       SET
319 320
         Status = 'Resolved',
320
-        LastChangeTime = '".sqltime()."',
321
+        LastChangeTime = NOW(),
321 322
         ModComment = 'Report already dealt with (torrent deleted)'
322
-      WHERE TorrentID = $ID
323
-        AND Status != 'Resolved'");
323
+      WHERE TorrentID = ?
324
+        AND Status != 'Resolved'", $ID);
324 325
     $Reports = G::$DB->affected_rows();
325 326
     if ($Reports) {
326 327
       G::$Cache->decrement('num_torrent_reportsv2', $Reports);
@@ -329,17 +330,17 @@ class Torrents {
329 330
     unlink(TORRENT_STORE.$ID.'.torrent');
330 331
     G::$DB->query("
331 332
       DELETE FROM torrents_bad_tags
332
-      WHERE TorrentID = $ID");
333
+      WHERE TorrentID = ?", $ID);
333 334
     G::$DB->query("
334 335
       DELETE FROM torrents_bad_folders
335
-      WHERE TorrentID = $ID");
336
+      WHERE TorrentID = ?", $ID);
336 337
     G::$DB->query("
337 338
       DELETE FROM torrents_bad_files
338
-      WHERE TorrentID = $ID");
339
+      WHERE TorrentID = ?", $ID);
339 340
 
340 341
     G::$DB->query("
341 342
       DELETE FROM shop_freeleeches
342
-      WHERE TorrentID = $ID");
343
+      WHERE TorrentID = ?", $ID);
343 344
     $FLs = G::$DB->affected_rows();
344 345
     if ($FLs) {
345 346
       G::$Cache->delete_value('shop_freeleech_list');
@@ -348,7 +349,7 @@ class Torrents {
348 349
     // Tells Sphinx that the group is removed
349 350
     G::$DB->query("
350 351
       REPLACE INTO sphinx_delta (ID, Time)
351
-      VALUES ($ID, UNIX_TIMESTAMP())");
352
+      VALUES (?, UNIX_TIMESTAMP())", $ID);
352 353
 
353 354
     G::$Cache->delete_value("torrent_download_$ID");
354 355
     G::$Cache->delete_value("torrent_group_$GroupID");
@@ -371,7 +372,7 @@ class Torrents {
371 372
     G::$DB->query("
372 373
       SELECT CategoryID
373 374
       FROM torrents_group
374
-      WHERE ID = '$GroupID'");
375
+      WHERE ID = ?", $GroupID);
375 376
     list($Category) = G::$DB->next_record();
376 377
     if ($Category == 1) {
377 378
       G::$Cache->decrement('stats_album_count');
@@ -384,7 +385,7 @@ class Torrents {
384 385
     G::$DB->query("
385 386
       SELECT CollageID
386 387
       FROM collages_torrents
387
-      WHERE GroupID = '$GroupID'");
388
+      WHERE GroupID = ?", $GroupID);
388 389
     if (G::$DB->has_results()) {
389 390
       $CollageIDs = G::$DB->collect('CollageID');
390 391
       G::$DB->query("
@@ -393,7 +394,7 @@ class Torrents {
393 394
         WHERE ID IN (".implode(', ', $CollageIDs).')');
394 395
       G::$DB->query("
395 396
         DELETE FROM collages_torrents
396
-        WHERE GroupID = '$GroupID'");
397
+        WHERE GroupID = ?", $GroupID);
397 398
 
398 399
       foreach ($CollageIDs as $CollageID) {
399 400
         G::$Cache->delete_value("collage_$CollageID");
@@ -406,12 +407,12 @@ class Torrents {
406 407
     G::$DB->query("
407 408
       SELECT ArtistID
408 409
       FROM torrents_artists
409
-      WHERE GroupID = $GroupID");
410
+      WHERE GroupID = ?", $GroupID);
410 411
     $Artists = G::$DB->collect('ArtistID');
411 412
 
412 413
     G::$DB->query("
413 414
       DELETE FROM torrents_artists
414
-      WHERE GroupID = '$GroupID'");
415
+      WHERE GroupID = ?", $GroupID);
415 416
 
416 417
     foreach ($Artists as $ArtistID) {
417 418
       if (empty($ArtistID)) {
@@ -423,14 +424,14 @@ class Torrents {
423 424
         FROM artists_group AS ag
424 425
           LEFT JOIN requests_artists AS ra ON ag.ArtistID = ra.ArtistID
425 426
         WHERE ra.ArtistID IS NOT NULL
426
-          AND ag.ArtistID = '$ArtistID'");
427
+          AND ag.ArtistID = ?", $ArtistID);
427 428
       list($ReqCount) = G::$DB->next_record();
428 429
       G::$DB->query("
429 430
         SELECT COUNT(ag.ArtistID)
430 431
         FROM artists_group AS ag
431 432
           LEFT JOIN torrents_artists AS ta ON ag.ArtistID = ta.ArtistID
432 433
         WHERE ta.ArtistID IS NOT NULL
433
-          AND ag.ArtistID = '$ArtistID'");
434
+          AND ag.ArtistID = ?", $ArtistID);
434 435
       list($GroupCount) = G::$DB->next_record();
435 436
       if (($ReqCount + $GroupCount) == 0) {
436 437
         //The only group to use this artist
@@ -445,12 +446,12 @@ class Torrents {
445 446
     G::$DB->query("
446 447
       SELECT ID
447 448
       FROM requests
448
-      WHERE GroupID = '$GroupID'");
449
+      WHERE GroupID = ?", $GroupID);
449 450
     $Requests = G::$DB->collect('ID');
450 451
     G::$DB->query("
451 452
       UPDATE requests
452 453
       SET GroupID = NULL
453
-      WHERE GroupID = '$GroupID'");
454
+      WHERE GroupID = ?", $GroupID);
454 455
     foreach ($Requests as $RequestID) {
455 456
       G::$Cache->delete_value("request_$RequestID");
456 457
     }
@@ -460,16 +461,16 @@ class Torrents {
460 461
 
461 462
     G::$DB->query("
462 463
       DELETE FROM torrents_group
463
-      WHERE ID = '$GroupID'");
464
+      WHERE ID = ?", $GroupID);
464 465
     G::$DB->query("
465 466
       DELETE FROM torrents_tags
466
-      WHERE GroupID = '$GroupID'");
467
+      WHERE GroupID = ?", $GroupID);
467 468
     G::$DB->query("
468 469
       DELETE FROM bookmarks_torrents
469
-      WHERE GroupID = '$GroupID'");
470
+      WHERE GroupID = ?", $GroupID);
470 471
     G::$DB->query("
471 472
       DELETE FROM wiki_torrents
472
-      WHERE PageID = '$GroupID'");
473
+      WHERE PageID = ?", $GroupID);
473 474
 
474 475
     G::$Cache->delete_value("torrents_details_$GroupID");
475 476
     G::$Cache->delete_value("torrent_group_$GroupID");
@@ -492,18 +493,18 @@ class Torrents {
492 493
           SELECT REPLACE(GROUP_CONCAT(tags.Name SEPARATOR ' '), '.', '_')
493 494
           FROM torrents_tags AS t
494 495
             INNER JOIN tags ON tags.ID = t.TagID
495
-          WHERE t.GroupID = '$GroupID'
496
+          WHERE t.GroupID = ?
496 497
           GROUP BY t.GroupID
497 498
           )
498
-      WHERE ID = '$GroupID'");
499
+      WHERE ID = ?", $GroupID, $GroupID);
499 500
 
500 501
     // Fetch album artists
501 502
     G::$DB->query("
502 503
       SELECT GROUP_CONCAT(ag.Name separator ' ')
503 504
       FROM torrents_artists AS ta
504 505
         JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID
505
-      WHERE ta.GroupID = $GroupID
506
-      GROUP BY ta.GroupID");
506
+      WHERE ta.GroupID = ?
507
+      GROUP BY ta.GroupID", $GroupID);
507 508
     if (G::$DB->has_results()) {
508 509
       list($ArtistName) = G::$DB->next_record(MYSQLI_NUM, false);
509 510
     } else {
@@ -520,23 +521,16 @@ class Torrents {
520 521
         t.ID, g.ID, Name, NameRJ, NameJP, TagList, Year, CatalogueNumber, CategoryID, UNIX_TIMESTAMP(t.Time),
521 522
         Size, Snatched, Seeders, Leechers, Censored, Studio, Series, DLsiteID,
522 523
         CAST(FreeTorrent AS CHAR), Media, Container, Codec, Resolution, AudioFormat, Subbing, Language, Description,
523
-        REPLACE(REPLACE(FileList, '_', ' '), '/', ' ') AS FileList, '".db_string($ArtistName)."'
524
+        REPLACE(REPLACE(FileList, '_', ' '), '/', ' ') AS FileList, ?
524 525
       FROM torrents AS t
525 526
         JOIN torrents_group AS g ON g.ID = t.GroupID
526
-      WHERE g.ID = $GroupID");
527
+      WHERE g.ID = ?", $ArtistName, $GroupID);
527 528
 
528 529
     G::$Cache->delete_value("torrents_details_$GroupID");
529 530
     G::$Cache->delete_value("torrent_group_$GroupID");
530 531
     G::$Cache->delete_value("torrent_group_light_$GroupID");
531 532
 
532 533
     $ArtistInfo = Artists::get_artist($GroupID);
533
-/*
534
-    foreach ($ArtistInfo as $Importances => $Importance) {
535
-      foreach ($Importance as $Artist) {
536
-        G::$Cache->delete_value('artist_groups_'.$Artist['id']); //Needed for at least freeleech change, if not others.
537
-      }
538
-    }
539
-*/
540 534
 
541 535
     G::$Cache->delete_value("groups_artists_$GroupID");
542 536
     G::$DB->set_query_id($QueryID);
@@ -554,7 +548,7 @@ class Torrents {
554 548
     G::$DB->query("
555 549
       SELECT GroupID
556 550
       FROM torrents
557
-      WHERE ID = $TorrentID");
551
+      WHERE ID = ?", $TorrentID);
558 552
     if (G::$DB->has_results()) {
559 553
       list($GroupID) = G::$DB->next_record(MYSQLI_NUM, false);
560 554
       $Contents = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
@@ -572,8 +566,9 @@ class Torrents {
572 566
       $FileString = implode("\n", $TmpFileList);
573 567
       G::$DB->query("
574 568
         UPDATE torrents
575
-        SET Size = $TotalSize, FilePath = '".db_string($FilePath)."', FileList = '".db_string($FileString)."'
576
-        WHERE ID = $TorrentID");
569
+        SET Size = ?, FilePath = ?, FileList = ?
570
+        WHERE ID = ?",
571
+        $TotalSize, $FilePath, $FileString, $TorrentID);
577 572
       G::$Cache->delete_value("torrents_details_$GroupID");
578 573
     }
579 574
     G::$DB->set_query_id($QueryID);
@@ -696,7 +691,7 @@ class Torrents {
696 691
         G::$DB->query("
697 692
           SELECT UNIX_TIMESTAMP(ExpiryTime)
698 693
           FROM shop_freeleeches
699
-          WHERE TorrentID = ".$Data['ID']);
694
+          WHERE TorrentID = ?", $Data['ID']);
700 695
         if (G::$DB->has_results()) {
701 696
           $ExpiryTime = G::$DB->next_record(MYSQLI_NUM, false)[0];
702 697
           $Info[] = ($HTMLy ? Format::torrent_label('Freeleech!') : 'Freeleech!') . ($HTMLy ? " <strong>(" : " (") . str_replace(['week','day','hour','min','Just now','s',' '],['w','d','h','m','0m'],time_diff(max($ExpiryTime, time()), 1, false)) . ($HTMLy ? ")</strong>" : ")");
@@ -773,7 +768,7 @@ class Torrents {
773 768
     $QueryID = G::$DB->get_query_id();
774 769
 
775 770
     if (!is_array($GroupIDs)) {
776
-      $GroupIDs = array($GroupIDs);
771
+      $GroupIDs = [$GroupIDs];
777 772
     }
778 773
 
779 774
     G::$DB->query('
@@ -808,8 +803,8 @@ class Torrents {
808 803
         G::$DB->query("
809 804
           SELECT TorrentID
810 805
           FROM users_freeleeches
811
-          WHERE UserID = $UserID
812
-            AND Expired = 0");
806
+          WHERE UserID = ?
807
+            AND Expired = 0", $UserID);
813 808
         $TokenTorrents = array_fill_keys(G::$DB->collect('TorrentID', false), true);
814 809
         G::$DB->set_query_id($QueryID);
815 810
         G::$Cache->cache_value("users_tokens_$UserID", $TokenTorrents);
@@ -882,7 +877,7 @@ class Torrents {
882 877
           G::$DB->query("
883 878
             SELECT fid
884 879
             FROM xbt_snatched
885
-            WHERE uid = '$UserID'");
880
+            WHERE uid = ?", $UserID);
886 881
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
887 882
             $SnatchedTorrents[$ID & $LastBucket][(int)$ID] = true;
888 883
           }
@@ -895,8 +890,8 @@ class Torrents {
895 890
           G::$DB->query("
896 891
             SELECT fid
897 892
             FROM xbt_snatched
898
-            WHERE uid = '$UserID'
899
-              AND tstamp >= $UpdateTime[last]");
893
+            WHERE uid = ?
894
+              AND tstamp >= ?", $UserID, $UpdateTime['last']);
900 895
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
901 896
             $CurBucketID = $ID & $LastBucket;
902 897
             if ($SnatchedTorrents[$CurBucketID] === false) {
@@ -963,9 +958,9 @@ class Torrents {
963 958
           G::$DB->query("
964 959
             SELECT fid
965 960
             FROM xbt_files_users
966
-            WHERE uid = $UserID
961
+            WHERE uid = ?
967 962
               AND active = 1
968
-              AND Remaining = 0");
963
+              AND Remaining = 0", $UserID);
969 964
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
970 965
             $SeedingTorrents[$ID & $LastBucket][(int)$ID] = true;
971 966
           }
@@ -978,10 +973,10 @@ class Torrents {
978 973
           G::$DB->query("
979 974
             SELECT fid
980 975
             FROM xbt_files_users
981
-            WHERE uid = '$UserID'
976
+            WHERE uid = ?
982 977
               AND active = 1
983 978
               AND Remaining = 0
984
-              AND mtime >= $UpdateTime[last]");
979
+              AND mtime >= ?", $UserID, $UpdateTime['last']);
985 980
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
986 981
             $CurBucketID = $ID & $LastBucket;
987 982
             if ($SeedingTorrents[$CurBucketID] === false) {
@@ -1049,9 +1044,9 @@ class Torrents {
1049 1044
           G::$DB->query("
1050 1045
             SELECT fid
1051 1046
             FROM xbt_files_users
1052
-            WHERE uid = $UserID
1047
+            WHERE uid = ?
1053 1048
               AND active = 1
1054
-              AND Remaining > 0");
1049
+              AND Remaining > 0", $UserID);
1055 1050
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
1056 1051
             $LeechingTorrents[$ID & $LastBucket][(int)$ID] = true;
1057 1052
           }
@@ -1064,10 +1059,10 @@ class Torrents {
1064 1059
           G::$DB->query("
1065 1060
             SELECT fid
1066 1061
             FROM xbt_files_users
1067
-            WHERE uid = '$UserID'
1062
+            WHERE uid = ?
1068 1063
               AND active = 1
1069 1064
               AND Remaining > 0
1070
-              AND mtime >= $UpdateTime[last]");
1065
+              AND mtime >= ?", $UserID, $UpdateTime['last']);
1071 1066
           while (list($ID) = G::$DB->next_record(MYSQLI_NUM, false)) {
1072 1067
             $CurBucketID = $ID & $LastBucket;
1073 1068
             if ($LeechingTorrents[$CurBucketID] === false) {
@@ -1217,8 +1212,8 @@ class Torrents {
1217 1212
           UserComment,
1218 1213
           ReportedTime
1219 1214
         FROM reportsv2
1220
-        WHERE TorrentID = $TorrentID
1221
-          AND Status != 'Resolved'");
1215
+        WHERE TorrentID = ?
1216
+          AND Status != 'Resolved'", $TorrentID);
1222 1217
       $Reports = G::$DB->to_array(false, MYSQLI_ASSOC, false);
1223 1218
       G::$DB->set_query_id($QueryID);
1224 1219
       G::$Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0);

+ 2
- 2
sections/artist/takeedit.php View File

@@ -41,11 +41,11 @@ if (!$RevisionID) { // edit
41 41
     INSERT INTO wiki_artists
42 42
       (PageID, Body, Image, UserID, Summary, Time)
43 43
     VALUES
44
-      ('$ArtistID', '$Body', '$Image', '$UserID', '$Summary', '".sqltime()."')");
44
+      ('$ArtistID', '$Body', '$Image', '$UserID', '$Summary', NOW())");
45 45
 } else { // revert
46 46
   $DB->query("
47 47
     INSERT INTO wiki_artists (PageID, Body, Image, UserID, Summary, Time)
48
-    SELECT '$ArtistID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."'
48
+    SELECT '$ArtistID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', NOW()
49 49
     FROM wiki_artists
50 50
     WHERE RevisionID = '$RevisionID'");
51 51
 }

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

@@ -88,7 +88,7 @@ if (check_perms('admin_manage_blog')) {
88 88
             ('".$LoggedUser['ID']."',
89 89
             '".db_string($_POST['title'])."',
90 90
             '".db_string($_POST['body'])."',
91
-            '".sqltime()."',
91
+            NOW(),
92 92
             $ThreadID,
93 93
             '".((isset($_POST['important']) && $_POST['important'] == '1') ? '1' : '0')."')");
94 94
         $Cache->delete_value('blog');

+ 2
- 2
sections/bookmarks/add.php View File

@@ -35,11 +35,11 @@ if (!$DB->has_results()) {
35 35
     $Sort += 1;
36 36
     $DB->query("
37 37
       INSERT IGNORE INTO $Table (UserID, $Col, Time, Sort)
38
-      VALUES ('$LoggedUser[ID]', $PageID, '".sqltime()."', $Sort)");
38
+      VALUES ('$LoggedUser[ID]', $PageID, NOW(), $Sort)");
39 39
   } else {
40 40
     $DB->query("
41 41
       INSERT IGNORE INTO $Table (UserID, $Col, Time)
42
-      VALUES ('$LoggedUser[ID]', $PageID, '".sqltime()."')");
42
+      VALUES ('$LoggedUser[ID]', $PageID, NOW())");
43 43
   }
44 44
   $Cache->delete_value('bookmarks_'.$Type.'_'.$LoggedUser['ID']);
45 45
   if ($Type == 'torrent') {

+ 1
- 1
sections/delete/take_delete_email.php View File

@@ -54,7 +54,7 @@ $DB->query("
54 54
   INSERT INTO deletion_requests
55 55
     (UserID, Type, Value, Reason, Time)
56 56
   VALUES
57
-    ('$UserID', 'Email', '".db_string($EncEmails[0])."', '".db_string($Reason)."', '".sqltime()."')");
57
+    ('$UserID', 'Email', '".db_string($EncEmails[0])."', '".db_string($Reason)."', NOW())");
58 58
 
59 59
 $Cache->delete_value('num_deletion_requests');
60 60
 

+ 1
- 1
sections/delete/take_delete_ip.php View File

@@ -54,7 +54,7 @@ $DB->query("
54 54
   INSERT INTO deletion_requests
55 55
     (UserID, Type, Value, Reason, Time)
56 56
   VALUES
57
-    ('$UserID', 'IP', '".db_string($EncIPs[0])."', '".db_string($Reason)."', '".sqltime()."')");
57
+    ('$UserID', 'IP', '".db_string($EncIPs[0])."', '".db_string($Reason)."', NOW())");
58 58
 
59 59
 $Cache->delete_value('num_deletion_requests');
60 60
 

+ 1
- 1
sections/donate/ipn.php View File

@@ -124,7 +124,7 @@ if (strpos($Result, 'VERIFIED') !== false || check_perms('site_debug')) {
124 124
     INSERT INTO donations
125 125
       (UserID, Amount, Email, Time)
126 126
     VALUES
127
-      ('".$_POST['custom']."', '".db_string($_POST['mc_gross'])."', '".db_string($_POST['payer_email'])."', '".sqltime()."')");
127
+      ('".$_POST['custom']."', '".db_string($_POST['mc_gross'])."', '".db_string($_POST['payer_email'])."', NOW())");
128 128
 } else {
129 129
   $DB->query("
130 130
     INSERT INTO ip_bans

+ 4
- 4
sections/forums/take_new_thread.php View File

@@ -82,14 +82,14 @@ $DB->query("
82 82
   INSERT INTO forums_topics
83 83
     (Title, AuthorID, ForumID, LastPostTime, LastPostAuthorID, CreatedTime)
84 84
   Values
85
-    ('".db_string($Title)."', '".$LoggedUser['ID']."', '$ForumID', '".sqltime()."', '".$LoggedUser['ID']."', '".sqltime()."')");
85
+    ('".db_string($Title)."', '".$LoggedUser['ID']."', '$ForumID', NOW(), '".$LoggedUser['ID']."', NOW())");
86 86
 $TopicID = $DB->inserted_id();
87 87
 
88 88
 $DB->query("
89 89
   INSERT INTO forums_posts
90 90
     (TopicID, AuthorID, AddedTime, Body)
91 91
   VALUES
92
-    ('$TopicID', '".$LoggedUser['ID']."', '".sqltime()."', '".db_string($Body)."')");
92
+    ('$TopicID', '".$LoggedUser['ID']."', NOW(), '".db_string($Body)."')");
93 93
 
94 94
 $PostID = $DB->inserted_id();
95 95
 
@@ -101,7 +101,7 @@ $DB->query("
101 101
     LastPostID       = '$PostID',
102 102
     LastPostAuthorID = '".$LoggedUser['ID']."',
103 103
     LastPostTopicID  = '$TopicID',
104
-    LastPostTime     = '".sqltime()."'
104
+    LastPostTime     = NOW()
105 105
   WHERE ID = '$ForumID'");
106 106
 
107 107
 $DB->query("
@@ -110,7 +110,7 @@ $DB->query("
110 110
     NumPosts         = NumPosts + 1,
111 111
     LastPostID       = '$PostID',
112 112
     LastPostAuthorID = '".$LoggedUser['ID']."',
113
-    LastPostTime     = '".sqltime()."'
113
+    LastPostTime     = NOW()
114 114
   WHERE ID = '$TopicID'");
115 115
 
116 116
 if (isset($_POST['subscribe'])) {

+ 3
- 3
sections/login/index.php View File

@@ -356,7 +356,7 @@ else {
356 356
                   INSERT INTO users_sessions
357 357
                     (UserID, SessionID, KeepLogged, Browser, OperatingSystem, IP, LastUpdate, FullUA)
358 358
                   VALUES
359
-                    ('$UserID', '".db_string($SessionID)."', '1', '$Browser', '$OperatingSystem', '".db_string(apcu_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0')."', '".sqltime()."', '".db_string($_SERVER['HTTP_USER_AGENT'])."')");
359
+                    ('$UserID', '".db_string($SessionID)."', '1', '$Browser', '$OperatingSystem', '".db_string(apcu_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0')."', NOW(), '".db_string($_SERVER['HTTP_USER_AGENT'])."')");
360 360
 
361 361
                 $Cache->begin_transaction("users_sessions_$UserID");
362 362
                 $Cache->insert_front($SessionID, [
@@ -371,8 +371,8 @@ else {
371 371
                 $Sql = "
372 372
                   UPDATE users_main
373 373
                   SET
374
-                    LastLogin = '".sqltime()."',
375
-                    LastAccess = '".sqltime()."'
374
+                    LastLogin = NOW(),
375
+                    LastAccess = NOW()
376 376
                   WHERE ID = '".db_string($UserID)."'";
377 377
 
378 378
                 $DB->query($Sql);

+ 3
- 3
sections/register/index.php View File

@@ -144,13 +144,13 @@ if (!empty($_REQUEST['confirm'])) {
144 144
         INSERT INTO users_info
145 145
           (UserID, StyleID, AuthKey, Inviter, JoinDate, AdminComment)
146 146
         VALUES
147
-          ('$UserID', '$StyleID', '".db_string($AuthKey)."', '$InviterID', '".sqltime()."', '$InviteReason')");
147
+          ('$UserID', '$StyleID', '".db_string($AuthKey)."', '$InviterID', NOW(), '$InviteReason')");
148 148
 
149 149
       $DB->query("
150 150
         INSERT INTO users_history_ips
151 151
           (UserID, IP, StartTime)
152 152
         VALUES
153
-          ('$UserID', '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', '".sqltime()."')");
153
+          ('$UserID', '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', NOW())");
154 154
       $DB->query("
155 155
         INSERT INTO users_notifications_settings
156 156
           (UserID)
@@ -169,7 +169,7 @@ if (!empty($_REQUEST['confirm'])) {
169 169
           INSERT INTO users_history_emails
170 170
             (UserID, Email, Time, IP)
171 171
           VALUES
172
-            ('$UserID', '".DBCrypt::encrypt($InviteEmail)."', '".sqltime()."', '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."')");
172
+            ('$UserID', '".DBCrypt::encrypt($InviteEmail)."', NOW(), '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."')");
173 173
       }
174 174
 
175 175
 

+ 1
- 1
sections/reports/ajax_resolve_report.php View File

@@ -27,7 +27,7 @@ if (!check_perms('admin_reports')) {
27 27
 $DB->query("
28 28
   UPDATE reports
29 29
   SET Status = 'Resolved',
30
-    ResolvedTime = '".sqltime()."',
30
+    ResolvedTime = NOW(),
31 31
     ResolverID = '".$LoggedUser['ID']."'
32 32
   WHERE ID = '".db_string($ReportID)."'");
33 33
 

+ 1
- 1
sections/reports/takereport.php View File

@@ -66,7 +66,7 @@ $DB->query('
66 66
   INSERT INTO reports
67 67
     (UserID, ThingID, Type, ReportedTime, Reason)
68 68
   VALUES
69
-    ('.db_string($LoggedUser['ID']).", $ID, '$Short', '".sqltime()."', '".db_string($Reason)."')");
69
+    ('.db_string($LoggedUser['ID']).", $ID, '$Short', NOW(), '".db_string($Reason)."')");
70 70
 $ReportID = $DB->inserted_id();
71 71
 
72 72
 $Channels = [];

+ 3
- 3
sections/reports/takeresolve.php View File

@@ -27,9 +27,9 @@ if (!check_perms('admin_reports')) {
27 27
 $DB->query("
28 28
   UPDATE reports
29 29
   SET Status = 'Resolved',
30
-    ResolvedTime = '".sqltime()."',
31
-    ResolverID = '".$LoggedUser['ID']."'
32
-  WHERE ID = '".db_string($ReportID)."'");
30
+    ResolvedTime = NOW(),
31
+    ResolverID = ?
32
+  WHERE ID = ?", $LoggedUser['ID'], $LoggedUser['ID']);
33 33
 
34 34
 $Channels = [];
35 35
 

+ 1
- 1
sections/reportsv2/ajax_create_report.php View File

@@ -77,7 +77,7 @@ $DB->query("
77 77
   INSERT INTO reportsv2
78 78
     (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, ExtraID)
79 79
   VALUES
80
-    (".db_string($LoggedUser['ID']).", $TorrentID, '$Type', '$Extra', 'New', '".sqltime()."', '$ExtraID')");
80
+    (".db_string($LoggedUser['ID']).", $TorrentID, '$Type', '$Extra', 'New', NOW(), '$ExtraID')");
81 81
 
82 82
 $ReportID = $DB->inserted_id();
83 83
 

+ 1
- 1
sections/reportsv2/ajax_new_report.php View File

@@ -83,7 +83,7 @@ $DB->query("
83 83
         UPDATE reportsv2
84 84
         SET
85 85
           Status = 'Resolved',
86
-          LastChangeTime = '".sqltime()."',
86
+          LastChangeTime = NOW(),
87 87
           ModComment = 'Report already dealt with (torrent deleted)'
88 88
         WHERE ID = $ReportID");
89 89
       $Cache->decrement('num_torrent_reportsv2');

+ 1
- 1
sections/reportsv2/static.php View File

@@ -302,7 +302,7 @@ if (count($Reports) === 0) {
302 302
         UPDATE reportsv2
303 303
         SET
304 304
           Status = 'Resolved',
305
-          LastChangeTime = '".sqltime()."',
305
+          LastChangeTime = NOW(),
306 306
           ModComment = 'Report already dealt with (torrent deleted)'
307 307
         WHERE ID = $ReportID");
308 308
       $Cache->decrement('num_torrent_reportsv2');

+ 1
- 1
sections/reportsv2/takereport.php View File

@@ -128,7 +128,7 @@ $DB->query("
128 128
   INSERT INTO reportsv2
129 129
     (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, Track, Image, ExtraID, Link)
130 130
   VALUES
131
-    (".db_string($LoggedUser['ID']).", $TorrentID, '".db_string($Type)."', '$Extra', 'New', '".sqltime()."', '".db_string($Tracks)."', '".db_string($Images)."', '".db_string($ExtraIDs)."', '".db_string($Links)."')");
131
+    (".db_string($LoggedUser['ID']).", $TorrentID, '".db_string($Type)."', '$Extra', 'New', NOW(), '".db_string($Tracks)."', '".db_string($Images)."', '".db_string($ExtraIDs)."', '".db_string($Links)."')");
132 132
 
133 133
 $ReportID = $DB->inserted_id();
134 134
 

+ 6
- 6
sections/reportsv2/takeresolve.php View File

@@ -78,7 +78,7 @@ if (($Escaped['resolve_type'] == 'manual' || $Escaped['resolve_type'] == 'dismis
78 78
     UPDATE reportsv2
79 79
     SET
80 80
       Status = 'Resolved',
81
-      LastChangeTime = '".sqltime()."',
81
+      LastChangeTime = NOW(),
82 82
       ModComment = '$Comment',
83 83
       ResolverID = '".$LoggedUser['ID']."'
84 84
     WHERE ID = '$ReportID'
@@ -125,7 +125,7 @@ if (!$TorrentExists) {
125 125
   $DB->query("
126 126
     UPDATE reportsv2
127 127
     SET Status = 'Resolved',
128
-      LastChangeTime = '".sqltime()."',
128
+      LastChangeTime = NOW(),
129 129
       ResolverID = '".$LoggedUser['ID']."',
130 130
       ModComment = 'Report already dealt with (torrent deleted).'
131 131
     WHERE ID = $ReportID");
@@ -138,7 +138,7 @@ if ($Report) {
138 138
   $DB->query("
139 139
     UPDATE reportsv2
140 140
     SET Status = 'Resolved',
141
-      LastChangeTime = '".sqltime()."',
141
+      LastChangeTime = NOW(),
142 142
       ResolverID = '".$LoggedUser['ID']."'
143 143
     WHERE ID = $ReportID
144 144
       AND Status != 'Resolved'");
@@ -163,7 +163,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
163 163
       INSERT IGNORE INTO torrents_bad_tags
164 164
         (TorrentID, UserID, TimeAdded)
165 165
       VALUES
166
-        ($TorrentID, ".$LoggedUser['ID']." , '".sqltime()."')");
166
+        ($TorrentID, ".$LoggedUser['ID']." , NOW())");
167 167
     $DB->query("
168 168
       SELECT GroupID
169 169
       FROM torrents
@@ -178,7 +178,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
178 178
       INSERT IGNORE INTO torrents_bad_folders
179 179
         (TorrentID, UserID, TimeAdded)
180 180
       VALUES
181
-        ($TorrentID, ".$LoggedUser['ID'].", '".sqltime()."')");
181
+        ($TorrentID, ".$LoggedUser['ID'].", NOW())");
182 182
     $DB->query("
183 183
       SELECT GroupID
184 184
       FROM torrents
@@ -192,7 +192,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
192 192
       INSERT IGNORE INTO torrents_bad_files
193 193
         (TorrentID, UserID, TimeAdded)
194 194
       VALUES
195
-        ($TorrentID, ".$LoggedUser['ID'].", '".sqltime()."')");
195
+        ($TorrentID, ".$LoggedUser['ID'].", NOW())");
196 196
     $DB->query("
197 197
       SELECT GroupID
198 198
       FROM torrents

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

@@ -111,7 +111,7 @@ $DB->query("
111 111
   UPDATE requests
112 112
   SET FillerID = $FillerID,
113 113
     TorrentID = $TorrentID,
114
-    TimeFilled = '".sqltime()."'
114
+    TimeFilled = NOW()
115 115
   WHERE ID = $RequestID");
116 116
 
117 117
 $ArtistForm = Requests::get_artists($RequestID);

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

@@ -242,7 +242,7 @@ if ($NewRequest) {
242 242
       UserID, TimeAdded, LastVote, CategoryID, Title, TitleRJ, TitleJP, Image, Description,
243 243
       CatalogueNumber, DLSiteID, Visible, GroupID)
244 244
     VALUES
245
-      ('.$LoggedUser['ID'].", '".sqltime()."', '".sqltime()."', $CategoryID, '".db_string($Title)."', '".db_string($TitleRJ)."', '".db_string($TitleJP)."', '".db_string($Image)."', '".db_string($Description)."',
245
+      ('.$LoggedUser['ID'].", NOW(), NOW(), $CategoryID, '".db_string($Title)."', '".db_string($TitleRJ)."', '".db_string($TitleJP)."', '".db_string($Image)."', '".db_string($Description)."',
246 246
           '".db_string($CatalogueNumber)."', '".db_string($DLSiteID)."', '1', '$GroupID')");
247 247
 
248 248
   $RequestID = $DB->inserted_id();

+ 1
- 1
sections/schedule/daily/ratio_reqs.php View File

@@ -4,7 +4,7 @@
4 4
 // Clear old seed time history
5 5
 $DB->query("
6 6
   DELETE FROM users_torrent_history
7
-  WHERE Date < DATE('".sqltime()."' - INTERVAL 7 DAY) + 0");
7
+  WHERE Date < DATE(NOW() - INTERVAL 7 DAY) + 0");
8 8
 
9 9
 // Store total seeded time for each user in a temp table
10 10
 $DB->query("TRUNCATE TABLE users_torrent_history_temp");

+ 1
- 8
sections/staffpm/makedonor.php View File

@@ -26,16 +26,9 @@ if ((int)$Donor === 0) {
26 26
 } else {
27 27
   $Message .= ' ';
28 28
 }
29
-/*
30
-$DB->query("
31
-  INSERT INTO staff_pm_messages
32
-    (UserID, SentDate, Message, ConvID)
33
-  VALUES
34
-    (".$LoggedUser['ID'].", '".sqltime()."', '".db_string($Message)."', $ConvID)");
35
-*/
36 29
 $DB->query("
37 30
   UPDATE staff_pm_conversations
38
-  SET Date = '".sqltime()."',
31
+  SET Date = NOW(),
39 32
     Unread = true,
40 33
     Status = 'Resolved',
41 34
     ResolverID = ".$LoggedUser['ID']."

+ 5
- 5
sections/staffpm/takepost.php View File

@@ -7,7 +7,7 @@ if ($Message = db_string($_POST['message'])) {
7 7
       INSERT INTO staff_pm_conversations
8 8
         (Subject, Status, Level, UserID, Date)
9 9
       VALUES
10
-        ('$Subject', 'Unanswered', $_POST[level], $LoggedUser[ID], '".sqltime()."')"
10
+        ('$Subject', 'Unanswered', $_POST[level], $LoggedUser[ID], NOW())"
11 11
     );
12 12
 
13 13
     // New message
@@ -16,7 +16,7 @@ if ($Message = db_string($_POST['message'])) {
16 16
       INSERT INTO staff_pm_messages
17 17
         (UserID, SentDate, Message, ConvID)
18 18
       VALUES
19
-        ($LoggedUser[ID], '".sqltime()."', '$Message', $ConvID)"
19
+        ($LoggedUser[ID], NOW(), '$Message', $ConvID)"
20 20
     );
21 21
 
22 22
     header('Location: staffpm.php');
@@ -38,7 +38,7 @@ if ($Message = db_string($_POST['message'])) {
38 38
         INSERT INTO staff_pm_messages
39 39
           (UserID, SentDate, Message, ConvID)
40 40
         VALUES
41
-          (".$LoggedUser['ID'].", '".sqltime()."', '$Message', $ConvID)"
41
+          (".$LoggedUser['ID'].", NOW(), '$Message', $ConvID)"
42 42
       );
43 43
 
44 44
       // Update conversation
@@ -46,7 +46,7 @@ if ($Message = db_string($_POST['message'])) {
46 46
         // FLS/Staff
47 47
         $DB->query("
48 48
           UPDATE staff_pm_conversations
49
-          SET Date = '".sqltime()."',
49
+          SET Date = NOW(),
50 50
             Unread = true,
51 51
             Status = 'Open'
52 52
           WHERE ID = $ConvID");
@@ -55,7 +55,7 @@ if ($Message = db_string($_POST['message'])) {
55 55
         // User
56 56
         $DB->query("
57 57
           UPDATE staff_pm_conversations
58
-          SET Date = '".sqltime()."',
58
+          SET Date = NOW(),
59 59
             Unread = true,
60 60
             Status = 'Unanswered'
61 61
           WHERE ID = $ConvID");

+ 3
- 3
sections/tools/data/torrent_stats.php View File

@@ -14,11 +14,11 @@ if (!$TorrentStats = $Cache->get_value('new_torrent_stats')) {
14 14
     FROM users_main
15 15
     WHERE Enabled = '1'");
16 16
   list($NumUsers) = $DB->next_record();
17
-  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 1 DAY)");
17
+  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE(NOW(), INTERVAL 1 DAY)");
18 18
   list($DayNum, $DaySize, $DayFiles) = $DB->next_record();
19
-  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 7 DAY)");
19
+  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE(NOW(), INTERVAL 7 DAY)");
20 20
   list($WeekNum, $WeekSize, $WeekFiles) = $DB->next_record();
21
-  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 30 DAY)");
21
+  $DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE(NOW(), INTERVAL 30 DAY)");
22 22
   list($MonthNum, $MonthSize, $MonthFiles) = $DB->next_record();
23 23
   $Cache->cache_value('new_torrent_stats', array($TorrentCount, $TotalSize, $TotalFiles,
24 24
             $NumUsers, $DayNum, $DaySize, $DayFiles,

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

@@ -173,7 +173,7 @@ switch ($_REQUEST['action']) {
173 173
 
174 174
     $DB->query("
175 175
       INSERT INTO news (UserID, Title, Body, Time)
176
-      VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')");
176
+      VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', NOW())");
177 177
     $Cache->delete_value('news_latest_id');
178 178
     $Cache->delete_value('news_latest_title');
179 179
     $Cache->delete_value('news');

+ 2
- 2
sections/tools/managers/dnu_alter.php View File

@@ -43,14 +43,14 @@ if ($_POST['submit'] == 'Reorder') { // Reorder
43 43
         Name = '$P[name]',
44 44
         Comment = '$P[comment]',
45 45
         UserID = '$LoggedUser[ID]',
46
-        Time = '".sqltime()."'
46
+        Time = NOW()
47 47
       WHERE ID = '$P[id]'");
48 48
   } else { //Create
49 49
     $DB->query("
50 50
       INSERT INTO do_not_upload
51 51
         (Name, Comment, UserID, Time, Sequence)
52 52
       VALUES
53
-        ('$P[name]','$P[comment]','$LoggedUser[ID]','".sqltime()."', 9999)");
53
+        ('$P[name]','$P[comment]','$LoggedUser[ID]', NOW(), 9999)");
54 54
   }
55 55
 }
56 56
 

+ 2
- 2
sections/tools/managers/email_blacklist_alter.php View File

@@ -33,12 +33,12 @@ if ($_POST['submit'] === 'Delete') { // Delete
33 33
         Email = '$P[email]',
34 34
         Comment = '$P[comment]',
35 35
         UserID = '$LoggedUser[ID]',
36
-        Time = '".sqltime()."'
36
+        Time = NOW()
37 37
       WHERE ID = '$P[id]'");
38 38
   } else { // Create
39 39
     $DB->query("
40 40
       INSERT INTO email_blacklist (Email, Comment, UserID, Time)
41
-      VALUES ('$P[email]', '$P[comment]', '$LoggedUser[ID]', '".sqltime()."')");
41
+      VALUES ('$P[email]', '$P[comment]', '$LoggedUser[ID]', NOW())");
42 42
   }
43 43
 }
44 44
 

+ 2
- 2
sections/tools/managers/featured_merch.php View File

@@ -23,11 +23,11 @@ if (!empty($_POST)) {
23 23
 
24 24
   $DB->query("
25 25
     UPDATE featured_merch
26
-    SET Ended = '".sqltime()."'
26
+    SET Ended = NOW()
27 27
     WHERE Ended = 0");
28 28
   $DB->query("
29 29
     INSERT INTO featured_merch (ProductID, Title, Image, ArtistID, Started)
30
-    VALUES ($ProductID, '$Title', '$Image', '$ArtistID', '".sqltime()."')");
30
+    VALUES ($ProductID, '$Title', '$Image', '$ArtistID', NOW())");
31 31
   $Cache->delete_value('featured_merch');
32 32
   header('Location: index.php');
33 33
   die();

+ 1
- 1
sections/tools/misc/create_user.php View File

@@ -52,7 +52,7 @@ if (isset($_POST['Username'])) {
52 52
       INSERT INTO users_info
53 53
         (UserID, StyleID, AuthKey, JoinDate)
54 54
       VALUES
55
-        ('".db_string($UserID)."', '".db_string($StyleID)."', '".db_string($AuthKey)."', '".sqltime()."')");
55
+        ('".db_string($UserID)."', '".db_string($StyleID)."', '".db_string($AuthKey)."', NOW())");
56 56
 
57 57
     // Give the notification settings
58 58
     $DB->query("INSERT INTO users_notifications_settings (UserID) VALUES ('$UserID')");

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

@@ -226,7 +226,7 @@ if ($Details == 'all' || $Details == 'month') {
226 226
         $Query .= $Where.' AND ';
227 227
       }
228 228
       $Query .= "
229
-        t.Time>'".sqltime()."' - INTERVAL 1 MONTH
229
+        t.Time > NOW() - INTERVAL 1 MONTH
230 230
         $GroupBy
231 231
         ORDER BY (t.Seeders + t.Leechers) DESC
232 232
         LIMIT $Limit;";
@@ -256,7 +256,7 @@ if ($Details == 'all' || $Details == 'year') {
256 256
         $Query .= $Where.' AND ';
257 257
       }
258 258
       $Query .= "
259
-        t.Time>'".sqltime()."' - INTERVAL 1 YEAR
259
+        t.Time > NOW() - INTERVAL 1 YEAR
260 260
         $GroupBy
261 261
         ORDER BY (t.Seeders + t.Leechers) DESC
262 262
         LIMIT $Limit;";

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

@@ -47,7 +47,7 @@ foreach ($Tags as $TagName) {
47 47
       INSERT INTO group_log
48 48
         (GroupID, UserID, Time, Info)
49 49
       VALUES
50
-        ('$GroupID', ".$LoggedUser['ID'].", '".sqltime()."', '".db_string("Tag \"$TagName\" added to group")."')");
50
+        ('$GroupID', ".$LoggedUser['ID'].", NOW(), '".db_string("Tag \"$TagName\" added to group")."')");
51 51
   }
52 52
 }
53 53
 

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

@@ -19,7 +19,7 @@ if (list($TagName) = $DB->next_record()) {
19 19
     INSERT INTO group_log
20 20
       (GroupID, UserID, Time, Info)
21 21
     VALUES
22
-      ('$GroupID',".$LoggedUser['ID'].",'".sqltime()."','".db_string('Tag "'.$TagName.'" removed from group')."')");
22
+      ('$GroupID',".$LoggedUser['ID'].", NOW(),'".db_string('Tag "'.$TagName.'" removed from group')."')");
23 23
 }
24 24
 
25 25
 $DB->query("

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

@@ -174,7 +174,7 @@ if ($Image != '') {
174 174
 
175 175
 $DB->query("
176 176
   INSERT IGNORE INTO users_downloads (UserID, TorrentID, Time)
177
-  VALUES ('$UserID', '$TorrentID', '".sqltime()."')");
177
+  VALUES ('$UserID', '$TorrentID', NOW())");
178 178
 
179 179
 Torrents::set_snatch_update_time($UserID, Torrents::SNATCHED_UPDATE_AFTERDL);
180 180
 $Contents = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');

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

@@ -71,7 +71,7 @@ $DB->query("
71 71
 if ($OldYear != $Year) {
72 72
   $DB->query("
73 73
     INSERT INTO group_log (GroupID, UserID, Time, Info)
74
-    VALUES ('$GroupID', ".$LoggedUser['ID'].", '".sqltime()."', '".db_string("Year changed from $OldYear to $Year")."')");
74
+    VALUES ('$GroupID', ".$LoggedUser['ID'].", NOW(), '".db_string("Year changed from $OldYear to $Year")."')");
75 75
 }
76 76
 
77 77
 $DB->query("

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

@@ -26,7 +26,7 @@ $DB->query("
26 26
   INSERT INTO group_log
27 27
     (GroupID, UserID, Time, Info)
28 28
   VALUES
29
-    ('$GroupID', ".$LoggedUser['ID'].", '".sqltime()."', '".db_string("Additional cover \"$Summary - $Image\" removed from group")."')");
29
+    ('$GroupID', ".$LoggedUser['ID'].", NOW(), '".db_string("Additional cover \"$Summary - $Image\" removed from group")."')");
30 30
 
31 31
 $Cache->delete_value("torrents_cover_art_$GroupID");
32 32
 header('Location: '.$_SERVER['HTTP_REFERER']);

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

@@ -82,7 +82,7 @@ foreach ($New as $Screenshot) {
82 82
     INSERT INTO torrents_screenshots
83 83
       (GroupID, UserID, Time, Image)
84 84
     VALUES
85
-      ($GroupID, $LoggedUser[ID], '".sqltime()."', '$Screenshot')");
85
+      ($GroupID, $LoggedUser[ID], NOW(), '$Screenshot')");
86 86
 }
87 87
 
88 88
 if (!empty($New)) {

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

@@ -50,7 +50,7 @@ switch ($Categories[$NewCategoryID-1]) {
50 50
       INSERT INTO torrents_group
51 51
         (ArtistID, CategoryID, Name, Year, ReleaseType, Time, WikiBody, WikiImage)
52 52
       VALUES
53
-        ($ArtistID, '1', '$Title', '$Year', '$ReleaseType', '".sqltime()."', '', '')");
53
+        ($ArtistID, '1', '$Title', '$Year', '$ReleaseType', NOW(), '', '')");
54 54
     $GroupID = $DB->inserted_id();
55 55
 
56 56
     $DB->query("
@@ -69,7 +69,7 @@ switch ($Categories[$NewCategoryID-1]) {
69 69
       INSERT INTO torrents_group
70 70
         (CategoryID, Name, Year, Time, WikiBody, WikiImage)
71 71
       VALUES
72
-        ($NewCategoryID, '$Title', '$Year', '".sqltime()."', '', '')");
72
+        ($NewCategoryID, '$Title', '$Year', NOW(), '', '')");
73 73
     $GroupID = $DB->inserted_id();
74 74
     break;
75 75
   case 'Applications':
@@ -80,7 +80,7 @@ switch ($Categories[$NewCategoryID-1]) {
80 80
       INSERT INTO torrents_group
81 81
         (CategoryID, Name, Time, WikiBody, WikiImage)
82 82
       VALUES
83
-        ($NewCategoryID, '$Title', '".sqltime()."', '', '')");
83
+        ($NewCategoryID, '$Title', NOW(), '', '')");
84 84
     $GroupID = $DB->inserted_id();
85 85
     break;
86 86
 }

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

@@ -332,7 +332,7 @@ if (check_perms('users_mod')) {
332 332
   if (!$btID && $Properties['BadTags']) {
333 333
     $DB->query("
334 334
       INSERT INTO torrents_bad_tags
335
-      VALUES ($TorrentID, $LoggedUser[ID], '".sqltime()."')");
335
+      VALUES ($TorrentID, $LoggedUser[ID], NOW())");
336 336
   }
337 337
   if ($btID && !$Properties['BadTags']) {
338 338
     $DB->query("
@@ -349,7 +349,7 @@ if (check_perms('users_mod')) {
349 349
   if (!$bfID && $Properties['BadFolders']) {
350 350
     $DB->query("
351 351
       INSERT INTO torrents_bad_folders
352
-      VALUES ($TorrentID, $LoggedUser[ID], '".sqltime()."')");
352
+      VALUES ($TorrentID, $LoggedUser[ID], NOW())");
353 353
   }
354 354
   if ($bfID && !$Properties['BadFolders']) {
355 355
     $DB->query("
@@ -366,7 +366,7 @@ if (check_perms('users_mod')) {
366 366
   if (!$bfiID && $Properties['BadFiles']) {
367 367
     $DB->query("
368 368
       INSERT INTO torrents_bad_files
369
-      VALUES ($TorrentID, $LoggedUser[ID], '".sqltime()."')");
369
+      VALUES ($TorrentID, $LoggedUser[ID], NOW())");
370 370
   }
371 371
   if ($bfiID && !$Properties['BadFiles']) {
372 372
     $DB->query("

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

@@ -73,7 +73,7 @@ if (empty($RevisionID)) { // edit
73 73
     INSERT INTO wiki_torrents
74 74
       (PageID, Body, Image, UserID, Summary, Time)
75 75
     VALUES
76
-      ('$GroupID', '".db_string($Body)."', '".db_string($Image)."', '$UserID', '$Summary', '".sqltime()."')");
76
+      ('$GroupID', '".db_string($Body)."', '".db_string($Image)."', '$UserID', '$Summary', NOW())");
77 77
 }
78 78
 else { // revert
79 79
   $DB->query("
@@ -88,7 +88,7 @@ else { // revert
88 88
   $DB->query("
89 89
     INSERT INTO wiki_torrents
90 90
       (PageID, Body, Image, UserID, Summary, Time)
91
-    SELECT '$GroupID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."'
91
+    SELECT '$GroupID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', NOW()
92 92
     FROM wiki_artists
93 93
     WHERE RevisionID = '$RevisionID'");
94 94
 }

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

@@ -71,7 +71,7 @@ if (empty($_POST['confirm'])) {
71 71
     INSERT INTO torrents_group
72 72
       (CategoryID, Name, Year, Time, WikiBody, WikiImage)
73 73
     VALUES
74
-      ('$CategoryID', '$Title', '$Year', '".sqltime()."', '', '')");
74
+      ('$CategoryID', '$Title', '$Year', NOW(), '', '')");
75 75
   $GroupID = $DB->inserted_id();
76 76
 
77 77
   $DB->query("

+ 1
- 1
sections/upload/insert_extra_torrents.php View File

@@ -14,7 +14,7 @@ foreach ($ExtraTorrentsInsert as $ExtraTorrent) {
14 14
     ($GroupID, $LoggedUser[ID], $T[Media], '$ExtraTorrent[Format]', '$ExtraTorrent[Encoding]',
15 15
     $T[Remastered], $T[RemasterYear], $T[RemasterTitle], $T[RemasterRecordLabel], $T[RemasterCatalogueNumber],
16 16
     $ExtraHasLog, $ExtraHasCue, '".db_string($ExtraTorrent['InfoHash'])."', $ExtraTorrent[NumFiles],
17
-    '$ExtraTorrent[FileString]', '$ExtraTorrent[FilePath]', $ExtraTorrent[TotalSize], '".sqltime()."',
17
+    '$ExtraTorrent[FileString]', '$ExtraTorrent[FilePath]', $ExtraTorrent[TotalSize], NOW(),
18 18
     '$ExtraTorrent[TorrentDescription]', $LogScore, '$T[FreeLeech]', '$T[FreeLeechType]')");
19 19
 
20 20
   $Cache->increment('stats_torrent_count');

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

@@ -456,7 +456,7 @@ if (!isset($GroupID) || !$GroupID) {
456 456
     INSERT INTO torrents_group
457 457
       (CategoryID, Name, NameRJ, NameJP, Year, Series, Studio, CatalogueNumber, Pages, Time, WikiBody, WikiImage, DLsiteID)
458 458
     VALUES
459
-      ($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'].")");
459
+      ($TypeID, ".$T['Title'].", ".$T['TitleRJ'].", ".$T['TitleJP'].", ".$T['Year'].", ".$T['Series'].", ".$T['Studio'].", ".$T['CatalogueNumber'].", " . $T['Pages'] . ", NOW(), '".db_string($Body)."', ".$T['Image'].", ".$T['DLsiteID'].")");
460 460
   $GroupID = $DB->inserted_id();
461 461
   foreach ($ArtistForm as $Num => $Artist) {
462 462
     $DB->query("
@@ -485,7 +485,7 @@ if (!isset($GroupID) || !$GroupID) {
485 485
 } else {
486 486
   $DB->query("
487 487
     UPDATE torrents_group
488
-    SET Time = '".sqltime()."'
488
+    SET Time = NOW()
489 489
     WHERE ID = $GroupID");
490 490
   $Cache->delete_value("torrent_group_$GroupID");
491 491
   $Cache->delete_value("torrents_details_$GroupID");
@@ -498,7 +498,7 @@ if (!isset($NoRevision) || !$NoRevision) {
498 498
     INSERT INTO wiki_torrents
499 499
       (PageID, Body, UserID, Summary, Time, Image)
500 500
     VALUES
501
-      ($GroupID, $T[GroupDescription], $LoggedUser[ID], 'Uploaded new torrent', '".sqltime()."', $T[Image])");
501
+      ($GroupID, $T[GroupDescription], $LoggedUser[ID], 'Uploaded new torrent', NOW(), $T[Image])");
502 502
   $RevisionID = $DB->inserted_id();
503 503
 
504 504
   // Revision ID
@@ -571,7 +571,7 @@ $DB->query("
571 571
   VALUES
572 572
     ($GroupID, $LoggedUser[ID], $T[Media], $T[Container], $T[Codec], $T[Resolution], $T[AudioFormat],
573 573
     $T[Subbing], $T[Language], $T[Subber], $T[Censored], $T[Anonymous], $T[Archive],'".db_string($InfoHash)."', $NumFiles, '$FileString',
574
-    '$FilePath', $TotalSize, '".sqltime()."', $T[TorrentDescription], $T[MediaInfo], '$T[FreeTorrent]', '$T[FreeLeechType]')");
574
+    '$FilePath', $TotalSize, NOW(), $T[TorrentDescription], $T[MediaInfo], '$T[FreeTorrent]', '$T[FreeLeechType]')");
575 575
 
576 576
 $Cache->increment('stats_torrent_count');
577 577
 $TorrentID = $DB->inserted_id();

+ 2
- 2
sections/user/takemoderate.php View File

@@ -490,7 +490,7 @@ if ($Warned == 1 && !$Cur['Warned'] && check_perms('users_warn')) {
490 490
   $Weeks = 'week' . ($WarnLength === 1 ? '' : 's');
491 491
   Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=".site_url()."wiki.php?action=article&amp;name=warnings]warned for $WarnLength {$Weeks}[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was:
492 492
 [quote]{$WarnReason}[/quote]");
493
-  $UpdateSet[] = "Warned = '".sqltime()."' + INTERVAL $WarnLength WEEK";
493
+  $UpdateSet[] = "Warned = NOW() + INTERVAL $WarnLength WEEK";
494 494
   $Msg = "warned for $WarnLength $Weeks";
495 495
   if ($WarnReason) {
496 496
     $Msg .= " for \"$WarnReason\"";
@@ -734,7 +734,7 @@ if ($ResetPasskey == 1 && check_perms('users_edit_reset_keys')) {
734 734
     INSERT INTO users_history_passkeys
735 735
       (UserID, OldPassKey, NewPassKey, ChangerIP, ChangeTime)
736 736
     VALUES
737
-      ('$UserID', '".$Cur['torrent_pass']."', '$Passkey', '".DBCrypt::encrypt('0.0.0.0')."', '".sqltime()."')");
737
+      ('$UserID', '".$Cur['torrent_pass']."', '$Passkey', '".DBCrypt::encrypt('0.0.0.0')."', NOW())");
738 738
   Tracker::update_tracker('change_passkey', array('oldpasskey' => $Cur['torrent_pass'], 'newpasskey' => $Passkey));
739 739
 }
740 740
 

+ 2
- 2
sections/userhistory/email_history.php View File

@@ -41,7 +41,7 @@ if ($UsersOnly == 1) {
41 41
   $DB->query("
42 42
     SELECT
43 43
       u.Email,
44
-      '".sqltime()."' AS Time,
44
+      NOW() AS Time,
45 45
       u.IP,
46 46
       c.Code
47 47
     FROM users_main AS u
@@ -66,7 +66,7 @@ if ($UsersOnly == 1) {
66 66
   $DB->query("
67 67
     SELECT
68 68
       u.Email,
69
-      '".sqltime()."' AS Time,
69
+      NOW() AS Time,
70 70
       u.IP,
71 71
       c.Code
72 72
     FROM users_main AS u

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

@@ -43,7 +43,7 @@ View::show_header("Email history for $Username");
43 43
 $DB->query("
44 44
   SELECT
45 45
     m.Email,
46
-    '".sqltime()."' AS Time,
46
+    NOW() AS Time,
47 47
     m.IP,
48 48
     GROUP_CONCAT(h.UserID SEPARATOR '|') AS UserIDs,
49 49
     GROUP_CONCAT(h.Time SEPARATOR '|') AS UserSetTimes,

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

@@ -50,7 +50,7 @@ $DB->query("
50 50
   INSERT INTO wiki_articles
51 51
     (Revision, Title, Body, MinClassRead, MinClassEdit, Date, Author)
52 52
   VALUES
53
-    ('1', '$P[title]', '$P[body]', '$Read', '$Edit', '".sqltime()."', '$LoggedUser[ID]')");
53
+    ('1', '$P[title]', '$P[body]', '$Read', '$Edit', NOW(), '$LoggedUser[ID]')");
54 54
 
55 55
 $ArticleID = $DB->inserted_id();
56 56
 

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

@@ -65,7 +65,7 @@ if ($Read && $Edit) {
65 65
     MinClassEdit = '$Edit',";
66 66
 }
67 67
 $SQL .= "
68
-    Date = '".sqltime()."',
68
+    Date = NOW(),
69 69
     Author = '$LoggedUser[ID]'
70 70
   WHERE ID = '$P[id]'";
71 71
 $DB->query($SQL);

Loading…
Cancel
Save