Browse Source

Add a couple working better.php pages

spaghetti 8 years ago
parent
commit
0cf9b483a0
4 changed files with 162 additions and 106 deletions
  1. 16
    7
      sections/better/better.php
  2. 72
    0
      sections/better/covers.php
  3. 0
    99
      sections/better/files.php
  4. 74
    0
      sections/better/screenshots.php

+ 16
- 7
sections/better/better.php View File

@@ -5,7 +5,7 @@ View::show_header('Better');
5 5
 <div class="thin">
6 6
   <h3 id="general">Pursuit of Perfection</h3>
7 7
   <div class="box pad" style="padding: 10px 10px 10px 20px;">
8
-    <p>Here at <?=SITE_NAME?>, we believe that there's always room for improvement. To aid our effort in the pursuit of perfection, we've put together a few simple lists that can help you build ratio and help us improve our overall quality. Most lists feature 100 torrents at a time and update every 15 minutes.</p>
8
+    <p>Here at <?=SITE_NAME?>, we believe that there's always room for improvement. To aid our effort in the pursuit of perfection, we've put together a few simple lists that can help you build ratio or something and help us improve our overall quality. Most lists feature 20 random torrents selected upon page load.</p>
9 9
   </div>
10 10
   <h3 id="lists">Lists</h3>
11 11
   <div class="box pad" style="padding: 10px 10px 10px 20px;">
@@ -19,12 +19,21 @@ View::show_header('Better');
19 19
           <a href="better.php?method=screenshots">Screenshots</a>
20 20
         </td>
21 21
         <td class="nobr">
22
-          When a torrent doesn't have enough screenshots
22
+          When a torrent group doesn't have enough screenshots
23 23
         </td>
24 24
       </tr>
25 25
       <tr class="row">
26 26
         <td class="nobr">
27
-          <a href="better.php?method=encode">Encode</a>
27
+          <a href="better.php?method=covers&filter=all">Covers</a>
28
+        </td>
29
+        <td class="nobr">
30
+          When a torrent group doesn't have a cover
31
+        </td>
32
+      </tr>
33
+<!--
34
+      <tr class="row">
35
+        <td class="nobr">
36
+          <s><a href="better.php?method=encode">Encode</a></s>
28 37
         </td>
29 38
         <td class="nobr">
30 39
           When a high quality BD or ISO is available and we don't have any encodes of it
@@ -32,7 +41,7 @@ View::show_header('Better');
32 41
       </tr>
33 42
       <tr class="row">
34 43
         <td class="nobr">
35
-          <a href="better.php?method=snatch">Snatch</a>
44
+          <s><a href="better.php?method=snatch">Snatch</a></s>
36 45
         </td>
37 46
         <td class="nobr">
38 47
           Torrents you've already downloaded that can be encoded.
@@ -40,7 +49,7 @@ View::show_header('Better');
40 49
       </tr>
41 50
       <tr class="row">
42 51
         <td class="nobr">
43
-          <a href="better.php?method=upload">Upload</a>
52
+          <s><a href="better.php?method=upload">Upload</a></s>
44 53
         </td>
45 54
         <td class="nobr">
46 55
           Torrents you've uploaded that could be improved.
@@ -64,13 +73,13 @@ View::show_header('Better');
64 73
       </tr>
65 74
       <tr class="row">
66 75
         <td class="nobr">
67
-          <a href="better.php?method=files">File names</a>
76
+          <s><a href="better.php?method=files">File names</a></s>
68 77
         </td>
69 78
         <td class="nobr">
70 79
           Torrents that have been marked as having "Bad File Names".
71 80
         </td>
72 81
       </tr>
73
-
82
+-->
74 83
     </table>
75 84
   </div>
76 85
 </div>

+ 72
- 0
sections/better/covers.php View File

