add emoji list page

This commit is contained in:
trinkey 2025-03-17 16:17:08 -04:00
parent cbfef9920b
commit b8c0824bda
2 changed files with 38 additions and 1 deletions

View file

@ -31,7 +31,7 @@ function insertEmoji($text) {
$url = pg_fetch_array($queryResponse);
if (pg_num_rows($queryResponse) !== 0) {
$out .= "<img class=\"emoji\" src=\"{$url['url']}\" alt=\"${segment}\">";
$out .= "<img class=\"emoji\" src=\"{$url['url']}\" alt=\":${segment}:\">";
$allowNext = false;
continue;
}

37
emoji.php Normal file
View file

@ -0,0 +1,37 @@
<?php
include "config.php";
$query = "
SELECT * FROM emoji
ORDER BY name;
";
$queryResponse = pg_query($db, $query);
$emoji = pg_fetch_all($queryResponse);
$properTitle = "{$pageTitle} &mdash; emoji list";
include "boilerplate/pageStart.php";
echo("<a href=\"index.php\">(go back?)</a>");
if (!$emojiEnabled) {
echo("emoji aren't enabled");
include "boilerplate/pageEnd.php";
exit();
}
echo("<ul>");
foreach ($emoji as $e) {
echo("<li>
<img class=\"emoji\" src=\"{$e['url']}\" alt=\":{$e['name']}:\">
:{$e['name']}:
</li>");
}
echo("</ul>");
include "boilerplate/pageEnd.php";
?>