summaryrefslogtreecommitdiff
path: root/emotes/index.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-10 21:10:04 +0500
committerilotterytea <iltsu@alright.party>2025-12-10 21:10:04 +0500
commit0ffb5175771345f5216402d854f4f240528716f5 (patch)
treecb49a1a92d8045ea14f8fb84051a38f923a8b439 /emotes/index.php
parentf32b2094b304fa7832a8931b08a5bbb9cd1076eb (diff)
fix: sort option in search box
Diffstat (limited to 'emotes/index.php')
-rw-r--r--emotes/index.php6
1 files changed, 3 insertions, 3 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"
);
}
}