Database refactoring and improving blog comments, blog post history and more
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<button type="reset" class="btn btn-sm btn-primary round float-right" data-dismiss="modal">
|
||||
Nein, Post behalten
|
||||
</button>
|
||||
<button type="submit" class="btn btn-sm btn-red outline round float-right" onclick="deletePost('<?= $post['uuid'] ?>')">
|
||||
<button type="submit" class="btn btn-sm btn-red outline round float-right" onclick="deletePost('<?= $post['hashID'] ?>')">
|
||||
Ja, endgültig löschen
|
||||
</button>
|
||||
</form>
|
||||
|
@@ -4,11 +4,11 @@
|
||||
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
||||
|
||||
?>
|
||||
<li class="post-item is-reply% my-2" data-uuid="<?= $uuid ?>" data-username="<?= $username ?>">
|
||||
<li class="post-item is-reply% my-2" data-uuid="<?= $hashID ?>" data-username="<?= $username ?>">
|
||||
<div class="comment-well" <?= isset($hideShadows) && $hideShadows ? 'style="box-shadow: none;padding:0"' : '' ?>>
|
||||
<div class="post-non-content">
|
||||
<a href="<?= base_url('user/' . $username) ?>" target="_blank">
|
||||
<img src="<?= $profile_picture ?>?w=100" class="img-fluid">
|
||||
<img src="<?= $profilePicture ?>?w=100" class="img-fluid">
|
||||
</a>
|
||||
</div>
|
||||
<div class="content-container">
|
||||
@@ -18,13 +18,13 @@
|
||||
<?= $displayname ?>
|
||||
</a>
|
||||
<small><?php
|
||||
$date_created = strtotime($date);
|
||||
echo DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), $_SESSION['site_lang']); ?></small>
|
||||
<?php if ($reply_to != NULL): ?>
|
||||
$dateCreated = strtotime($date);
|
||||
echo DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateCreated"), $_SESSION['site_lang']); ?></small>
|
||||
<?php if ($replyToPostID != NULL): ?>
|
||||
<small>
|
||||
<i class="fa fa-reply"></i>
|
||||
<?= lang('post_reply_to') ?>
|
||||
<a href="#" onclick="showFullPost('<?= $replyToPost['uuid'] ?>', '<?= $replyToPost['username'] ?>')">@<?= $replyToPost['displayname'] ?></a>
|
||||
<a href="#" onclick="showFullPost('<?= $replyToPost['hashID'] ?>', '<?= $replyToPost['username'] ?>')">@<?= $replyToPost['displayname'] ?></a>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</h3>
|
||||
@@ -80,31 +80,31 @@
|
||||
</div>
|
||||
<?php if (!isset($hideActionBtns) || !$hideActionBtns): ?>
|
||||
<div class="action-btns">
|
||||
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="<?= lang('post_reply') ?>">
|
||||
<a href="#" data-uuid="<?= $hashID ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="<?= lang('post_reply') ?>">
|
||||
<i class="far fa-comment"></i>
|
||||
<span><?= $replyCount ?></span>
|
||||
</a>
|
||||
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn like-button <?= isset($userHasLiked) && $userHasLiked ? 'active' : '' ?>" data-toggle="tooltip" data-placement="top" title="<?= lang('post_like') ?>">
|
||||
<a href="#" data-uuid="<?= $hashID ?>" class="action-btn like-button <?= isset($userHasLiked) && $userHasLiked ? 'active' : '' ?>" data-toggle="tooltip" data-placement="top" title="<?= lang('post_like') ?>">
|
||||
<i class="<?= isset($userHasLiked) && $userHasLiked ? 'fas' : 'far' ?> fa-heart"></i>
|
||||
<span><?= $likeCount ?></span>
|
||||
</a>
|
||||
<div class="action-btn dropdown">
|
||||
<a href="#" class="action-btn more-options-button" id="postMoreOptionsButton<?= $uuid ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<a href="#" class="action-btn more-options-button" id="postMoreOptionsButton<?= $hashID ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $uuid ?>">
|
||||
<a href="#" onclick="copyToClipboard('<?= base_url('user/' . $username . '/post/' . $uuid) ?>')" class="dropdown-item">
|
||||
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $hashID ?>">
|
||||
<a href="#" onclick="copyToClipboard('<?= base_url('user/' . $username . '/post/' . $hashID) ?>')" class="dropdown-item">
|
||||
<i class="fa fa-copy"></i>
|
||||
<?= lang('post_copy_link') ?>
|
||||
</a>
|
||||
<a href="#" onclick="openPostReportModal('<?= $uuid ?>')" class="dropdown-item">
|
||||
<a href="#" onclick="openPostReportModal('<?= $hashID ?>')" class="dropdown-item">
|
||||
<i class="fa fa-flag"></i>
|
||||
<?= lang('post_report') ?>
|
||||
</a>
|
||||
<?php if (isset($_SESSION['user']) && $_SESSION['user']['username'] == $username): ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" onclick="openDeletePostModal('<?= $uuid ?>')" class="dropdown-item text-danger">
|
||||
<a href="#" onclick="openDeletePostModal('<?= $hashID ?>')" class="dropdown-item text-danger">
|
||||
<i class="fa fa-trash"></i>
|
||||
<?= lang('post_delete') ?>
|
||||
</a>
|
||||
|
@@ -5,21 +5,21 @@
|
||||
|
||||
?>
|
||||
|
||||
<?= $message; ?>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<ul class="comment-list">
|
||||
<?php
|
||||
$post['replyToPost']['hideShadows'] = true;
|
||||
$this->load->view('network/posts/post_item', $post['replyToPost'])
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if (isset($post['replyToPost'])): ?>
|
||||
<div class="row justify-content-center">
|
||||
<ul class="comment-list">
|
||||
<?php
|
||||
$post['replyToPost']['hideShadows'] = true;
|
||||
$this->load->view('network/posts/post_item', $post['replyToPost'])
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="post-non-content">
|
||||
<a href="<?= base_url('user/' . $post['username']) ?>">
|
||||
<img src="<?= $post['profile_picture'] ?>?w=75" alt="" class="img-fluid rounded-circle">
|
||||
<img src="<?= $post['profilePicture'] ?>?w=75" alt="" class="img-fluid rounded-circle">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<?= $post['displayname'] ?>
|
||||
</a>
|
||||
<?php
|
||||
$date_created = strtotime($post['date']);
|
||||
$time_passed = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), $_SESSION['site_lang']);
|
||||
$dateCreated = strtotime($post['date']);
|
||||
$time_passed = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateCreated"), $_SESSION['site_lang']);
|
||||
?>
|
||||
<small>
|
||||
<?= $time_passed ?>
|
||||
@@ -51,20 +51,20 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="action-btns">
|
||||
<a href="#" data-uuid="<?= $post['uuid'] ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="Antworten">
|
||||
<a href="#" data-uuid="<?= $post['hashID'] ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="Antworten">
|
||||
<span><i class="far fa-comment"></i></span>
|
||||
<?= $post['replyCount'] ?>
|
||||
</a>
|
||||
<a href="#" data-uuid="<?= $post['uuid'] ?>" class="action-btn like-button <?= isset($post['userHasLiked']) && $post['userHasLiked'] ? 'active' : '' ?>" data-toggle="tooltip" data-placement="top" title="Gefällt mir">
|
||||
<a href="#" data-uuid="<?= $post['hashID'] ?>" class="action-btn like-button <?= isset($post['userHasLiked']) && $post['userHasLiked'] ? 'active' : '' ?>" data-toggle="tooltip" data-placement="top" title="Gefällt mir">
|
||||
<i class="<?= isset($post['userHasLiked']) && $post['userHasLiked'] ? 'fas' : 'far' ?> fa-heart"></i>
|
||||
<span><?= $post['likeCount'] ?></span>
|
||||
</a>
|
||||
<div class="dropdown d-inline-block">
|
||||
<a href="#" class="action-btn more-options-button" id="postMoreOptionsButton<?= $post['uuid'] ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<a href="#" class="action-btn more-options-button" id="postMoreOptionsButton<?= $post['hashID'] ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $post['uuid'] ?>">
|
||||
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $post['hashID'] ?>">
|
||||
<a href="#" class="dropdown-item">
|
||||
<i class="fa fa-copy"></i>
|
||||
Link zum Post kopieren
|
||||
|
Reference in New Issue
Block a user