Archived
1
0
This repository has been archived on 2020-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
old/application/views/network/posts/post_item.php

120 lines
7.2 KiB
PHP
Raw Normal View History

2018-10-16 16:28:42 +00:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
?>
2018-10-27 10:08:54 +00:00
<li class="post-item is-reply% my-2" data-uuid="<?= $uuid ?>" data-username="<?= $username ?>">
<div class="comment-well" <?= isset($hideShadows) && $hideShadows ? 'style="box-shadow: none;padding:0"' : '' ?>>
2018-10-16 16:28:42 +00:00
<div class="post-non-content">
<a href="<?= base_url('user/' . $username) ?>" target="_blank">
<img src="<?= $profile_picture ?>?w=100" class="img-fluid">
</a>
</div>
<div class="content-container">
<div class="content">
<h3>
<a href="<?= base_url('user/' . $username) ?>" target="_blank">
<?= $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): ?>
<small>
<i class="fa fa-reply"></i>
2018-10-28 14:33:06 +00:00
<?= lang('post_reply_to') ?>
2018-10-27 10:08:54 +00:00
<a href="#" onclick="showFullPost('<?= $replyToPost['uuid'] ?>', '<?= $replyToPost['username'] ?>')">@<?= $replyToPost['displayname'] ?></a>
2018-10-16 16:28:42 +00:00
</small>
<?php endif; ?>
</h3>
<div class="comment">
<p>
<?= $this->PostsModel->closeTags($content) ?>
</p>
<?php if (!empty($media)): ?>
<div class="post-media-list row">
2018-12-30 17:52:30 +00:00
<?php foreach ($media as $item) {
$url = '/f/' . $item['name'];
switch ($item['type']) {
case 'image':
?>
<div class="col">
<div class="post-media post-image" data-full-image="<?= $url ?>" style="background-image: url('<?= $url ?>?w=500')"></div>
</div>
<?php
break;
case 'video':
?>
<div class="col">
<div class="video-container">
<video class="video" src="<?= $url ?>" muted></video>
<div class="video-controls">
<button type="button" class="video-control-btn video-toggle-play">
<i class="fa fa-play"></i>
</button>
<div class="video-volume-container">
<button type="button" class="video-control-btn video-mute">
<i class="fa fa-volume-muted"></i>
</button>
<input type="range" class="video-volume" min="0" max="1" step="0.1" value="1">
</div>
<output class="video-time">0:00</output>
<input type="range" class="video-seek-bar" value="0">
<output class="video-length">0:00</output>
<button type="button" class="video-control-btn video-fullscreen">
<i class="fa fa-expand"></i>
</button>
</div>
</div>
</div>
<?php
break;
case 'audio':
break;
}
} ?>
2018-10-16 16:28:42 +00:00
</div>
<?php endif; ?>
</div>
<?php if (!isset($hideActionBtns) || !$hideActionBtns): ?>
<div class="action-btns">
2018-10-28 14:33:06 +00:00
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="<?= lang('post_reply') ?>">
<i class="far fa-comment"></i>
<span><?= $replyCount ?></span>
2018-10-16 16:28:42 +00:00
</a>
2018-10-28 14:33:06 +00:00
<a href="#" data-uuid="<?= $uuid ?>" 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">
<i class="fa fa-ellipsis-h"></i>
2018-10-16 16:28:42 +00:00
</a>
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $uuid ?>">
<a href="#" onclick="copyToClipboard('<?= base_url('user/' . $username . '/post/' . $uuid) ?>')" class="dropdown-item">
<i class="fa fa-copy"></i>
2018-10-28 14:33:06 +00:00
<?= lang('post_copy_link') ?>
2018-10-16 16:28:42 +00:00
</a>
<a href="#" onclick="openPostReportModal('<?= $uuid ?>')" class="dropdown-item">
<i class="fa fa-flag"></i>
2018-10-28 14:33:06 +00:00
<?= 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">
<i class="fa fa-trash"></i>
2018-10-28 14:33:06 +00:00
<?= lang('post_delete') ?>
</a>
<?php endif; ?>
</div>
2018-10-16 16:28:42 +00:00
</div>
</div>
<?php endif; ?>
2018-10-16 16:28:42 +00:00
</div>
</div>
</div>
</li>