diff --git a/admin/all.php b/admin/all.php
index e0ed36e..aef34e6 100644
--- a/admin/all.php
+++ b/admin/all.php
@@ -35,6 +35,12 @@ if ($_GET["migrated"] == 1) {
echo("
" . htmlspecialchars($question['responsetext']);
+ $q .= "
" . insertEmoji($question['responsetext']);
$q .= "
{$question['responsetime']}
";
}
@@ -78,7 +126,7 @@ function getQuestion(
$open = " open";
}
- $q = "
cw: " . htmlspecialchars($question["cw"]) . "
{$q}";
+ $q = "
cw: " . insertEmoji($question["cw"]) . "
{$q}";
}
return "
{$q}
";
diff --git a/config.example.php b/config.example.php
index 51d251a..dee21b3 100644
--- a/config.example.php
+++ b/config.example.php
@@ -9,7 +9,7 @@ $adminPassword = "setAPasswordHere!123";
// page title
$pageTitle = "the cool qna";
-$pageDomainEnabled = True;
+$pageDomainEnabled = true;
$pageProto = "https";
$pagePath = "/qna";
$pageDomain = "example.com";
@@ -21,11 +21,16 @@ $pageRoot = "/"; // path to go to
$customCSSurl = NULL;
// post to fedi?
-$fediEnabled = False;
+$fediEnabled = false;
$fediAPIRoute = "https://example.com/api/v1/statuses";
$fediAPIToken = "Bearer AUTHTOKENGOESHERE";
$fediVisibility = "private"; // "direct", "private", "unlisted", "public"
+// fedi emojis?
+$emojiEnabled = false;
+$emojiAPIRoute = "https://example.com/api/iceshrimp/emoji";
+$emojiAPIToken = $fediAPIToken;
+
// database setup
$dbHost = "localhost";
$dbName = "postgres";
diff --git a/css/base.css b/css/base.css
index 307bd94..135935e 100644
--- a/css/base.css
+++ b/css/base.css
@@ -6,6 +6,7 @@
--link-color: #ff0000;
--confirmation-color: #00ff00;
+ --warning-color: #ffff00;
--question-background: #2c2c2c;
--response-background: #505050;
@@ -33,13 +34,31 @@ hr {
background-color: var(--hr-color);
}
-.permalink {
+a,
+a:link,
+a:visited {
color: var(--link-color);
+}
+
+img.emoji {
+ height: 1.2em;
+ min-width: 1.2em;
+ max-width: 3em;
+ object-fit: contain;
+}
+
+.permalink {
font-size: .9em;
}
-.go-back {
- color: var(--link-color);
+.warning {
+ color: var(--warning-color);
+ margin-bottom: .3em;
+}
+
+.sentconf {
+ color: var(--confirmation-color);
+ margin-bottom: .3em;
}
.title {
@@ -70,11 +89,6 @@ hr {
margin-bottom: .2em;
}
-.sentconf {
- color: var(--confirmation-color);
- margin-bottom: .3em;
-}
-
.sendsum {
font-size: 1.17em;
font-weight: bold;
diff --git a/fetch.php b/fetch.php
index dd7a731..576607e 100644
--- a/fetch.php
+++ b/fetch.php
@@ -23,14 +23,14 @@ include "boilerplate/pageStart.php";
if (pg_num_rows($queryResponse) === 0 || $question["ispublic"] === "f" || $question["isrespondedto"] === "f") {
echo("
{$pageTitle} — no such question exists
-
(go back?)
+
(go back?)
");
http_response_code(404);
} else {
echo("
{$pageTitle} — question number {$question['id']}
-
(go back?)
+
(go back?)
");
echo(getQuestion($question));
diff --git a/index.php b/index.php
index 1c85b34..c11021f 100644
--- a/index.php
+++ b/index.php
@@ -19,7 +19,7 @@ include "boilerplate/pageStart.php";
echo("
" . $pageTitle . "
");
if ($pageDomainEnabled) {
- echo("
(go back to " . $pageDomain . "?)");
+ echo("
(go back to " . $pageDomain . "?)");
}
if ($_GET["sent"] == 1) {
diff --git a/migrations/20250314-AddEmoji.php b/migrations/20250314-AddEmoji.php
new file mode 100644
index 0000000..9af37cf
--- /dev/null
+++ b/migrations/20250314-AddEmoji.php
@@ -0,0 +1,20 @@
+ "20250314-AddEmoji"
+);
+
+pg_insert($db, "migrations", $dataArray);
+
+?>
diff --git a/send.php b/send.php
index 67327ea..b1adc0f 100644
--- a/send.php
+++ b/send.php
@@ -12,7 +12,7 @@ $dataArray = array(
"iscwed" => !($_GET["cw"] === null || $_GET["cw"] === ""),
"time" => date("Y-m-d H:i:sP"),
"ispublic" => $_GET["public"] == 1,
- "isrespondedto" => False
+ "isrespondedto" => false
);
pg_insert($db, "data", $dataArray);
diff --git a/setup.php b/setup.php
index f8ed149..46d675c 100644
--- a/setup.php
+++ b/setup.php
@@ -27,6 +27,15 @@ CREATE TABLE migrations (
pg_query($db, $query);
+$query = "
+CREATE TABLE emoji (
+ name TEXT NOT NULL PRIMARY KEY,
+ url TEXT NOT NULL
+);
+";
+
+pg_query($db, $query);
+
include "admin/migrate.php";
echo "database set up";