64 lines
2.7 KiB
PHP
64 lines
2.7 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
|
?>
|
|
<li id="comment-<?= $c['ID'] ?>">
|
|
<div class="user-post-item">
|
|
<a href="<?= base_url('user/' . $data['username']) ?>" class="item-avatar-container">
|
|
<img src="<?= $data['profilePicture'] ?>?w=100" alt="<?= $data['username'] ?>" class="item-avatar">
|
|
</a>
|
|
<h3 class="item-user">
|
|
<a href="<?= base_url('user/' . $data['username']) ?>">
|
|
<?= $data['displayname'] ?>
|
|
</a>
|
|
</h3>
|
|
<h4 class="item-meta">
|
|
<?php
|
|
$locale = isset($_SESSION['site_lang']) ? $_SESSION['site_lang'] : 'en';
|
|
$dateCreated = strtotime($c['date']);
|
|
echo DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateCreated"), $locale);
|
|
?>
|
|
<?php if (isset($c['url'])): ?>
|
|
unter
|
|
<a href="<?= base_url('blog/post/' . $c['url']) ?>">
|
|
<?= $c['title'] ?>
|
|
</a>
|
|
<?php endif; ?>
|
|
</h4>
|
|
<p class="item-content">
|
|
<?= $c['comment'] ?>
|
|
</p>
|
|
<?php if(!isset($hideActionBtns) || $hideActionBtns == false): ?>
|
|
<div class="item-actions">
|
|
<a href="#" class="item-btn" data-toggle="tooltip" data-placement="top" title="Antworten">
|
|
<i class="far fa-comment"></i>
|
|
<span>0</span>
|
|
</a>
|
|
<a href="#" class="item-btn" data-toggle="tooltip" data-placement="top" title="Gefällt mir">
|
|
<i class="far fa-heart"></i>
|
|
<span>0</span>
|
|
</a>
|
|
<div class="item-btn dropdown">
|
|
<a href="#" class="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<i class="fa fa-ellipsis-h"></i>
|
|
</a>
|
|
<div class="dropdown-menu">
|
|
<a onclick="openCommentReportModal(<?= $c['ID'] ?>)" class="dropdown-item">
|
|
<i class="fa fa-flag"></i>
|
|
Kommentar melden
|
|
</a>
|
|
|
|
<?php if(isset($_SESSION['user']) && $_SESSION['user']['username'] == $data['username']): ?>
|
|
<div class="dropdown-divider"></div>
|
|
<a onclick="openCommentDeleteModal(<?= $c['ID'] ?>)" class="dropdown-item text-danger">
|
|
<i class="fa fa-trash"></i>
|
|
Kommentar löschen
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</li>
|