From 121fd184b5b51ee358cfbc6f2c8257754c244642 Mon Sep 17 00:00:00 2001 From: notfire Date: Tue, 10 Dec 2024 10:06:39 -0500 Subject: [PATCH] add link to fedi posts --- admin/fedi.php | 5 +++-- config.example.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/fedi.php b/admin/fedi.php index 2b8c8e2..b1dff9f 100644 --- a/admin/fedi.php +++ b/admin/fedi.php @@ -20,11 +20,12 @@ $contentR = $arr["responsetext"]; if ($arr["iscwed"] == "t") { $contentCW = $arr["cw"]; + $url = "{$pageProto}://" . $_SERVER["HTTP_HOST"] . str_replace("/admin/fedi.php", "/fetch.php?id={$id}", $_SERVER["REQUEST_URI"]); curl_setopt($ch, CURLOPT_POSTFIELDS, - http_build_query(array('status' => "question: {$contentO}\n\nresponse: {$contentR}", 'visibility' => "{$fediVisibility}", 'spoiler_text' => "anonymous question response (automated); cw: {$contentCW}"))); + http_build_query(array('status' => "question: {$contentO}\n\nresponse: {$contentR}\n\nlink: {$url}", 'visibility' => "{$fediVisibility}", 'spoiler_text' => "anonymous question response (automated); cw: {$contentCW}"))); } else { curl_setopt($ch, CURLOPT_POSTFIELDS, - http_build_query(array('status' => "question: {$contentO}\n\nresponse: {$contentR}", 'visibility' => "{$fediVisibility}", 'spoiler_text' => "anonymous question response (automated)"))); + http_build_query(array('status' => "question: {$contentO}\n\nresponse: {$contentR}\n\nlink: {$url}", 'visibility' => "{$fediVisibility}", 'spoiler_text' => "anonymous question response (automated)"))); } curl_exec($ch); diff --git a/config.example.php b/config.example.php index 8fd0d4c..43c5777 100644 --- a/config.example.php +++ b/config.example.php @@ -10,6 +10,7 @@ $adminPassword = "setAPasswordHere!123"; $pageTitle = "the cool qna"; $pageDomainEnabled = True; +$pageProto = "https"; $pageDomain = "example.com"; $pageDomainOther = $pageDomain; // you can comment out and change this to a subdomain you want to "go back to". eg your site is me.example.org but you want it to say example.org //$pageDomainOther = "me.example.com";