only scroll to the end when necessary

master
BodgeMaster 2021-09-07 05:53:04 +02:00
parent b0f0accb68
commit 40e6c4a183
3 changed files with 11 additions and 5 deletions

View File

@ -22,7 +22,7 @@ $id=$_GET['id'];
} }
?> ?>
</head> </head>
<body onLoad="window.scrollTo(0,document.body.scrollHeight)"> <body>
%NAVBAR% %NAVBAR%
<div class="container"> <div class="container">
<div class="item-1"> <div class="item-1">

View File

@ -1,8 +1,10 @@
<?php <?php
%REQUIRE_LOGIN% %REQUIRE_LOGIN%
echo "<section onLoad=\"window.scrollTo(0,document.body.scrollHeight)\" >";
if (isset($_GET['reply_to'])) { if (isset($_GET['reply_to'])) {
echo "<section><form action='%CONTENT_DIR%/board/?id=$id&action=submit&reply_to=" . $_GET['reply_to'] . "' method='post'><input type='text' name='title' maxlength='128' placeholder='Title'/><textarea name='content' maxlength='65535' placeholder='You can contribute to the conversation here. Tell us your story in up to 65535 characters...' rows='3'></textarea><input type='submit' value='Post'></form></section>"; echo "<form action='%CONTENT_DIR%/board/?id=$id&action=submit&reply_to=" . $_GET['reply_to'] . "' method='post'>";
} else { } else {
echo "<section><form action='%CONTENT_DIR%/board/?id=$id&action=submit' method='post'><input type='text' name='title' maxlength='128' placeholder='Title'/><textarea name='content' maxlength='65535' placeholder='You can contribute to the conversation here. Tell us your story in up to 65535 characters...' rows='3'></textarea><input type='submit' value='Post'></form></section>"; echo "<form action='%CONTENT_DIR%/board/?id=$id&action=submit' method='post'>";
} }
echo "<input type='text' name='title' maxlength='128' placeholder='Title'/><textarea name='content' maxlength='65535' placeholder='You can contribute to the conversation here. Tell us your story in up to 65535 characters...' rows='3'></textarea><input type='submit' value='Post'></form></section>";
?> ?>

View File

@ -7,8 +7,10 @@ if (isset($_GET['reply_to'])) {
$reply_to = -1; $reply_to = -1;
} }
echo "<section onLoad=\"window.scrollTo(0,document.body.scrollHeight)\" >";
if ($_POST['title']==="" || $_POST['content']==="") { if ($_POST['title']==="" || $_POST['content']==="") {
echo "<section><center><h1>Please fill out both the title field and content box.</h1></center></section>"; echo "<center><h1>Please fill out both the title field and content box.</h1></center>";
} }
else { else {
@ -22,6 +24,8 @@ else {
$error_message = "<p>Error: SQL error.</p><pre>" . $statement->queryString . "</pre><pre>" . $statement->errorInfo()[2] . "</pre>"; $error_message = "<p>Error: SQL error.</p><pre>" . $statement->queryString . "</pre><pre>" . $statement->errorInfo()[2] . "</pre>";
} }
echo "<section><center><h1>Post submitted.</h1></center></section>"; echo "<center><h1>Post submitted.</h1></center>";
} }
echo "</section>";
?> ?>