Skip to content

Commit

Permalink
[index] use server-side search query so that the server can know when…
Browse files Browse the repository at this point in the history
… to hide prev/next, fixes #1036
  • Loading branch information
shish committed Oct 14, 2024
1 parent 2b96b58 commit 26991cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/index/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected function display_page_images(Page $page, array $images): void
$page->add_html_header(META(["name" => "robots", "content" => "noindex, nofollow"]));
}
$query = url_escape(Tag::implode($this->search_terms));
$page->add_block(new Block(null, $this->build_table($images, "#search=$query"), "main", 10, "image-list"));
$page->add_block(new Block(null, $this->build_table($images, "?search=$query"), "main", 10, "image-list"));
$this->display_paginator($page, "post/list/$query", null, $this->page_number, $this->total_pages, true);
} else {
$page->add_block(new Block(null, $this->build_table($images, null), "main", 10, "image-list"));
Expand Down
2 changes: 1 addition & 1 deletion themes/danbooru/index.theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function display_page(Page $page, array $images): void
$page->add_block(new Block("Search", $nav, "left", 0));
if (count($images) > 0) {
if ($query) {
$page->add_block(new Block(null, $this->build_table($images, "#search=$query"), "main", 10));
$page->add_block(new Block(null, $this->build_table($images, "?search=$query"), "main", 10));
$this->display_paginator($page, "post/list/$query", null, $this->page_number, $this->total_pages);
} else {
$page->add_block(new Block(null, $this->build_table($images, null), "main", 10));
Expand Down

0 comments on commit 26991cc

Please sign in to comment.