summaryrefslogtreecommitdiff
path: root/src/partials.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-22 15:26:20 +0500
committerilotterytea <iltsu@alright.party>2025-04-22 15:26:20 +0500
commit34189e06a88ce4409a2c9652ca26f072c461233e (patch)
tree429510fed4b9109fad36f0191ee706efef6918fa /src/partials.php
parent73fdfe1795b2c1be4914f13bf973c83beac5050b (diff)
feat: sort emotes by high/low rating, recent/oldest
Diffstat (limited to 'src/partials.php')
-rw-r--r--src/partials.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/partials.php b/src/partials.php
index d245708..71f4f63 100644
--- a/src/partials.php
+++ b/src/partials.php
@@ -37,6 +37,23 @@ function html_navigation_search()
<div class="box content">
<form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="GET">
<input type="text" name="q" style="padding:4px;" value="<?php echo $_GET["q"] ?? "" ?>"><br>
+ <?php
+ if (str_starts_with($_SERVER["REQUEST_URI"], "/emotes")) {
+ ?>
+ <label for="sort_by">Sort by</label>
+ <select name="sort_by">
+ <option value="high_ratings" <?php echo ($_GET["sort_by"] ?? "") == "high_ratings" ? "selected" : "" ?>>
+ High ratings</option>
+ <option value="low_ratings" <?php echo ($_GET["sort_by"] ?? "") == "low_ratings" ? "selected" : "" ?>>Low
+ ratings</option>
+ <option value="recent" <?php echo ($_GET["sort_by"] ?? "") == "recent" ? "selected" : "" ?>>Recent
+ </option>
+ <option value="oldest" <?php echo ($_GET["sort_by"] ?? "") == "oldest" ? "selected" : "" ?>>Oldest
+ </option>
+ </select>
+ <?php
+ }
+ ?>
<button type="submit" style="width:100%;margin-top:6px;">Find</button>
</form>
</div>