Browse Source

torrents_doi

biotorrents 4 years ago
parent
commit
06a73b48c5

+ 1
- 1
gazelle.sql View File

1212
   KEY `Time` (`Time`)
1212
   KEY `Time` (`Time`)
1213
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1213
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1214
 
1214
 
1215
-CREATE TABLE `torrents_screenshots` (
1215
+CREATE TABLE `torrents_doi` (
1216
   `ID` int NOT NULL AUTO_INCREMENT,
1216
   `ID` int NOT NULL AUTO_INCREMENT,
1217
   `TorrentID` int NOT NULL,
1217
   `TorrentID` int NOT NULL,
1218
   `UserID` int NOT NULL,
1218
   `UserID` int NOT NULL,

+ 1
- 1
sections/better/screenshots.php View File

23
   SELECT DISTINCT
23
   SELECT DISTINCT
24
     `TorrentID`
24
     `TorrentID`
25
   FROM
25
   FROM
26
-    `torrents_screenshots`
26
+    `torrents_doi`
27
   )
27
   )
28
 ORDER BY
28
 ORDER BY
29
   RAND()
29
   RAND()

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

56
   `Time`,
56
   `Time`,
57
   `URI`
57
   `URI`
58
 FROM
58
 FROM
59
-  `torrents_screenshots`
59
+  `torrents_doi`
60
 WHERE
60
 WHERE
61
-  `GroupID` = '$GroupID'
61
+  `TorrentID` = '$GroupID'
62
 ");
62
 ");
63
 
63
 
64
 if ($DB->has_results()) {
64
 if ($DB->has_results()) {

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

63
           `Time`,
63
           `Time`,
64
           `URI`
64
           `URI`
65
         FROM
65
         FROM
66
-          `torrents_screenshots`
66
+          `torrents_doi`
67
         WHERE
67
         WHERE
68
-          `GroupID` = '$GroupID'
68
+          `TorrentID` = '$GroupID'
69
         ");
69
         ");
70
 
70
 
71
         if ($DB->has_results()) {
71
         if ($DB->has_results()) {

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

39
   `UserID`,
39
   `UserID`,
40
   `URI`
40
   `URI`
41
 FROM
41
 FROM
42
-  `torrents_screenshots`
42
+  `torrents_doi`
43
 WHERE
43
 WHERE
44
-  `GroupID` = '$GroupID'
44
+  `TorrentID` = '$GroupID'
45
 ");
45
 ");
46
 
46
 
47
 // $Old is an array of the form URL => UserID where UserID is the ID of the User who originally uploaded that image.
47
 // $Old is an array of the form URL => UserID where UserID is the ID of the User who originally uploaded that image.
81
         $DB->prepare_query("
81
         $DB->prepare_query("
82
         DELETE
82
         DELETE
83
         FROM
83
         FROM
84
-          `torrents_screenshots`
84
+          `torrents_doi`
85
         WHERE
85
         WHERE
86
           `URI` = '$ScreenDel'
86
           `URI` = '$ScreenDel'
87
         ");
87
         ");
100
     $Screenshot = '';
100
     $Screenshot = '';
101
     $DB->prepare_query(
101
     $DB->prepare_query(
102
         "
102
         "
103
-    INSERT INTO `torrents_screenshots`
104
-      (`GroupID`, `UserID`, `Time`, `URI`)
103
+    INSERT INTO `torrents_doi`
104
+      (`TorrentID`, `UserID`, `Time`, `URI`)
105
     VALUES
105
     VALUES
106
       (?, ?, NOW(), ?)",
106
       (?, ?, NOW(), ?)",
107
         $GroupID,
107
         $GroupID,

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

602
     if (!empty($Screenshots)) {
602
     if (!empty($Screenshots)) {
603
         $Screenshot = '';
603
         $Screenshot = '';
604
         $DB->prepare_query("
604
         $DB->prepare_query("
605
-          INSERT INTO torrents_screenshots
606
-            (GroupID, UserID, Time, Image)
605
+          INSERT INTO torrents_doi
606
+            (TorrentID, UserID, Time, URI)
607
           VALUES (?, ?, NOW(), ?)", $GroupID, $LoggedUser['ID'], $Screenshot);
607
           VALUES (?, ?, NOW(), ?)", $GroupID, $LoggedUser['ID'], $Screenshot);
608
 
608
 
609
         foreach ($Screenshots as $Screenshot) {
609
         foreach ($Screenshots as $Screenshot) {

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

128
   if ($Override = check_paranoia_here('screenshotcount')) {
128
   if ($Override = check_paranoia_here('screenshotcount')) {
129
   $DB->query("
129
   $DB->query("
130
     SELECT COUNT(*)
130
     SELECT COUNT(*)
131
-    FROM torrents_screenshots
131
+    FROM torrents_doi
132
     WHERE UserID = '$UserID'");
132
     WHERE UserID = '$UserID'");
133
   list($Screenshots) = $DB->next_record();
133
   list($Screenshots) = $DB->next_record();
134
 ?>
134
 ?>

Loading…
Cancel
Save