summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emotes/index.php6
-rw-r--r--lib/partials.php12
2 files changed, 9 insertions, 9 deletions
diff --git a/emotes/index.php b/emotes/index.php
index b3c9c26..2310e03 100644
--- a/emotes/index.php
+++ b/emotes/index.php
@@ -55,8 +55,8 @@ if (isset($_GET["id"])) {
}
// fetching all emotes
else {
- $sort = $_GET["sort"] ?? "high_ratings";
- $sort = match ($sort) {
+ $sort_by = $_GET["s"] ?? "high_ratings";
+ $sort = match ($sort_by) {
"low_ratings" => "rating ASC",
"recent" => "e.created_at DESC",
"oldest" => "e.created_at ASC",
@@ -528,7 +528,7 @@ if (CLIENT_REQUIRES_JSON) {
html_pagination(
$total_pages,
$page,
- "/emotes?q=" . substr($search, 1, strlen($search) - 2) . "&sort_by=$sort_by"
+ "/emotes?q=" . substr($search, 1, strlen($search) - 2) . "&s=$sort_by"
);
}
}
diff --git a/lib/partials.php b/lib/partials.php
index 12aa23d..6d5a918 100644
--- a/lib/partials.php
+++ b/lib/partials.php
@@ -139,15 +139,15 @@ function html_navigation_search()
<?php
if (str_starts_with($_SERVER["REQUEST_URI"], "/emotes")) {
?>
- <label for="sort_by">Sort by</label>
- <select name="sort_by">
- <option value="high_ratings" <?= ($_GET["sort_by"] ?? "") == "high_ratings" ? "selected" : "" ?>>
+ <label for="s">Sort by</label>
+ <select name="s">
+ <option value="high_ratings" <?= ($_GET["s"] ?? "") == "high_ratings" ? "selected" : "" ?>>
High ratings</option>
- <option value="low_ratings" <?= ($_GET["sort_by"] ?? "") == "low_ratings" ? "selected" : "" ?>>Low
+ <option value="low_ratings" <?= ($_GET["s"] ?? "") == "low_ratings" ? "selected" : "" ?>>Low
ratings</option>
- <option value="recent" <?= ($_GET["sort_by"] ?? "") == "recent" ? "selected" : "" ?>>Recent
+ <option value="recent" <?= ($_GET["s"] ?? "") == "recent" ? "selected" : "" ?>>Recent
</option>
- <option value="oldest" <?= ($_GET["sort_by"] ?? "") == "oldest" ? "selected" : "" ?>>Oldest
+ <option value="oldest" <?= ($_GET["s"] ?? "") == "oldest" ? "selected" : "" ?>>Oldest
</option>
</select>
<?php