From d1ed1c4b64146e992c1e8da3eb8a8c26a4156338 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 5 Sep 2024 12:20:56 +0100 Subject: [PATCH] footer_html as HTMLElement --- core/basepage.php | 27 +++++++++++++-------------- core/util.php | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/core/basepage.php b/core/basepage.php index f7c3d012..f2718bf5 100644 --- a/core/basepage.php +++ b/core/basepage.php @@ -6,7 +6,7 @@ namespace Shimmie2; use MicroHTML\HTMLElement; -use function MicroHTML\{emptyHTML,rawHTML,HTML,HEAD,BODY,TITLE, LINK, SCRIPT, B}; +use function MicroHTML\{emptyHTML, rawHTML, HTML, HEAD, BODY, TITLE, LINK, SCRIPT, A, B, joinHTML, BR}; require_once "core/event.php"; @@ -650,22 +650,21 @@ class BasePage return emptyHTML(); } - protected function footer_html(): string + protected function footer_html(): HTMLElement { $debug = get_debug_info(); $contact_link = contact_link(); - $contact = empty($contact_link) ? "" : "
Contact"; - - return " - Media © their respective owners, - Shimmie © - Shish & - The Team - 2007-2024, - based on the Danbooru concept. - $debug - $contact - "; + return joinHTML("", [ + "Media © their respective owners, ", + A(["href" => "https://code.shishnet.org/shimmie2/"], "Shimmie"), + " © ", + A(["href" => "https://www.shishnet.org/"], "Shish"), + " & ", + A(["href" => "https://github.com/shish/shimmie2/graphs/contributors"], "The Team"), + " 2007-2024, based on the Danbooru concept.", + BR(), $debug, + $contact_link ? emptyHTML(BR(), A(["href" => $contact_link], "Contact")) : "" + ]); } } diff --git a/core/util.php b/core/util.php index 0cb56677..d8fcedd6 100644 --- a/core/util.php +++ b/core/util.php @@ -524,7 +524,7 @@ function get_debug_info(): string { $d = get_debug_info_arr(); - $debug = "
Took {$d['time']} seconds (db:{$d['dbtime']}) and {$d['mem_mb']}MB of RAM"; + $debug = "Took {$d['time']} seconds (db:{$d['dbtime']}) and {$d['mem_mb']}MB of RAM"; $debug .= "; Used {$d['files']} files and {$d['query_count']} queries"; $debug .= "; Sent {$d['event_count']} events"; $debug .= "; {$d['cache_hits']} cache hits and {$d['cache_misses']} misses";