106 lines
4.1 KiB
PHP
106 lines
4.1 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
|
|
|
?>
|
|
|
|
<?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['profilePicture'] ?>?w=75" alt="" class="img-fluid rounded-circle">
|
|
</a>
|
|
</div>
|
|
|
|
<div class="col">
|
|
<h4>
|
|
<a href="<?= base_url('user/' . $post['username']) ?>">
|
|
<?= $post['displayname'] ?>
|
|
</a>
|
|
<?php
|
|
$dateCreated = strtotime($post['date']);
|
|
$time_passed = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateCreated"), $_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['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['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['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['hashID'] ?>">
|
|
<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>
|
|
<?= lang('post_no_replies') ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|