Browse Source

underline active category, disable icon for torrent/tor if the host disabled it, removed a dead instance

hnhx 2 years ago
parent
commit
5f7d81a7d6
5 changed files with 20 additions and 13 deletions
  1. 0 1
      README.md
  2. 0 6
      instances.json
  3. 1 1
      misc/footer.php
  4. 14 5
      search.php
  5. 5 0
      static/css/styles.css

+ 0 - 1
README.md

@@ -28,7 +28,6 @@
 | [librex.pufe.org](https://librex.pufe.org/) | ❌ | ❌ | :new_zealand: NZ |
 | [librex.ratakor.com](https://librex.ratakor.com/) | ❌ | ❌ | 🇫🇷 FR |
 | [search.tildevarsh.in](https://search.tildevarsh.in/) | ❌ | ❌ | 🇮🇳  IN |
-| [librex.yogeshlamichhane.com.np](https://librex.yogeshlamichhane.com.np/) | ❌ | ❌ | 🇬🇧 GB |
 | [librex.myroware.eu](https://librex.myroware.eu/) | ❌ | ❌ | 🇩🇪 DE |
 <br>
 

+ 0 - 6
instances.json

@@ -90,12 +90,6 @@
               "i2p": null,
               "country": "IN"
           },
-          {
-              "clearnet": "https://librex.yogeshlamichhane.com.np/",
-              "tor": null,
-              "i2p": null,
-              "country": "GB"
-          },
           {
               "clearnet": "https://librex.myroware.eu",
               "tor": null,

+ 1 - 1
misc/footer.php

@@ -1,6 +1,6 @@
 <div class="footer-container">
     <a href="./">LibreX</a>
-    <a href="https://github.com/hnhx/librex/" target="_blank">Source &amp; Instance list</a>
+    <a href="https://github.com/hnhx/librex/" target="_blank">Source &amp; Instances</a>
     <a href="./settings.php">Settings</a>
     <a href="./api.php" target="_blank">API</a>
     <a href="./donate.php">Donate ❤️</a>

+ 14 - 5
search.php

@@ -1,4 +1,9 @@
-<?php require "misc/header.php"; ?>
+<?php 
+    require "misc/header.php";
+
+    $config = require "config.php";
+    require "misc/tools.php";
+?>
 
 <title>
 <?php
@@ -44,7 +49,14 @@
                     foreach ($categories as $category)
                     {
                         $category_index = array_search($category, $categories);
-                        echo "<a href=\"/search.php?q=" . $query . "&p=0&t=" . $category_index . "\"><img src=\"static/images/" . $category . "_result.png\" alt=\"" . $category . " result\" />" . ucfirst($category)  . "</a>";
+
+                        if (($config->disable_bittorent_search && $category_index == 3) ||
+                            ($config->disable_hidden_service_search && $category_index ==4))
+                        {
+                            continue;
+                        }
+
+                        echo "<a " . (($category_index == $type) ? "class=\"active\"" : "") . "href=\"/search.php?q=" . $query . "&p=0&t=" . $category_index . "\"><img src=\"static/images/" . $category . "_result.png\" alt=\"" . $category . " result\" />" . ucfirst($category)  . "</a>";
                     }
                 ?>
             </div>
@@ -52,9 +64,6 @@
         </form>
 
         <?php
-            $config = require "config.php";
-            require "misc/tools.php";
-
 
             $page = isset($_REQUEST["p"]) ? (int) $_REQUEST["p"] : 0;
 

+ 5 - 0
static/css/styles.css

@@ -35,6 +35,11 @@ a,
     color: #bd93f9;
 }
 
+.sub-search-button-wrapper .active {
+    border-bottom: 2px #bd93f9 solid;
+    padding-bottom: 6px;
+}
+
 a:hover,
 .text-result-wrapper h2:hover {
     text-decoration: underline;