added reply-box to conv

This commit is contained in:
sørenpeter 2023-11-13 22:03:17 +01:00
parent d6a12a1630
commit c21d9feca6
6 changed files with 21 additions and 13 deletions

View file

@ -1,7 +1,7 @@
</main> </main>
<footer><center><small> <footer><center><small>
&copy; 2023 Søren Peter Mørch &copy; 2023 <?= $config['public_nick'] ?>
</small></center></footer> </small></center></footer>
</body> </body>

View file

@ -44,7 +44,7 @@
?> ?>
<!-- (<a href="new_twt.php?hash=<?= $twt->hash ?>">via email</a>) TODO: mailto-link --> <!-- (<a href="new_twt.php?hash=<?= $twt->hash ?>">via email</a>) TODO: mailto-link -->
<a href='./post/<?= $twt->hash ?>' class="right"><span title="<?= $twt->fullDate ?> "><?= $twt->displayDate ?></span></a> <a href='<?= $baseURL ?>/post/<?= $twt->hash ?>' class="right"><span title="<?= $twt->fullDate ?> "><?= $twt->displayDate ?></span></a>
</small> </small>
</div> </div>
</article> </article>

View file

@ -30,6 +30,9 @@ timezone = "Europe/Copenhagen"
twts_per_page = 50 twts_per_page = 50
; E-mail for comments
email = ""
[security] [security]
; Generate it with the TOTP module ; Generate it with the TOTP module
totp_digits = 10 totp_digits = 10
@ -39,9 +42,5 @@ totp_secret = "1234567890"
; In case it's in HTTP (not secure), set this to false ; In case it's in HTTP (not secure), set this to false
secure_cookies = true secure_cookies = true
; E-mail for comments
email = ""
; Simple password for unnamed user ; Simple password for unnamed user
password = "" password = ""

View file

@ -12,13 +12,19 @@ if (!empty($id)) {
$title = "Conversation: ".$id." - ".$title; $title = "Conversation: ".$id." - ".$title;
include 'partials/header.php'; include_once 'partials/header.php';
?> ?>
<h2>Conversation</h2> <h2>Conversation</h2>
<p>Recent twts in reply to <a href="/post/<?= $id ?>">#<?= $id ?></a></p> <p>Recent twts in reply to <a href="/post/<?= $id ?>">#<?= $id ?></a></p>
<!-- PHP: GET TIMELIE --><?php include 'partials/timeline.php'?> <!-- PHP: GET TIMELIE --><?php include_once 'partials/timeline.php'?>
<!-- PHP: GET FOOTER --><?php include 'partials/footer.php';?> <?php
if (isset($_SESSION['password'])) {
$textareaValue = "(#$id) ";
include 'views/new_twt.php';
} ?>
<!-- PHP: GET FOOTER --><?php include_once 'partials/footer.php';?>

View file

@ -24,7 +24,7 @@ if (!isset($_SESSION['password'])) {
exit(); exit();
} }
$textareaValue = ''; //$textareaValue = '';
if (isset($_GET['hash'])) { if (isset($_GET['hash'])) {
$hash = $_GET['hash']; $hash = $_GET['hash'];
$textareaValue = "(#$hash) "; $textareaValue = "(#$hash) ";
@ -59,8 +59,11 @@ if (isset($_POST['submit'])) {
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
} }
//$datetime = gmdate('Y-m-d\TH:i:s\Z', $date->format('U'));
//$twt = $datetime . "\t$new_post\n";
$twt = date('c') . "\t$new_post\n"; $twt = date('c') . "\t$new_post\n";
if (strpos($contents, NEW_TWT_MARKER) !== false) { if (strpos($contents, NEW_TWT_MARKER) !== false) {
// Add the previous marker // Add the previous marker
// Take note that doesn't not work if twtxt file has CRLF line ending // Take note that doesn't not work if twtxt file has CRLF line ending

View file

@ -9,11 +9,11 @@ if (!empty($id)) {
$title = "Post #".$id." - ".$title; $title = "Post #".$id." - ".$title;
include 'partials/header.php'; include_once 'partials/header.php';
?> ?>
<!-- <h2>Post: #<?= $id ?></h2> --> <!-- <h2>Post: #<?= $id ?></h2> -->
<!-- PHP: GET TIMELIE --><?php include 'partials/timeline.php'?> <!-- PHP: GET TIMELIE --><?php include_once 'partials/timeline.php'?>
<!-- PHP: GET FOOTER --><?php include 'partials/footer.php';?> <!-- PHP: GET FOOTER --><?php include_once 'partials/footer.php';?>