@@ -0,0 +1,72 @@
1
+<?
2
+if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
3
+  $Join = '';
4
+  $All = true;
5
+} else {
6
+  $Join = 'JOIN torrents AS t ON t.GroupID=tg.ID
7
+           JOIN xbt_snatched AS x ON x.fid = t.ID AND x.uid = '.$LoggedUser['ID'];
8
+  $All = false;
9
+}
10
+
11
+View::show_header('Torrent groups with no covers');
12
+$DB->query("
13
+  SELECT
14
+    SQL_CALC_FOUND_ROWS
15
+    tg.ID
16
+  FROM torrents_group AS tg
17
+    $Join
18
+  WHERE tg.WikiImage=''
19
+  ORDER BY RAND()
20
+  LIMIT 20");
21
+$Groups = $DB->to_array('ID', MYSQLI_ASSOC);
22
+
23
+$DB->query('SELECT FOUND_ROWS()');
24
+list($NumResults) = $DB->next_record();
25
+
26
+$Results = Torrents::get_groups(array_keys($Groups));
27
+
28
+?>
29
+<div class="header">
30
+<? if ($All) { ?>
31
+  <h2>All torrent groups with no cover</h2>
32
+<? } else { ?>
33
+  <h2>Torrent groups with no cover that you have snatched</h2>
34
+<? } ?>
35
+
36
+  <div class="linkbox">
37
+    <a href="better.php" class="brackets">Back to better.php list</a>
38
+<? if ($All) { ?>
39
+    <a href="better.php?method=covers" class="brackets">Show only those you have snatched</a>
40
+<? } else { ?>
41
+    <a href="better.php?method=covers&amp;filter=all" class="brackets">Show all</a>
42
+<? } ?>
43
+  </div>
44
+</div>
45
+<div class="thin box pad">
46
+  <h3>There are <?=number_format($NumResults)?> groups remaining</h3>
47
+  <table class="torrent_table">
48
+<?
49
+foreach ($Results as $Result) {
50
+  extract($Result);
51
+  $TorrentTags = new Tags($TagList);
52
+
53
+  $DisplayName = "<a href=\"torrents.php?id=$ID\" class=\"tooltip\" title=\"View torrent group\" ";
54
+  if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
55
+    $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover(event)" ';
56
+  }
57
+  $DisplayName .= "dir=\"ltr\">$Name</a>";
58
+  if ($Year > 0) {
59
+    $DisplayName .= " [$Year]";
60
+  }
61
+?>
62
+    <tr class="torrent">
63
+      <td><div class="<?=Format::css_category($CategoryID)?>"></div></td>
64
+      <td><?=$DisplayName?><div class="tags"><?=$TorrentTags->format()?></div></td>
65
+    </tr>
66
+<?
67
+} ?>
68
+  </table>
69
+</div>
70
+<?
71
+View::show_footer();
72
+?>

+ 0
- 99
sections/better/files.php View File

