add link to fedi posts

This commit is contained in:
notfire 2024-12-10 10:06:39 -05:00
parent b384627451
commit 121fd184b5
No known key found for this signature in database
GPG key ID: 3AFDACAAB4E56B16
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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";