Browse Source

Replace format with category in top 10

spaghetti 7 years ago
parent
commit
877a29a42b
1 changed files with 9 additions and 8 deletions
  1. 9
    8
      sections/top10/torrents.php

+ 9
- 8
sections/top10/torrents.php View File

@@ -23,9 +23,9 @@ if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
23 23
     }
24 24
   }
25 25
 
26
-  if ($_GET['format']) {
27
-    if (in_array($_GET['format'], $Formats)) {
28
-      $Where[] = "t.Format='".db_string($_GET['format'])."'";
26
+  if ($_GET['category']) {
27
+    if (in_array($_GET['category'], $Categories)) {
28
+      $Where[] = "g.CategoryID = '".(array_search($_GET['category'], $Categories)+1)."'";
29 29
     }
30 30
   }
31 31
 
@@ -70,13 +70,14 @@ if (check_perms('site_advanced_top10')) {
70 70
         </td>
71 71
       </tr>
72 72
       <tr>
73
-        <td class="label">Format:</td>
73
+        <td class="label">Category:</td>
74 74
         <td>
75
-          <select name="format" style="width: auto;" class="ft_format">
75
+          <select name="category" style="width: auto;" class="ft_format">
76 76
             <option value="">Any</option>
77
-<?  foreach ($Formats as $FormatName) { ?>
78
-            <option value="<?=display_str($FormatName)?>"<? if (isset($_GET['format']) && $FormatName==$_GET['format']) { ?> selected="selected"<? } ?>><?=display_str($FormatName)?></option>
79
-<?  } ?>        </select>
77
+<?  foreach ($Categories as $CategoryName) { ?>
78
+            <option value="<?=display_str($CategoryName)?>"<?=(($CategoryName==($_GET['category']??false))?'selected="selected"':'')?>><?=display_str($CategoryName)?></option>
79
+<?  } ?>
80
+          </select>
80 81
         </td>
81 82
       </tr>
82 83
       <tr>

Loading…
Cancel
Save