97 lines
3.9 KiB
PHP
97 lines
3.9 KiB
PHP
|
<?php
|
||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||
|
|
||
|
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
||
|
|
||
|
?>
|
||
|
|
||
|
<?= $message; ?>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-sm-2">
|
||
|
<a href="<?= base_url('user/' . $post['username']) ?>">
|
||
|
<img src="<?= $post['profile_picture'] ?>?w=75" alt="" class="img-fluid rounded-circle">
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<div class="col-sm-10">
|
||
|
<h4>
|
||
|
<a href="<?= base_url('user/' . $post['username']) ?>">
|
||
|
<?= $post['displayname'] ?>
|
||
|
</a>
|
||
|
<?php
|
||
|
$date_created = strtotime($post['date']);
|
||
|
$time_passed = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), $_SESSION['site_lang']);
|
||
|
?>
|
||
|
<small>
|
||
|
<?= $time_passed ?>
|
||
|
</small>
|
||
|
</h4>
|
||
|
|
||
|
<p class="post-content">
|
||
|
<?= $post['content'] ?>
|
||
|
</p>
|
||
|
<?php if (!empty($post['media'])): ?>
|
||
|
<div class="post-media-list row">
|
||
|
<?php foreach ($post['media'] as $item): ?>
|
||
|
<div class="col">
|
||
|
<div class="post-media" data-full-image="<?= $item['mediaUrl'] ?>" style="background-image: url(<?= $item['mediaUrl'] ?>?w=500"></div>
|
||
|
</div>
|
||
|
<?php endforeach; ?>
|
||
|
</div>
|
||
|
<?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">
|
||
|
<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">
|
||
|
<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">
|
||
|
<i class="fa fa-ellipsis-h"></i>
|
||
|
</a>
|
||
|
|
||
|
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $post['uuid'] ?>">
|
||
|
<a href="#" class="dropdown-item">
|
||
|
<i class="fa fa-copy"></i>
|
||
|
Link zum Post kopieren
|
||
|
</a>
|
||
|
<a href="#" class="dropdown-item">
|
||
|
<i class="fa fa-flag"></i>
|
||
|
Post melden
|
||
|
</a>
|
||
|
<?php if (isset($_SESSION['user']) && $_SESSION['user']['username'] == $post['username']): ?>
|
||
|
<div class="dropdown-divider"></div>
|
||
|
<a href="" class="dropdown-item text-danger">
|
||
|
<i class="fa fa-trash"></i>
|
||
|
Post löschen
|
||
|
</a>
|
||
|
<?php endif; ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-10 offset-1">
|
||
|
<ul class="comment-list">
|
||
|
<?php if ($replies !== NULL && !empty($replies)):
|
||
|
foreach ($replies as $reply):
|
||
|
$this->load->view('network/posts/post_item', $reply);
|
||
|
endforeach; ?>
|
||
|
</ul>
|
||
|
<?php else: ?>
|
||
|
<p class="text-muted">
|
||
|
<i class="far fa-frown"></i>
|
||
|
Es gibt zu diesem Post keine Antworten. Wie wär's, wenn du der Erste bist, eine zu verfassen?
|
||
|
</p>
|
||
|
<?php endif; ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
|