Browse Source

Quick search form fixes, yuck: />" <?php

pjc 5 years ago
parent
commit
c149cf7804
2 changed files with 9 additions and 25 deletions
  1. 6
    22
      classes/validate.class.php
  2. 3
    3
      sections/torrents/browse.php

+ 6
- 22
classes/validate.class.php View File

@@ -193,36 +193,20 @@ class Validate
193 193
         $UnNested = array_values($FileList[1]);
194 194
         $Sorted = (usort($UnNested, function ($a, $b) {
195 195
             return $b <=> $a; # Workaround because ↑ returns true
196
-        }) === true) ? array_values($UnNested) : null;
196
+        }) === true) ? $UnNested : null;
197 197
         
198 198
         # Harvest the wheat
199 199
         $TopTen = array_slice($Sorted, 0, 10);
200
-        $Result = [];
200
+        $Match = null;
201 201
 
202
-        foreach ($TopTen as $TopTen) {
203
-            # How many extensions to keep
202
+        do {
204 203
             $Extensions = array_slice(explode('.', strtolower($TopTen[1])), -2, 2);
205
-    
206
-            print_r('<pre>');
207
-            var_dump($FileTypes);
208
-            print_r('</pre>');
209
-
210
-            $Result = array_filter($Extensions, function ($a) {
211
-                foreach ($FileTypes as $FileType) {
212
-                    in_array($a, $FileType);
213
-                }
214
-            });
215
-
216
-            /*
217
-            foreach ($FileTypes as $k => $FileType) {
218
-                var_dump(array_intersect($Extensions, $FileTypes));
219
-            }
220
-            */
221
-        }
204
+            #array_shift(something)
205
+        } while ($i > 0);
222 206
 
223 207
         print_r('<pre>');
224 208
         print_r('===== RESULTS =====');
225
-        print_r($Result);
209
+        print_r($Matches);
226 210
         print_r('</pre>');
227 211
 
228 212
         # To be continued

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

@@ -250,7 +250,7 @@ View::show_header('Browse Torrents', 'browse');
250 250
               <select name="media" class="ft_media fti_advanced">
251 251
                 <option value="">Seq Platform</option>
252 252
                 <?php  foreach ($Media as $MediaName) { ?>
253
-                <option value="<?=display_str($MediaName); ?>
253
+                <option value="<?=display_str($MediaName); ?>"
254 254
                 <?Format::selected('media', $MediaName)?>><?=display_str($MediaName); ?>
255 255
                 </option>
256 256
                 <?php  } ?>
@@ -270,7 +270,7 @@ View::show_header('Browse Torrents', 'browse');
270 270
               <select name="media" class="ft_media fti_advanced">
271 271
                 <option value="">Img Platform</option>
272 272
                 <?php  foreach ($MediaManga as $MediaName) { ?>
273
-                <option value="<?=display_str($MediaName); ?>
273
+                <option value="<?=display_str($MediaName); ?>"
274 274
                 <?Format::selected('media', $MediaName)?>><?=display_str($MediaName); ?>
275 275
                 </option>
276 276
                 <?php  } ?>
@@ -316,7 +316,7 @@ View::show_header('Browse Torrents', 'browse');
316 316
               <select name="resolution" class="ft_resolution fti_advanced">
317 317
                 <option value="">Assembly Level</option>
318 318
                 <?php  foreach ($Resolutions as $Resolution) { ?>
319
-                <option value="<?=display_str($Resolution); ?>
319
+                <option value="<?=display_str($Resolution); ?>"
320 320
                 <?Format::selected('resolution', $Resolution)?>><?=display_str($Resolution); ?>
321 321
                 </option>
322 322
                 <?php  } ?>

Loading…
Cancel
Save