Archived
1
0

Initial commit as of 2018-10-16

This commit is contained in:
Marcel
2018-10-16 18:28:42 +02:00
commit 29d7c2ffdc
3601 changed files with 358427 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
?>
<li class="post-item my-2" data-uuid="<?= $uuid ?>" data-username="<?= $username ?>">
<div class="comment-well">
<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>
als Antwort an
<a href="#" onclick="showFullPost('<?= $replyToUuid ?>', '<?= $replyToUsername ?>')">@<?= $replyToDisplayname ?></a>
</small>
<?php endif; ?>
</h3>
<div class="comment">
<p>
<?= $this->PostsModel->closeTags($content) ?>
</p>
<?php if (!empty($media)): ?>
<div class="post-media-list row">
<?php foreach ($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>
<div class="action-btns">
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="Antworten">
<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="Gefällt mir">
<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>
</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>
Link zum Post kopieren
</a>
<a href="#" onclick="openPostReportModal('<?= $uuid ?>')" class="dropdown-item">
<i class="fa fa-flag"></i>
Post melden
</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>
Post löschen
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</li>

View File

@@ -0,0 +1,153 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<section class="container" id="profile-content" data-type="foreground" data-speed="10">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="row search-form-container">
<!-- --><?php //$this->load->view('network/user/user_profile_card') ?>
<form action="<?= base_url('posts/search') ?>" class="search-form">
<input type="search" placeholder="<?= lang('feed_search') ?>" name="q" class="search-input" value="<?= isset($search) ? urldecode($search['query']) : '' ?>">
<button type="submit" class="search-button">
<svg class="submit-button">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#search"></use>
</svg>
</button>
<div class="search-option">
<div>
<input name="type" type="radio" value="type-all" id="type-all" <?= !isset($search) || $search['type'] == 'type-all' ? 'checked' : '' ?>>
<label for="type-all">
<svg class="edit-pen-title">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#all"></use>
</svg>
<span><?= lang('feed_search_all') ?></span>
</label>
</div>
<div>
<input name="type" type="radio" value="type-users" id="type-users" <?= isset($search) && $search['type'] == 'type-users' ? 'checked' : '' ?>>
<label for="type-users">
<svg class="edit-pen-title">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#user"></use>
</svg>
<span><?= lang('feed_search_user') ?></span>
</label>
</div>
<div>
<input name="type" type="radio" value="type-posts" id="type-posts" <?= isset($search) && $search['type'] == 'type-posts' ? 'checked' : '' ?>>
<label for="type-posts">
<svg class="edit-pen-title">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#post"></use>
</svg>
<span><?= lang('feed_search_posts') ?></span>
</label>
</div>
<div>
<input name="type" type="radio" value="type-images" id="type-images" <?= isset($search) && $search['type'] == 'type-images' ? 'checked' : '' ?>>
<label for="type-images">
<svg class="edit-pen-title">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#images"></use>
</svg>
<span><?= lang('feed_search_media') ?></span>
</label>
</div>
</div>
</form>
<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0" display="none">
<symbol id="search" viewBox="0 0 32 32">
<path d="M 19.5 3 C 14.26514 3 10 7.2651394 10 12.5 C 10 14.749977 10.810825 16.807458 12.125 18.4375 L 3.28125 27.28125 L 4.71875 28.71875 L 13.5625 19.875 C 15.192542 21.189175 17.250023 22 19.5 22 C 24.73486 22 29 17.73486 29 12.5 C 29 7.2651394 24.73486 3 19.5 3 z M 19.5 5 C 23.65398 5 27 8.3460198 27 12.5 C 27 16.65398 23.65398 20 19.5 20 C 15.34602 20 12 16.65398 12 12.5 C 12 8.3460198 15.34602 5 19.5 5 z" />
</symbol>
<symbol id="all" viewBox="0 0 32 32">
<path style="transform: scale(0.05)" d="M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"></path>
</symbol>
<symbol id="user" viewBox="0 0 32 32">
<path style="transform: scale(0.05)" d="M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0 438.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4 86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224 288c79.5 0 144-64.5 144-144S303.5 0 224 0 80 64.5 80 144s64.5 144 144 144zm0-240c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96 43.1-96 96-96z"></path>
</symbol>
<symbol id="post" viewbox="0 0 32 32">
<path style="transform: scale(0.05)" d="M552 64H112c-20.858 0-38.643 13.377-45.248 32H24c-13.255 0-24 10.745-24 24v272c0 30.928 25.072 56 56 56h496c13.255 0 24-10.745 24-24V88c0-13.255-10.745-24-24-24zM48 392V144h16v248c0 4.411-3.589 8-8 8s-8-3.589-8-8zm480 8H111.422c.374-2.614.578-5.283.578-8V112h416v288zM172 280h136c6.627 0 12-5.373 12-12v-96c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v96c0 6.627 5.373 12 12 12zm28-80h80v40h-80v-40zm-40 140v-24c0-6.627 5.373-12 12-12h136c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H172c-6.627 0-12-5.373-12-12zm192 0v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12zm0-144v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12zm0 72v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12z"></path>
</symbol>
<symbol id="images" viewbox="0 0 32 32">
<path style="transform: scale(0.05)" d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"></path>
</symbol>
</svg>
</div>
<div class="row">
<div class="user-search">
<div class="form-group">
<label for="searchForRank">Rang</label>
<select name="searchForRank" id="searchForRank" class="form-control">
<option value="" selected>---</option>
<option value="1" <?= $search['rank'] == 1 ? 'selected' : '' ?>>Nutzer</option>
<option value="2" <?= $search['rank'] == 2 ? 'selected' : '' ?>>Premium-Nutzer</option>
<option value="3" <?= $search['rank'] == 3 ? 'selected' : '' ?>>Plus-Nutzer</option>
<option value="6" <?= $search['rank'] == 6 ? 'selected' : '' ?>>Autor</option>
<option value="7" <?= $search['rank'] == 7 ? 'selected' : '' ?>>Editor</option>
<option value="8" <?= $search['rank'] == 8 ? 'selected' : '' ?>>Moderator</option>
<option value="9" <?= $search['rank'] == 9 ? 'selected' : '' ?>>Semi-Admin</option>
<option value="10" <?= $search['rank'] == 10 ? 'selected' : '' ?>>Admin</option>
</select>
</div>
<div class="form-group">
<label for="searchForCountry">Land</label>
<div class="dropdown" id="searchForCountry" data-value="">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
---
</button>
<div class="dropdown-menu">
<a href="#" class="dropdown-item active" data-value="">---</a>
</div>
</div>
</div>
<div class="form-group">
<label for="searchForLang">Sprache</label>
<div class="dropdown" id="searchForLang" data-value="">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
---
</button>
<div class="dropdown-menu">
<a href="#" class="dropdown-item active" data-value="">---</a>
</div>
</div>
</div>
</div>
</div>
<div class="row vertical-tab-menu">
<div class="list-group w-100">
<a class="list-group-item text-center <?= $active == 'feed' ? 'active' : '' ?>" href="<?= base_url('posts/feed') ?>">
<?= lang('feed_your_feed') ?>
</a>
<a class="list-group-item text-center <?= $active == 'popular' ? 'active' : '' ?>" href="<?= base_url('posts/popular') ?>">
<?= lang('feed_popular') ?>
</a>
<a href="<?= base_url('users/top') ?>" class="list-group-item text-center">
<?= lang('feed_top_users') ?>
</a>
<a href="<?= base_url('users/trending') ?>" class="list-group-item text-center">
<?= lang('feed_trending_users') ?>
</a>
<?php if (isset($_SESSION['user']) && !empty($_SESSION['user'])): ?>
<a class="list-group-item text-center" href="<?= base_url('user/' . $_SESSION['user']['username']) ?>">
<?= lang('feed_your_profile') ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<div class="post-container">
<ul class="comment-list">
</ul>
<i class="fa fa-cog fa-spin fa-5x loading-spinner"></i>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,37 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="postReportTitle">Post melden</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span>&times;</span>
</button>
</div>
<div class="modal-body" id="postReportBody">
<form id="postReportForm">
<div class="form-group">
<label for="postReportReason">Grund für deine Meldung</label>
<select name="postReportReason" id="postReportReason" class="form-control">
<option value="">Bitte auswählen</option>
<option value="hatespeech">Hasserfüllte Inhalte</option>
<option value="racism">Rassistische, diskriminierende oder bewusst ausgrenzende Inhalte</option>
<option value="terrorism">Unterstützung von Terrorismus</option>
<option value="abuse">(Kindes-)Missbrauch</option>
<option value="violence">Gewaltverherrlichende Inhalte</option>
<option value="copyright">Verletzung meiner (Urheber-)Rechte</option>
<option value="spam">Spam oder irreführende Inhalte</option>
<option value="technical-issue">Technische Fehler</option>
</select>
</div>
<div class="form-group">
<label for="postReportText">Weitere Anmerkungen (optional)</label>
<textarea name="postReportText" id="postReportText" class="form-control"></textarea>
</div>
<button type="submit" class="btn btn-primary float-right">
Absenden
</button>
</form>
</div>
</div>

View File

@@ -0,0 +1,96 @@
<?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>

View File

@@ -0,0 +1,20 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<iframe src="<?= $origin ?>" frameborder="0" scrolling="no" style="position: absolute; width: 100%; height: 100%; top: 0; overflow: hidden; pointer-events: none; z-index: 1000;"></iframe>
<div class="modal fade postFullviewModal" tabindex="-1" role="dialog" id="userPostModal" data-username="<?= $username ?>" data-uuid="<?= $uuid ?>" data-origin="<?= $origin ?>">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center">
<i class="fas fa-3x fa-spinner fa-spin"></i>
</div>
</div>
</div>
</div>