ViewPhotoAlbum: use Tag::getUrl instead of fumbling with $_GET['tag']

This commit is contained in:
Aaron van Geffen 2024-01-14 20:38:37 +01:00
parent 25b9528628
commit 7cdcf8197c

View File

@ -74,7 +74,7 @@ class ViewPhotoAlbum extends HTMLController
'recordCount' => $total_count,
'items_per_page' => self::PER_PAGE,
'start' => (isset($_GET['page']) ? $_GET['page'] - 1 : 0) * self::PER_PAGE,
'base_url' => BASEURL . '/' . (isset($_GET['tag']) ? $_GET['tag'] . '/' : ''),
'base_url' => $tag->getUrl(),
'page_slug' => 'page/%PAGE%/',
'index_class' => 'pagination-lg justify-content-around justify-content-lg-center',
]);
@ -82,8 +82,7 @@ class ViewPhotoAlbum extends HTMLController
}
// Set the canonical url.
$this->page->setCanonicalUrl(BASEURL . '/' . (isset($_GET['tag']) ? $_GET['tag'] . '/' : '') .
($page > 1 ? 'page/' . $page . '/' : ''));
$this->page->setCanonicalUrl($tag->getUrl() . ($page > 1 ? 'page/' . $page . '/' : ''));
}
public function getPhotoMosaic($id_tag, $page, $sort_linear)