@@ -1,99 +0,0 @@
1
-<?php
2
-
3
-if (check_perms('admin_reports') && !empty($_GET['remove']) && is_number($_GET['remove'])) {
4
-  $DB->query('
5
-    DELETE FROM torrents_bad_files
6
-    WHERE TorrentID = '.$_GET['remove']);
7
-  $DB->query('
8
-    SELECT GroupID
9
-    FROM torrents
10
-    WHERE ID = '.$_GET['remove']);
11
-  list($GroupID) = $DB->next_record();
12
-  $Cache->delete_value("torrents_details_$GroupID");
13
-}
14
-
15
-
16
-if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
17
-  $Join = '';
18
-  $All = true;
19
-} else {
20
-  $Join = 'JOIN xbt_snatched AS x ON x.fid = tfi.TorrentID AND x.uid = '.$LoggedUser['ID'];
21
-  $All = false;
22
-}
23
-
24
-View::show_header('Torrents with bad file names');
25
-$DB->query("
26
-  SELECT tfi.TorrentID, t.GroupID
27
-  FROM torrents_bad_files AS tfi
28
-    JOIN torrents AS t ON t.ID = tfi.TorrentID
29
-    $Join
30
-  ORDER BY tfi.TimeAdded ASC");
31
-$TorrentsInfo = $DB->to_array('TorrentID', MYSQLI_ASSOC);
32
-foreach ($TorrentsInfo as $Torrent) {
33
-  $GroupIDs[] = $Torrent['GroupID'];
34
-}
35
-$Results = Torrents::get_groups($GroupIDs);
36
-?>
37
-<div class="header">
38
-<? if ($All) { ?>
39
-  <h2>All torrents trumpable for bad file names</h2>
40
-<? } else { ?>
41
-  <h2>Torrents trumpable for bad file names that you have snatched</h2>
42
-<? } ?>
43
-
44
-  <div class="linkbox">
45
-    <a href="better.php" class="brackets">Back to better.php list</a>
46
-<? if ($All) { ?>
47
-    <a href="better.php?method=files" class="brackets">Show only those you have snatched</a>
48
-<? } else { ?>
49
-    <a href="better.php?method=files&amp;filter=all" class="brackets">Show all</a>
50
-<? } ?>
51
-  </div>
52
-</div>
53
-<div class="thin box pad">
54
-  <h3>There are <?=number_format(count($TorrentsInfo))?> torrents remaining</h3>
55
-  <table class="torrent_table">
56
-<?
57
-foreach ($TorrentsInfo as $TorrentID => $Info) {
58
-  extract(Torrents::array_group($Results[$Info['GroupID']]));
59
-  $TorrentTags = new Tags($TagList);
60
-
61
-  if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
62
-    unset($ExtendedArtists[2]);
63
-    unset($ExtendedArtists[3]);
64
-    $DisplayName = Artists::display_artists($ExtendedArtists);
65
-  } else {
66
-    $DisplayName = '';
67
-  }
68
-  $DisplayName .= "<a href=\"torrents.php?id=$GroupID&amp;torrentid=$TorrentID#torrent$TorrentID\" class=\"tooltip\" title=\"View torrent group\" dir=\"ltr\">$GroupName</a>";
69
-  if ($GroupYear > 0) {
70
-    $DisplayName .= " [$GroupYear]";
71
-  }
72
-  if ($ReleaseType > 0) {
73
-    $DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
74
-  }
75
-
76
-  $ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
77
-  if ($ExtraInfo) {
78
-    $DisplayName .= " - $ExtraInfo";
79
-  }
80
-?>
81
-    <tr class="torrent torrent_row<?=$GroupFlags['IsSnatched'] ? ' snatched_torrent"' : ''?>">
82
-      <td>
83
-        <span class="torrent_links_block">
84
-          <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="brackets tooltip" title="Download">DL</a>
85
-        </span>
86
-        <?=$DisplayName?>
87
-<?  if (check_perms('admin_reports')) { ?>
88
-        <a href="better.php?method=files&amp;remove=<?=$TorrentID?>" class="brackets">X</a>
89
-<?   } ?>
90
-        <div class="tags"><?=$TorrentTags->format()?></div>
91
-      </td>
92
-    </tr>
93
-<?
94
-} ?>
95
-  </table>
96
-</div>
97
-<?
98
-View::show_footer();
99
-?>

+ 74
- 0
sections/better/screenshots.php View File

@@ -0,0 +1,74 @@
1
+<?
2
+if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
3
+  $Join = '';
4
+  $All = true;
5
+} else {
6
+  $Join = 'JOIN torrents AS t ON t.GroupID=tg.ID
7
+           JOIN xbt_snatched AS x ON x.fid = t.ID AND x.uid = '.$LoggedUser['ID'];
8
+  $All = false;
9
+}
10
+
11
+View::show_header('Torrent groups with no screenshots');
12
+$DB->query("
13
+  SELECT
14
+    SQL_CALC_FOUND_ROWS
15
+    tg.ID
16
+  FROM torrents_group AS tg
17
+    $Join
18
+  WHERE tg.ID NOT IN (SELECT DISTINCT GroupID FROM torrents_screenshots)
19
+    AND NOT (tg.CategoryID = 5 AND tg.TagList LIKE \"%audio%\")
20
+  ORDER BY RAND()
21
+  LIMIT 20"); // TagList clause quintuples query time. Probably needs to be removed in future
22
+$Groups = $DB->to_array('ID', MYSQLI_ASSOC);
23
+
24
+$DB->query('SELECT FOUND_ROWS()');
25
+list($NumResults) = $DB->next_record();
26
+
27
+$Results = Torrents::get_groups(array_keys($Groups));
28
+
29
+?>
30
+<div class="header">
31
+<? if ($All) { ?>
32
+  <h2>All groups with no screenshots</h2>
33
+<? } else { ?>
34
+  <h2>Torrent groups with no screenshots that you have snatched</h2>
35
+<? } ?>
36
+
37
+  <div class="linkbox">
38
+    <a href="better.php" class="brackets">Back to better.php list</a>
39
+<? if ($All) { ?>
40
+    <a href="better.php?method=screenshots" class="brackets">Show only those you have snatched</a>
41
+<? } else { ?>
42
+    <a href="better.php?method=screenshots&amp;filter=all" class="brackets">Show all</a>
43
+<? } ?>
44
+  </div>
45
+</div>
46
+<div class="thin box pad">
47
+  <h3>There are <?=number_format($NumResults)?> groups remaining</h3>
48
+  <table class="torrent_table">
49
+<?
50
+foreach ($Results as $Result) {
51
+  extract($Result);
52
+  $LangName = $Name ? $Name : ($NameRJ ? $NameRJ : $NameJP);
53
+  $TorrentTags = new Tags($TagList);
54
+
55
+  $DisplayName = "<a href=\"torrents.php?id=$ID\" class=\"tooltip\" title=\"View torrent group\" ";
56
+  if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
57
+    $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover(event)" ';
58
+  }
59
+  $DisplayName .= "dir=\"ltr\">$LangName</a>";
60
+  if ($Year > 0) {
61
+    $DisplayName .= " [$Year]";
62
+  }
63
+?>
64
+    <tr class="torrent">
65
+      <td><div class="<?=Format::css_category($CategoryID)?>"></div></td>
66
+      <td><?=$DisplayName?><div class="tags"><?=$TorrentTags->format()?></div></td>
67
+    </tr>
68
+<?
69
+} ?>
70
+  </table>
71
+</div>
72
+<?
73
+View::show_footer();
74
+?>

Loading…
Cancel
Save