Support sending threaded replies
rodzic
5657d2938f
commit
db46472041
35
index.php
35
index.php
|
@ -583,17 +583,22 @@ echo <<< HTML
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="/send" method="post" enctype="multipart/form-data">
|
<fieldset>
|
||||||
<label for="content">Your message:</label><br>
|
<legend>Send a message</legend>
|
||||||
<textarea id="content" name="content" rows="5" cols="32"></textarea><br>
|
<form action="/send" method="post" enctype="multipart/form-data">
|
||||||
<label for="image">Attach an image</label><br>
|
<label for="content">Your message:</label><br>
|
||||||
<input type="file" name="image" id="image" accept="image/*"><br>
|
<textarea id="content" name="content" rows="5" cols="32"></textarea><br>
|
||||||
<label for="alt">Alt Text</label>
|
<label for="inReplyTo">Reply to URl:</label>
|
||||||
<input type="text" name="alt" id="alt" size="32" /><br>
|
<input type="url" name="inReplyTo" id="inReplyTo" size="32" /><br>
|
||||||
<label for="password">Password</label><br>
|
<label for="image">Attach an image</label><br>
|
||||||
<input type="password" name="password" id="password" size="32"><br>
|
<input type="file" name="image" id="image" accept="image/*"><br>
|
||||||
<input type="submit" value="Post Message">
|
<label for="alt">Alt Text</label>
|
||||||
</form>
|
<input type="text" name="alt" id="alt" size="32" /><br>
|
||||||
|
<label for="password">Password</label><br>
|
||||||
|
<input type="password" name="password" id="password" size="32"><br><br>
|
||||||
|
<input type="submit" value="Post Message">
|
||||||
|
</form>
|
||||||
|
</fieldset>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
HTML;
|
HTML;
|
||||||
|
@ -614,6 +619,13 @@ HTML;
|
||||||
// Get the posted content
|
// Get the posted content
|
||||||
$content = $_POST["content"];
|
$content = $_POST["content"];
|
||||||
|
|
||||||
|
// Is this a reply?
|
||||||
|
if ( isset( $_POST["inReplyTo"] ) && filter_var( $_POST["inReplyTo"], FILTER_VALIDATE_URL ) ) {
|
||||||
|
$inReplyTo = $_POST["inReplyTo"];
|
||||||
|
} else {
|
||||||
|
$inReplyTo = null;
|
||||||
|
}
|
||||||
|
|
||||||
// Process the content into HTML to get hashtags etc
|
// Process the content into HTML to get hashtags etc
|
||||||
list( "HTML" => $content, "TagArray" => $tags ) = process_content( $content );
|
list( "HTML" => $content, "TagArray" => $tags ) = process_content( $content );
|
||||||
|
|
||||||
|
@ -669,6 +681,7 @@ HTML;
|
||||||
"type" => "Note",
|
"type" => "Note",
|
||||||
"published" => $timestamp,
|
"published" => $timestamp,
|
||||||
"attributedTo" => "https://{$server}/{$username}",
|
"attributedTo" => "https://{$server}/{$username}",
|
||||||
|
"inReplyTo" => $inReplyTo,
|
||||||
"content" => $content,
|
"content" => $content,
|
||||||
"contentMap" => ["en" => $content],
|
"contentMap" => ["en" => $content],
|
||||||
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
|
|
Ładowanie…
Reference in New Issue