Browse Source

Remove tag voting

Analysis has shown that this system doesn't actually accomplish
anything. Users do not vote on tags often enough to actually get any tag
removed, so why even bother?

Non-critical database change with this commit
spaghetti 7 years ago
parent
commit
61603a4c1b

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

464
     G::$DB->query("
464
     G::$DB->query("
465
       DELETE FROM torrents_tags
465
       DELETE FROM torrents_tags
466
       WHERE GroupID = '$GroupID'");
466
       WHERE GroupID = '$GroupID'");
467
-    G::$DB->query("
468
-      DELETE FROM torrents_tags_votes
469
-      WHERE GroupID = '$GroupID'");
470
     G::$DB->query("
467
     G::$DB->query("
471
       DELETE FROM bookmarks_torrents
468
       DELETE FROM bookmarks_torrents
472
       WHERE GroupID = '$GroupID'");
469
       WHERE GroupID = '$GroupID'");

+ 0
- 12
gazelle.sql View File

1235
 CREATE TABLE `torrents_tags` (
1235
 CREATE TABLE `torrents_tags` (
1236
   `TagID` int(10) NOT NULL DEFAULT '0',
1236
   `TagID` int(10) NOT NULL DEFAULT '0',
1237
   `GroupID` int(10) NOT NULL DEFAULT '0',
1237
   `GroupID` int(10) NOT NULL DEFAULT '0',
1238
-  `PositiveVotes` int(6) NOT NULL DEFAULT '1',
1239
-  `NegativeVotes` int(6) NOT NULL DEFAULT '1',
1240
   `UserID` int(10) DEFAULT NULL,
1238
   `UserID` int(10) DEFAULT NULL,
1241
   PRIMARY KEY (`TagID`,`GroupID`),
1239
   PRIMARY KEY (`TagID`,`GroupID`),
1242
   KEY `TagID` (`TagID`),
1240
   KEY `TagID` (`TagID`),
1243
   KEY `GroupID` (`GroupID`),
1241
   KEY `GroupID` (`GroupID`),
1244
-  KEY `PositiveVotes` (`PositiveVotes`),
1245
-  KEY `NegativeVotes` (`NegativeVotes`),
1246
   KEY `UserID` (`UserID`)
1242
   KEY `UserID` (`UserID`)
1247
 ) ENGINE=InnoDB CHARSET=utf8;
1243
 ) ENGINE=InnoDB CHARSET=utf8;
1248
 
1244
 
1249
-CREATE TABLE `torrents_tags_votes` (
1250
-  `GroupID` int(10) NOT NULL,
1251
-  `TagID` int(10) NOT NULL,
1252
-  `UserID` int(10) NOT NULL,
1253
-  `Way` enum('up','down') NOT NULL DEFAULT 'up',
1254
-  PRIMARY KEY (`GroupID`,`TagID`,`UserID`,`Way`)
1255
-) ENGINE=InnoDB CHARSET=utf8;
1256
-
1257
 CREATE TABLE `u2f` (
1245
 CREATE TABLE `u2f` (
1258
   `UserID` int(10) NOT NULL,
1246
   `UserID` int(10) NOT NULL,
1259
   `KeyHandle` varchar(255) NOT NULL,
1247
   `KeyHandle` varchar(255) NOT NULL,

+ 13
- 41
sections/ajax/top10/tags.php View File

3
 
3
 
4
 // error out on invalid requests (before caching)
4
 // error out on invalid requests (before caching)
5
 if (isset($_GET['details'])) {
5
 if (isset($_GET['details'])) {
6
-  if (in_array($_GET['details'],array('ut','ur','v'))) {
6
+  if (in_array($_GET['details'], ['ut','ur'])) {
7
     $Details = $_GET['details'];
7
     $Details = $_GET['details'];
8
   } else {
8
   } else {
9
-    print json_encode(array('status' => 'failure'));
9
+    print json_encode(['status' => 'failure']);
10
     die();
10
     die();
11
   }
11
   }
12
 } else {
12
 } else {
15
 
15
 
16
 // defaults to 10 (duh)
16
 // defaults to 10 (duh)
17
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
17
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
18
-$Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
18
+$Limit = in_array($Limit, [10, 100, 250]) ? $Limit : 10;
19
 $OuterResults = [];
19
 $OuterResults = [];
20
 
20
 
21
 if ($Details == 'all' || $Details == 'ut') {
21
 if ($Details == 'all' || $Details == 'ut') {
24
       SELECT
24
       SELECT
25
         t.ID,
25
         t.ID,
26
         t.Name,
26
         t.Name,
27
-        COUNT(tt.GroupID) AS Uses,
28
-        SUM(tt.PositiveVotes - 1) AS PosVotes,
29
-        SUM(tt.NegativeVotes - 1) AS NegVotes
27
+        COUNT(tt.GroupID) AS Uses
30
       FROM tags AS t
28
       FROM tags AS t
31
         JOIN torrents_tags AS tt ON tt.TagID = t.ID
29
         JOIN torrents_tags AS tt ON tt.TagID = t.ID
32
       GROUP BY tt.TagID
30
       GROUP BY tt.TagID
59
   $OuterResults[] = generate_tag_json('Most Used Request Tags', 'ur', $TopRequestTags, $Limit);
57
   $OuterResults[] = generate_tag_json('Most Used Request Tags', 'ur', $TopRequestTags, $Limit);
60
 }
58
 }
61
 
59
 
62
-if ($Details == 'all' || $Details == 'v') {
63
-  if (!$TopVotedTags = $Cache->get_value("topvotedtag_$Limit")) {
64
-    $DB->query("
65
-      SELECT
66
-        t.ID,
67
-        t.Name,
68
-        COUNT(tt.GroupID) AS Uses,
69
-        SUM(tt.PositiveVotes - 1) AS PosVotes,
70
-        SUM(tt.NegativeVotes - 1) AS NegVotes
71
-      FROM tags AS t
72
-        JOIN torrents_tags AS tt ON tt.TagID = t.ID
73
-      GROUP BY tt.TagID
74
-      ORDER BY PosVotes DESC
75
-      LIMIT $Limit");
76
-    $TopVotedTags = $DB->to_array();
77
-    $Cache->cache_value("topvotedtag_$Limit", $TopVotedTags, 3600 * 12);
78
-  }
79
-
80
-  $OuterResults[] = generate_tag_json('Most Highly Voted Tags', 'v', $TopVotedTags, $Limit);
81
-}
82
-
83
-print
84
-  json_encode(
85
-    array(
86
-      'status' => 'success',
87
-      'response' => $OuterResults
88
-    )
89
-  );
60
+print json_encode([
61
+  'status' => 'success',
62
+  'response' => $OuterResults
63
+]);
90
 
64
 
91
 function generate_tag_json($Caption, $Tag, $Details, $Limit) {
65
 function generate_tag_json($Caption, $Tag, $Details, $Limit) {
92
   $results = [];
66
   $results = [];
93
   foreach ($Details as $Detail) {
67
   foreach ($Details as $Detail) {
94
-    $results[] = array(
68
+    $results[] = [
95
       'name' => $Detail['Name'],
69
       'name' => $Detail['Name'],
96
-      'uses' => (int)$Detail['Uses'],
97
-      'posVotes' => (int)$Detail['PosVotes'],
98
-      'negVotes' => (int)$Detail['NegVotes']
99
-    );
70
+      'uses' => (int)$Detail['Uses']
71
+    ];
100
   }
72
   }
101
 
73
 
102
-  return array(
74
+  return [
103
     'caption' => $Caption,
75
     'caption' => $Caption,
104
     'tag' => $Tag,
76
     'tag' => $Tag,
105
     'limit' => (int)$Limit,
77
     'limit' => (int)$Limit,
106
     'results' => $results
78
     'results' => $results
107
-    );
79
+  ];
108
 }
80
 }

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

35
   list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameJP, $GroupYear,
35
   list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameJP, $GroupYear,
36
     $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID,
36
     $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID,
37
     $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
37
     $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
38
-    $TagPositiveVotes, $TagNegativeVotes, $Screenshots, $GroupFlags) = array_values($GroupDetails);
38
+    $Screenshots, $GroupFlags) = array_values($GroupDetails);
39
 
39
 
40
   $DisplayName = $GroupName;
40
   $DisplayName = $GroupName;
41
   $AltName = $GroupName; // Goes in the alt text of the image
41
   $AltName = $GroupName; // Goes in the alt text of the image

+ 0
- 8
sections/schedule/every/delete_tags.php View File

1
-<?
2
-//------------- Delete unpopular tags -----------------------------------//
3
-
4
-$DB->query("
5
-  DELETE FROM torrents_tags
6
-  WHERE NegativeVotes > 1
7
-    AND NegativeVotes > PositiveVotes");
8
-?>

+ 7
- 39
sections/top10/tags.php View File

1
 <?
1
 <?
2
 // error out on invalid requests (before caching)
2
 // error out on invalid requests (before caching)
3
 if (isset($_GET['details'])) {
3
 if (isset($_GET['details'])) {
4
-  if (in_array($_GET['details'],array('ut','ur','v'))) {
4
+  if (in_array($_GET['details'], ['ut','ur'])) {
5
     $Details = $_GET['details'];
5
     $Details = $_GET['details'];
6
   } else {
6
   } else {
7
     error(404);
7
     error(404);
22
 
22
 
23
 // defaults to 10 (duh)
23
 // defaults to 10 (duh)
24
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
24
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
25
-$Limit = in_array($Limit, array(10,100,250)) ? $Limit : 10;
25
+$Limit = in_array($Limit, [10,100,250]) ? $Limit : 10;
26
 
26
 
27
 if ($Details == 'all' || $Details == 'ut') {
27
 if ($Details == 'all' || $Details == 'ut') {
28
   if (!$TopUsedTags = $Cache->get_value('topusedtag_'.$Limit)) {
28
   if (!$TopUsedTags = $Cache->get_value('topusedtag_'.$Limit)) {
30
       SELECT
30
       SELECT
31
         t.ID,
31
         t.ID,
32
         t.Name,
32
         t.Name,
33
-        COUNT(tt.GroupID) AS Uses,
34
-        SUM(tt.PositiveVotes-1) AS PosVotes,
35
-        SUM(tt.NegativeVotes-1) AS NegVotes
33
+        COUNT(tt.GroupID) AS Uses
36
       FROM tags AS t
34
       FROM tags AS t
37
         JOIN torrents_tags AS tt ON tt.TagID=t.ID
35
         JOIN torrents_tags AS tt ON tt.TagID=t.ID
38
       GROUP BY tt.TagID
36
       GROUP BY tt.TagID
51
       SELECT
49
       SELECT
52
         t.ID,
50
         t.ID,
53
         t.Name,
51
         t.Name,
54
-        COUNT(r.RequestID) AS Uses,
55
-        '',''
52
+        COUNT(r.RequestID) AS Uses
56
       FROM tags AS t
53
       FROM tags AS t
57
         JOIN requests_tags AS r ON r.TagID=t.ID
54
         JOIN requests_tags AS r ON r.TagID=t.ID
58
       GROUP BY r.TagID
55
       GROUP BY r.TagID
62
     $Cache->cache_value('toprequesttag_'.$Limit, $TopRequestTags, 3600 * 12);
59
     $Cache->cache_value('toprequesttag_'.$Limit, $TopRequestTags, 3600 * 12);
63
   }
60
   }
64
 
61
 
65
-  generate_tag_table('Most Used Request Tags', 'ur', $TopRequestTags, $Limit, false, true);
66
-}
67
-
68
-if ($Details == 'all' || $Details == 'v') {
69
-  if (!$TopVotedTags = $Cache->get_value('topvotedtag_'.$Limit)) {
70
-    $DB->query("
71
-      SELECT
72
-        t.ID,
73
-        t.Name,
74
-        COUNT(tt.GroupID) AS Uses,
75
-        SUM(tt.PositiveVotes-1) AS PosVotes,
76
-        SUM(tt.NegativeVotes-1) AS NegVotes
77
-      FROM tags AS t
78
-        JOIN torrents_tags AS tt ON tt.TagID=t.ID
79
-      GROUP BY tt.TagID
80
-      ORDER BY PosVotes DESC
81
-      LIMIT $Limit");
82
-    $TopVotedTags = $DB->to_array();
83
-    $Cache->cache_value('topvotedtag_'.$Limit, $TopVotedTags, 3600 * 12);
84
-  }
85
-
86
-  generate_tag_table('Most Highly Voted Tags', 'v', $TopVotedTags, $Limit);
62
+  generate_tag_table('Most Used Request Tags', 'ur', $TopRequestTags, $Limit, true);
87
 }
63
 }
88
 
64
 
89
 echo '</div>';
65
 echo '</div>';
91
 exit;
67
 exit;
92
 
68
 
93
 // generate a table based on data from most recent query to $DB
69
 // generate a table based on data from most recent query to $DB
94
-function generate_tag_table($Caption, $Tag, $Details, $Limit, $ShowVotes = true, $RequestsTable = false) {
70
+function generate_tag_table($Caption, $Tag, $Details, $Limit, $RequestsTable = false) {
95
   if ($RequestsTable) {
71
   if ($RequestsTable) {
96
     $URLString = 'requests.php?tags=';
72
     $URLString = 'requests.php?tags=';
97
   } else {
73
   } else {
123
   <tr class="colhead">
99
   <tr class="colhead">
124
     <td class="center">Rank</td>
100
     <td class="center">Rank</td>
125
     <td>Tag</td>
101
     <td>Tag</td>
126
-    <td style="text-align: right;">Uses</td>
127
-<?  if ($ShowVotes) {  ?>
128
-    <td style="text-align: right;">Pos. votes</td>
129
-    <td style="text-align: right;">Neg. votes</td>
130
-<?  }  ?>
102
+    <td class="center">Uses</td>
131
   </tr>
103
   </tr>
132
 <?
104
 <?
133
   // in the unlikely event that query finds 0 rows...
105
   // in the unlikely event that query finds 0 rows...
154
     <td class="center"><?=$Rank?></td>
126
     <td class="center"><?=$Rank?></td>
155
     <td><a class="<?=$Class?>" href="<?=$URLString?><?=$Detail['Name']?>"><?=$DisplayName?></a></td>
127
     <td><a class="<?=$Class?>" href="<?=$URLString?><?=$Detail['Name']?>"><?=$DisplayName?></a></td>
156
     <td class="number_column"><?=number_format($Detail['Uses'])?></td>
128
     <td class="number_column"><?=number_format($Detail['Uses'])?></td>
157
-<?    if ($ShowVotes) { ?>
158
-    <td class="number_column"><?=number_format($Detail['PosVotes'])?></td>
159
-    <td class="number_column"><?=number_format($Detail['NegVotes'])?></td>
160
-<?    } ?>
161
   </tr>
129
   </tr>
162
 <?
130
 <?
163
   }
131
   }

+ 3
- 21
sections/torrents/add_tag.php View File

34
         INSERT INTO tags (Name, UserID)
34
         INSERT INTO tags (Name, UserID)
35
         VALUES ('$TagName', $UserID)");
35
         VALUES ('$TagName', $UserID)");
36
       $TagID = $DB->inserted_id();
36
       $TagID = $DB->inserted_id();
37
-    } else {
38
-      $DB->query("
39
-        SELECT TagID
40
-        FROM torrents_tags_votes
41
-        WHERE GroupID = '$GroupID'
42
-          AND TagID = '$TagID'
43
-          AND UserID = '$UserID'");
44
-      if ($DB->has_results()) { // User has already voted on this tag, and is trying hax to make the rating go up
45
-        header('Location: '.$_SERVER['HTTP_REFERER']);
46
-        die();
47
-      }
48
     }
37
     }
49
 
38
 
50
     $DB->query("
39
     $DB->query("
51
       INSERT INTO torrents_tags
40
       INSERT INTO torrents_tags
52
-        (TagID, GroupID, PositiveVotes, UserID)
53
-      VALUES
54
-        ('$TagID', '$GroupID', '3', '$UserID')
55
-      ON DUPLICATE KEY UPDATE
56
-        PositiveVotes = PositiveVotes + 2");
57
-
58
-    $DB->query("
59
-      INSERT INTO torrents_tags_votes
60
-        (GroupID, TagID, UserID, Way)
41
+        (TagID, GroupID, UserID)
61
       VALUES
42
       VALUES
62
-        ('$GroupID', '$TagID', '$UserID', 'up')");
43
+        ('$TagID', '$GroupID', '$UserID')
44
+      ON DUPLICATE KEY UPDATE TagID=TagID");
63
 
45
 
64
     $DB->query("
46
     $DB->query("
65
       INSERT INTO group_log
47
       INSERT INTO group_log

+ 0
- 4
sections/torrents/delete_tag.php View File

22
       ('$GroupID',".$LoggedUser['ID'].",'".sqltime()."','".db_string('Tag "'.$TagName.'" removed from group')."')");
22
       ('$GroupID',".$LoggedUser['ID'].",'".sqltime()."','".db_string('Tag "'.$TagName.'" removed from group')."')");
23
 }
23
 }
24
 
24
 
25
-$DB->query("
26
-  DELETE FROM torrents_tags_votes
27
-  WHERE GroupID = '$GroupID'
28
-    AND TagID = '$TagID'");
29
 $DB->query("
25
 $DB->query("
30
   DELETE FROM torrents_tags
26
   DELETE FROM torrents_tags
31
   WHERE GroupID = '$GroupID'
27
   WHERE GroupID = '$GroupID'

+ 2
- 25
sections/torrents/details.php View File

22
 list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP, $GroupYear,
22
 list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameRJ, $GroupNameJP, $GroupYear,
23
   $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupPages, $GroupCategoryID,
23
   $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupPages, $GroupCategoryID,
24
   $GroupDLsiteID, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
24
   $GroupDLsiteID, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
25
-  $TagPositiveVotes, $TagNegativeVotes, $Screenshots, $GroupFlags) = array_values($TorrentDetails);
25
+  $Screenshots, $GroupFlags) = array_values($TorrentDetails);
26
 
26
 
27
 if (!$GroupName) {
27
 if (!$GroupName) {
28
   if (!$GroupNameRJ) {
28
   if (!$GroupNameRJ) {
78
 if ($GroupDLsiteID) {
78
 if ($GroupDLsiteID) {
79
   $DisplayName .= " [$GroupDLsiteID]";
79
   $DisplayName .= " [$GroupDLsiteID]";
80
 }
80
 }
81
-/*
82
-if ($GroupVanityHouse) {
83
-  $DisplayName .= ' [Vanity House]';
84
-  $AltName .= ' [Vanity House]';
85
-}
86
-*/
87
-/*if ($GroupCategoryID == 1) {
88
-  $DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
89
-  $AltName .= ' ['.$ReleaseTypes[$ReleaseType].']';
90
-}*/
91
 
81
 
92
 $Tags = [];
82
 $Tags = [];
93
 if ($TorrentTags != '') {
83
 if ($TorrentTags != '') {
94
   $TorrentTags = explode('|', $TorrentTags);
84
   $TorrentTags = explode('|', $TorrentTags);
95
   $TorrentTagIDs = explode('|', $TorrentTagIDs);
85
   $TorrentTagIDs = explode('|', $TorrentTagIDs);
96
   $TorrentTagUserIDs = explode('|', $TorrentTagUserIDs);
86
   $TorrentTagUserIDs = explode('|', $TorrentTagUserIDs);
97
-  $TagPositiveVotes = explode('|', $TagPositiveVotes);
98
-  $TagNegativeVotes = explode('|', $TagNegativeVotes);
99
 
87
 
100
   foreach ($TorrentTags as $TagKey => $TagName) {
88
   foreach ($TorrentTags as $TagKey => $TagName) {
101
     $Tags[$TagKey]['name'] = $TagName;
89
     $Tags[$TagKey]['name'] = $TagName;
102
-    $Tags[$TagKey]['score'] = ($TagPositiveVotes[$TagKey] - $TagNegativeVotes[$TagKey]);
103
     $Tags[$TagKey]['id'] = $TorrentTagIDs[$TagKey];
90
     $Tags[$TagKey]['id'] = $TorrentTagIDs[$TagKey];
104
     $Tags[$TagKey]['userid'] = $TorrentTagUserIDs[$TagKey];
91
     $Tags[$TagKey]['userid'] = $TorrentTagUserIDs[$TagKey];
105
 
92
 
111
   uasort($Tags, 'compare');
98
   uasort($Tags, 'compare');
112
 }
99
 }
113
 
100
 
114
-/*if (check_perms('site_debug')) {
115
-  print_r($TorrentTags);
116
-  print_r($Tags);
117
-  print_r($TorrentTagUserIDs);
118
-  die();
119
-}*/
120
-
121
 $CoverArt = $Cache->get_value("torrents_cover_art_$GroupID");
101
 $CoverArt = $Cache->get_value("torrents_cover_art_$GroupID");
122
 if (!$CoverArt) {
102
 if (!$CoverArt) {
123
   $DB->query("
103
   $DB->query("
326
         <li>
306
         <li>
327
           <a href="torrents.php?taglist=<?=$Tag['name']?>" style="float: left; display: block;" class="<?=display_str($Tag['class'])?>" ><?=display_str($Tag['display'])?></a>
307
           <a href="torrents.php?taglist=<?=$Tag['name']?>" style="float: left; display: block;" class="<?=display_str($Tag['class'])?>" ><?=display_str($Tag['display'])?></a>
328
           <div style="float: right; display: block; letter-spacing: -1px;" class="edit_tags_votes">
308
           <div style="float: right; display: block; letter-spacing: -1px;" class="edit_tags_votes">
329
-          <a href="torrents.php?action=vote_tag&amp;way=up&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" title="Vote this tag up" class="brackets tooltip vote_tag_up">&and;</a>
330
-          <?=$Tag['score']?>
331
-          <a href="torrents.php?action=vote_tag&amp;way=down&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" title="Vote this tag down" class="brackets tooltip vote_tag_down">&or;</a>
332
 <?    if (check_perms('users_warn')) { ?>
309
 <?    if (check_perms('users_warn')) { ?>
333
           <a href="user.php?id=<?=$Tag['userid']?>" title="View the profile of the user that added this tag" class="brackets tooltip view_tag_user">U</a>
310
           <a href="user.php?id=<?=$Tag['userid']?>" title="View the profile of the user that added this tag" class="brackets tooltip view_tag_user">U</a>
334
 <?    } ?>
311
 <?    } ?>
336
           <span class="remove remove_tag"><a href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets tooltip" title="Remove tag">X</a></span>
313
           <span class="remove remove_tag"><a href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets tooltip" title="Remove tag">X</a></span>
337
 <?    } ?>
314
 <?    } ?>
338
           </div>
315
           </div>
339
-          <br style="clear: both;" />
316
+          <br>
340
         </li>
317
         </li>
341
 <?
318
 <?
342
   }
319
   }

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

34
         g.Time,
34
         g.Time,
35
         GROUP_CONCAT(DISTINCT tags.Name SEPARATOR '|'),
35
         GROUP_CONCAT(DISTINCT tags.Name SEPARATOR '|'),
36
         GROUP_CONCAT(DISTINCT tags.ID SEPARATOR '|'),
36
         GROUP_CONCAT(DISTINCT tags.ID SEPARATOR '|'),
37
-        GROUP_CONCAT(tt.UserID SEPARATOR '|'),
38
-        GROUP_CONCAT(tt.PositiveVotes SEPARATOR '|'),
39
-        GROUP_CONCAT(tt.NegativeVotes SEPARATOR '|')
37
+        GROUP_CONCAT(tt.UserID SEPARATOR '|')
40
       FROM torrents_group AS g
38
       FROM torrents_group AS g
41
         LEFT JOIN torrents_tags AS tt ON tt.GroupID = g.ID
39
         LEFT JOIN torrents_tags AS tt ON tt.GroupID = g.ID
42
         LEFT JOIN tags ON tags.ID = tt.TagID";
40
         LEFT JOIN tags ON tags.ID = tt.TagID";

+ 0
- 6
sections/torrents/index.php View File

139
       include(SERVER_ROOT.'/sections/torrents/takemasspm.php');
139
       include(SERVER_ROOT.'/sections/torrents/takemasspm.php');
140
       break;
140
       break;
141
 
141
 
142
-    case 'vote_tag':
143
-      enforce_login();
144
-      authorize();
145
-      include(SERVER_ROOT.'/sections/torrents/vote_tag.php');
146
-      break;
147
-
148
     case 'add_tag':
142
     case 'add_tag':
149
       enforce_login();
143
       enforce_login();
150
       include(SERVER_ROOT.'/sections/torrents/add_tag.php');
144
       include(SERVER_ROOT.'/sections/torrents/add_tag.php');

+ 0
- 40
sections/torrents/vote_tag.php View File

1
-<?
2
-$UserID = $LoggedUser['ID'];
3
-$TagID = db_string($_GET['tagid']);
4
-$GroupID = db_string($_GET['groupid']);
5
-$Way = db_string($_GET['way']);
6
-
7
-if (!is_number($TagID) || !is_number($GroupID)) {
8
-  error(404);
9
-}
10
-if (!in_array($Way, array('up', 'down'))) {
11
-  error(404);
12
-}
13
-
14
-$DB->query("
15
-  SELECT TagID
16
-  FROM torrents_tags_votes
17
-  WHERE TagID = '$TagID'
18
-    AND GroupID = '$GroupID'
19
-    AND UserID = '$UserID'
20
-    AND Way = '$Way'");
21
-if (!$DB->has_results()) {
22
-  if ($Way == 'down') {
23
-    $Change = 'NegativeVotes = NegativeVotes + 1';
24
-  } else {
25
-    $Change = 'PositiveVotes = PositiveVotes + 2';
26
-  }
27
-  $DB->query("
28
-    UPDATE torrents_tags
29
-    SET $Change
30
-    WHERE TagID = '$TagID'
31
-      AND GroupID = '$GroupID'");
32
-  $DB->query("
33
-    INSERT INTO torrents_tags_votes
34
-      (GroupID, TagID, UserID, Way)
35
-    VALUES
36
-      ('$GroupID', '$TagID', '$UserID', '$Way')");
37
-  $Cache->delete_value("torrents_details_$GroupID"); // Delete torrent group cache
38
-}
39
-header('Location: '.$_SERVER['HTTP_REFERER']);
40
-?>

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

529
 
529
 
530
       $DB->query("
530
       $DB->query("
531
         INSERT INTO torrents_tags
531
         INSERT INTO torrents_tags
532
-          (TagID, GroupID, UserID, PositiveVotes)
532
+          (TagID, GroupID, UserID)
533
         VALUES
533
         VALUES
534
-          ($TagID, $GroupID, $LoggedUser[ID], 10)
535
-        ON DUPLICATE KEY UPDATE
536
-          PositiveVotes = PositiveVotes + 1;
534
+          ($TagID, $GroupID, $LoggedUser[ID])
535
+        ON DUPLICATE KEY UPDATE TagID=TagID
537
       ");
536
       ");
538
     }
537
     }
539
   }
538
   }
718
 $Debug->set_flag('upload: announced on irc');
717
 $Debug->set_flag('upload: announced on irc');
719
 
718
 
720
 // Manage notifications
719
 // Manage notifications
721
-/*
722
-$UsedFormatBitrates = [];
723
-
724
-if (!$IsNewGroup) {
725
-  // maybe there are torrents in the same release as the new torrent. Let's find out (for notifications)
726
-  $GroupInfo = get_group_info($GroupID, true, 0, false);
727
-
728
-  $ThisMedia = display_str($Properties['Media']);
729
-
730
-  $ThisRemastered = display_str($Properties['Remastered']);
731
-  $ThisRemasterYear = display_str($Properties['RemasterYear']);
732
-  $ThisRemasterTitle = display_str($Properties['RemasterTitle']);
733
-  $ThisRemasterRecordLabel = display_str($Properties['RemasterRecordLabel']);
734
-  $ThisRemasterCatalogueNumber = display_str($Properties['RemasterCatalogueNumber']);
735
-
736
-  foreach ($GroupInfo[1] as $TorrentInfo) {
737
-    if (($TorrentInfo['Media'] == $ThisMedia)
738
-      && ($TorrentInfo['Remastered'] == $ThisRemastered)
739
-      && ($TorrentInfo['RemasterYear'] == (int)$ThisRemasterYear)
740
-      && ($TorrentInfo['RemasterTitle'] == $ThisRemasterTitle)
741
-      && ($TorrentInfo['RemasterRecordLabel'] == $ThisRemasterRecordLabel)
742
-      && ($TorrentInfo['RemasterCatalogueNumber'] == $ThisRemasterCatalogueNumber)
743
-      && ($TorrentInfo['ID'] != $TorrentID)) {
744
-      $UsedFormatBitrates[] = array('format' => $TorrentInfo['Format'], 'bitrate' => $TorrentInfo['Encoding']);
745
-    }
746
-  }
747
-}
748
-*/
720
+
749
 // For RSS
721
 // For RSS
750
 $Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID, $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($Properties['TagList']));
722
 $Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID, $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($Properties['TagList']));
751
 
723
 

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

695
   margin-bottom: 10px;
695
   margin-bottom: 10px;
696
 }
696
 }
697
 
697
 
698
-.vote_tag_up, .vote_artist_up, .vote_album_up {
699
-  font-weight: bolder;
700
-}
701
-
702
-.vote_tag_down, .vote_artist_down, .vote_album_down {
703
-  font-weight: bolder;
704
-}
705
-
706
 .noborder {
698
 .noborder {
707
   border: none;
699
   border: none;
708
 }
700
 }

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

918
   font-weight: normal;
918
   font-weight: normal;
919
 }
919
 }
920
 
920
 
921
-.vote_tag_up, .vote_artist_up, .vote_album_up, .small_upvote, .small_upvoted {
922
-  color: green;
923
-}
924
-
925
-.vote_tag_down, .vote_artist_down, .vote_album_down, .small_downvote, .small_downvoted {
926
-  color: red;
927
-}
928
-
929
 /* workaround for calendar display issue */
921
 /* workaround for calendar display issue */
930
 div.sidebar #event_div {
922
 div.sidebar #event_div {
931
   margin-left: -232px;
923
   margin-left: -232px;

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

975
   font-weight: normal;
975
   font-weight: normal;
976
 }
976
 }
977
 
977
 
978
-.vote_tag_up, .vote_artist_up, .vote_album_up, .small_upvote, .small_upvoted {
979
-  color: green;
980
-}
981
-
982
-.vote_tag_down, .vote_artist_down, .vote_album_down, .small_downvote, .small_downvoted {
983
-  color: red;
984
-}
985
-
986
 /* get rid of extraneous padding in the Top Contributors box */
978
 /* get rid of extraneous padding in the Top Contributors box */
987
 #request_top_contrib {
979
 #request_top_contrib {
988
   border: none;
980
   border: none;

Loading…
Cancel
Save