aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaquer <jaquer@users.noreply.github.com>2022-01-26 18:26:54 -0800
committerjaquer <jaquer@users.noreply.github.com>2022-01-27 07:34:19 -0800
commit1ffe3c860978ac92bb4a4d3a9941e7a63c063a36 (patch)
tree868c22db065307e74d5c1fda9b4b67185ec0b624
parent3e31ae67d502190dcf34a04b279060fe40c368a8 (diff)
downloadmicroblog-1ffe3c860978ac92bb4a4d3a9941e7a63c063a36.tar.gz
microblog-1ffe3c860978ac92bb4a4d3a9941e7a63c063a36.tar.bz2
microblog-1ffe3c860978ac92bb4a4d3a9941e7a63c063a36.zip
Changed all instances of 'message' to 'content' for consistency with db field.
It also removes ambiguity with the success/error message variables.
-rw-r--r--functions.php4
-rw-r--r--microblog.css4
-rw-r--r--postform.inc.php10
-rw-r--r--single.inc.php2
-rw-r--r--timeline.inc.php2
5 files changed, 11 insertions, 11 deletions
diff --git a/functions.php b/functions.php
index 25ae5b2..7041b26 100644
--- a/functions.php
+++ b/functions.php
@@ -6,13 +6,13 @@ function path($fragment=null) {
return (!empty($config['path'][$fragment])) ? $config['path'][$fragment] : false;
}
-function db_insert($message, $timestamp=NOW) {
+function db_insert($content, $timestamp=NOW) {
global $db;
if(empty($db)) return false;
$statement = $db->prepare('INSERT INTO posts (post_content, post_timestamp) VALUES (:post_content, :post_timestamp)');
- $statement->bindParam(':post_content', $message, PDO::PARAM_STR);
+ $statement->bindParam(':post_content', $content, PDO::PARAM_STR);
$statement->bindParam(':post_timestamp', $timestamp, PDO::PARAM_INT);
$statement->execute();
diff --git a/microblog.css b/microblog.css
index eb9e382..61c44f2 100644
--- a/microblog.css
+++ b/microblog.css
@@ -83,12 +83,12 @@ nav li + li a {
margin-bottom: 0.5rem;
}
-.wrap .post-message {
+.wrap .post-content {
font-size: 1.25rem;
overflow-wrap: break-word;
}
-.wrap .post-message a {
+.wrap .post-content a {
color: #007aff;
text-decoration: none;
}
diff --git a/postform.inc.php b/postform.inc.php
index 6749821..81cd14a 100644
--- a/postform.inc.php
+++ b/postform.inc.php
@@ -16,9 +16,9 @@
header('Content-Type: text/html; charset=utf-8');
$message = array();
- if(!empty($_POST['message'])) {
+ if(!empty($_POST['content'])) {
- $id = db_insert($_POST['message'], NOW);
+ $id = db_insert($_POST['content'], NOW);
if($id > 0) {
$message = array(
@@ -29,7 +29,7 @@
rebuild_feed();
if($config['ping'] == true) ping_microblog();
if($config['crosspost_to_twitter'] == true) {
- $twitter_response = json_decode(twitter_post_status($_POST['message']), true);
+ $twitter_response = json_decode(twitter_post_status($_POST['content']), true);
if(!empty($twitter_response['errors'])) {
$message['message'] .= ' (But crossposting to twitter failed!)';
@@ -57,7 +57,7 @@
<p class="message <?= $message['status'] ?>"><?= $message['message'] ?></p>
<?php endif; ?>
<form action="" method="post">
- <textarea name="message" maxlength="<?= $config['max_characters'] ?>"></textarea>
+ <textarea name="content" maxlength="<?= $config['max_characters'] ?>"></textarea>
<p id="count"><?= $config['max_characters'] ?></p>
<input type="submit" name="" value="Post" />
</form>
@@ -65,7 +65,7 @@
<script>
document.addEventListener('DOMContentLoaded', function() {
- var textarea = document.querySelector('textarea[name="message"]');
+ var textarea = document.querySelector('textarea[name="content"]');
var charCount = document.querySelector('#count');
var maxCount = parseInt(textarea.getAttribute('maxlength'));
diff --git a/single.inc.php b/single.inc.php
index 623e121..dfcb7e3 100644
--- a/single.inc.php
+++ b/single.inc.php
@@ -26,7 +26,7 @@
$formatted_time = strftime('%b %d %Y %H:%M', $post['post_timestamp']);
?>
<time class="post-timestamp" datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time>
- <p class="post-message"><?= nl2br(autolink($post['post_content'])) ?></p>
+ <p class="post-content"><?= nl2br(autolink($post['post_content'])) ?></p>
<?php else: ?>
<p>No post with this ID.</p>
<?php endif; ?>
diff --git a/timeline.inc.php b/timeline.inc.php
index f560d24..76185bc 100644
--- a/timeline.inc.php
+++ b/timeline.inc.php
@@ -42,7 +42,7 @@
$formatted_time = strftime('%b %d %Y %H:%M', $post['post_timestamp']);
?>
<a class="post-timestamp" href="<?= $config['url'] ?>/<?= $post['id'] ?>"><time datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time></a>
- <p class="post-message"><?= nl2br(autolink($post['post_content'])) ?></p>
+ <p class="post-content"><?= nl2br(autolink($post['post_content'])) ?></p>
</li>
<?php endforeach; ?>
</ul>