footer_html as HTMLElement

This commit is contained in:
Shish 2024-09-05 12:20:56 +01:00 committed by Shish
parent 4076051456
commit d1ed1c4b64
2 changed files with 14 additions and 15 deletions

View file

@ -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) ? "" : "<br><a href='$contact_link'>Contact</a>";
return "
Media &copy; their respective owners,
<a href=\"https://code.shishnet.org/shimmie2/\">Shimmie</a> &copy;
<a href=\"https://www.shishnet.org/\">Shish</a> &amp;
<a href=\"https://github.com/shish/shimmie2/graphs/contributors\">The Team</a>
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")) : ""
]);
}
}

View file

@ -524,7 +524,7 @@ function get_debug_info(): string
{
$d = get_debug_info_arr();
$debug = "<br>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";