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,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<li class="blog-post-item">
<div class="well comment-well">
<a href="<?= base_url('blog/post/' . $post['postUrl']) ?>" target="_blank">
<div class="entry-image" style="background-image:url(<?= $post['postImage'] ?>?w=150"></div>
</a>
<div class="content">
<h3>
<a href="<?= base_url('blog/post/' . $post['postUrl']) ?>" target="_blank">
<?= $post['postTitle'] ?>
</a>
<small><?= lang('person_by') ?> <a
href="<?= base_url('user/' . $data['username']) ?>"
target="_blank"><?= $data['displayname'] ?></a>
/ <?= date("d.m.Y H:i \\U\\h\\r ", strtotime($post['postPublishDate'])) ?>
</small>
</h3>
<p class="comment"><?= $post['postDesc'] ?></p>
</div>
</div>
</li>

View File

@@ -0,0 +1,47 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
?>
<li>
<div class="well comment-well">
<div class="post-non-content">
<a href="<?= base_url('user/' . $data['username']) ?>" target="_blank">
<img src="<?= $data['profile_picture'] ?>?w=100" class="img-fluid">
</a>
</div>
<div class="content-container">
<div class="content">
<h3>
<a href="<?= base_url('user/' . $data['username']) ?>" target="_blank">
<?= $data['displayname'] ?>
</a>
<small>
<?php
$locale = isset($_SESSION['site_lang']) ? $_SESSION['site_lang'] : 'en';
$date_created = strtotime($c['date_created']);
echo DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), $locale);
?>
unter
<a href="<?= base_url('blog/post/' . $c['postUrl']) ?>">
<?= $c['postTitle'] ?>
</a>
</small>
</h3>
<p class="comment"><?= $c['comment'] ?></p>
</div>
</div>
<div class="action-btns">
<a href="#" class="action-btn" data-toggle="tooltip" data-placement="top" title="Antworten">
<i class="far fa-comment"></i>
</a>
<a href="#" class="action-btn" data-toggle="tooltip" data-placement="top" title="Gefällt mir">
<i class="far fa-heart"></i>
</a>
<a href="#" class="action-btn" data-toggle="tooltip" data-placement="top" title="Mehr Optionen">
<i class="fa fa-ellipsis-h"></i>
</a>
</div>
</div>
</li>

View File

@@ -0,0 +1,21 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->view('network/user/profile_page_header', ['active' => 'blog-posts']);
?>
<section id="profile-content" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<?php $this->load->view('network/user/user_profile_card', ['data' => $data]) ?>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<h1><?= lang('profile_all_blog_posts') ?></h1>
<div class="post-container">
<ul class="comment-list">
</ul>
<i class="fa fa-cog fa-spin fa-5x loading-spinner"></i>
</div>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,46 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<script>
var offset = 0;
var amount = 10;
var firstRun = true;
var itemsLeft = true;
var running = false;
loadEntries();
function loadEntries() {
if(!running && itemsLeft) {
$.ajax({
url: 'http://192.168.178.39/user/getBlogPosts',
data: {
user: <?= $data['ID'] ?>,
amount: amount,
offset: offset
},
beforeSend: function () {
$('.loading-spinner').show();
running = true;
},
success: function (data) {
$('.loading-spinner').hide();
$('.post-container .comment-list').append(data);
offset++;
if (data === "") {
$('.post-container').append("<p>Es konnten keine weiteren Blog-Posts gefunden werden. Bitte schaue später nochmal vorbei!</p>");
itemsLeft = false;
}
firstRun = false;
running = false;
}
});
}
}
$(window).scroll(function() {
if($(document).scrollTop() + 360 + $(window).height() >= $('.comment-list').position().top + $('.comment-list').outerHeight()) {
loadEntries();
}
});
</script>

View File

@@ -0,0 +1,20 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $this->load->view('network/user/profile_page_header', ['active' => 'blog-comments']); ?>
<section id="profile-content" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<?php $this->load->view('network/user/user_profile_card', ['data' => $data]) ?>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<h1><?= lang('profile_all_blog_comments') ?></h1>
<div class="post-container">
<ul class="comment-list">
</ul>
<i class="fa fa-cog fa-spin fa-5x loading-spinner"></i>
</div>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,46 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<script>
var offset = 0;
var amount = 10;
var firstRun = true;
var itemsLeft = true;
var running = false;
loadEntries();
function loadEntries() {
if(!running && itemsLeft) {
$.ajax({
url: 'http://192.168.178.39/user/getComments',
data: {
user: <?= $data['ID'] ?>,
amount: amount,
offset: offset
},
beforeSend: function () {
$('.loading-spinner').show();
running = true;
},
success: function (data) {
$('.loading-spinner').hide();
$('.post-container .comment-list').append(data);
offset++;
if (data === "") {
$('.post-container').append("<p>Es konnten keine weiteren Kommentare gefunden werden. Bitte schaue später nochmal vorbei!</p>");
itemsLeft = false;
}
firstRun = false;
running = false;
}
});
}
}
$(window).scroll(function() {
if($(document).scrollTop() + 360 + $(window).height() >= $('.comment-list').position().top + $('.comment-list').outerHeight()) {
loadEntries();
}
});
</script>

View File

@@ -0,0 +1,15 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<section id="profile-header" data-type="background" data-speed="2.14"></section>
<section id="profile-sub-header" data-type="foreground" data-speed="10"></section>
<section class="container" id="profile-content" style="margin:25px auto;" data-type="foreground" data-speed="10">
<div class="row">
<div class="col-sm-12" id="profile-content-container" style="height:100px">
<div class="alert alert-<?= $type ?>" role="alert">
<b><?= $message1 ?></b>
<?= $message2 ?>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,60 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<section id="login" class="container">
<div class="container" id="messages">
<?php if (isset($notice) && $notice !== '') {
echo $notice;
$notice = null;
} ?>
</div>
<section id="formHolder">
<div class="row">
<!-- Brand Box -->
<div class="col-sm-6 brand">
<div class="heading">
<h2>KingOfDog</h2>
<p>Anscheinend hast du dein Passwort vergessen - das ist vollkommen normal! Hier kannst du
jedenfalls ein neues Passwort setzen.</p>
</div>
<div class="loading-msg">
<i class="fa fa-cog fa-spin"></i>
</div>
<div class="success-msg">
<p>Herzlichen Glückwunsch! Dein Passwort wurde geändert. Du kannst dich nun einloggen</p>
<a href="<?= base_url('login') ?>" class="profile">Einloggen</a>
</div>
</div>
<div class="col-sm-6 form">
<!-- Login Form -->
<div class="login form-piece switched">
</div><!-- End Login Form -->
<!-- Signup Form -->
<div class="signup form-piece">
<form class="password-form" action="#" method="post">
<div class="form-group">
<label for="password">Neues Passwort (min. 8 Zeichen, Groß- & Kleinbuchstaben,
Sonderzeichen,
Zahlen)</label>
<input type="password" name="password" id="password" class="pass">
<span class="error"></span>
</div>
<div class="form-group">
<label for="passwordCon">Passwort wiederholen</label>
<input type="password" name="passwordCon" id="passwordCon" class="passConfirm">
<span class="error"></span>
</div>
<div class="CTA">
<input type="submit" value="Passwort ändern" id="submit">
</div>
</form>
</div><!-- End Signup Form -->
</div>
</div>
</section>
</section>

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>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $this->load->view('network/user/profile_page_header', ['active' => 'profile']) ?>
<section id="profile-content" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<?php $this->load->view('network/user/user_profile_card') ?>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<?php if (!empty($posts)): ?>
<a href="<?= base_url('user/' . $data['username'] . '/posts') ?>">
<h1 class="section-title"><?= lang('profile_posts') ?></h1>
</a>
<ul class="comment-list">
<?php foreach ($posts as $post) {
$this->load->view('network/posts/post_item', $post);
} ?>
</ul>
<a href="<?= base_url('user/' . $data['username'] . '/posts') ?>"
class="btn btn-primary round outline read-all-btn">
<?= lang('profile_view_posts') ?>
</a>
<?php endif;
if (!empty($comments)): ?>
<hr>
<a href="<?= base_url('user/' . $data['username'] . '/comments') ?>">
<h1 class="section-title"><?= lang('profile_blog_comments') ?></h1>
</a>
<ul class="comment-list">
<?php foreach ($comments as $c) {
$this->load->view('network/blog/comment_item', ['data' => $data, 'c' => $c]);
} ?>
</ul>
<a href="<?= base_url('user/' . $data['username'] . '/comments') ?>"
class="btn btn-primary round outline read-all-btn">
<?= lang('profile_view_blog_comments') ?>
</a>
<?php endif;
if (!empty($blog_posts)): ?>
<hr>
<a href="<?= base_url('user/' . $data['username'] . '/blogposts') ?>">
<h1 class="section-title"><?= lang('profile_blog_posts') ?></h1>
</a>
<ul class="comment-list">
<?php foreach ($blog_posts as $post) {
$this->load->view('network/blog/blog_post_item', ['data' => $data, 'post' => $post]);
} ?>
</ul>
<a href="<?= base_url('user/' . $data['username'] . '/blogposts') ?>"
class="btn btn-primary round outline read-all-btn">
<?= lang('profile_view_blog_posts') ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,120 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<section id="profile-header" class="container-fluid" data-type="background" data-speed="2.14"
style="background-image: url('<?= $data['header_image'] ?>?w=1920')">
</section>
<div id="scroll-trigger"></div>
<section id="profile-sub-header" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<div class="col-xs-3 col-sm-2 col-md-4 col-lg-4 profile-card profile-picture-container">
<img src="<?= $data['profile_picture'] ?>?w=300" class="img-fluid rounded-circle profile-picture">
<?php if (isset($_SESSION['user']) && $_SESSION['user']['username'] == $data['username']): ?>
<div class="avatar-upload-overlay">
<i class="fa fa-upload"></i>
</div>
<?php endif; ?>
</div>
<div class="col-xs-9 col-sm-10 col-md-8 col-lg-8">
<div class="row">
<div class="profile-stats">
<div class="item <?= isset($active) && $active == 'profile' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username']) ?>">
<span class="label"><?= lang('profile_contributions') ?></span>
<span class="count"
data-count="<?= $stats['postCount'] + $stats['blogCount'] + $stats['commentCount'] ?>"><?= $stats['postCount'] + $stats['blogCount'] + $stats['commentCount'] ?></span>
</a>
</div>
<div class="item <?= isset($active) && $active == 'posts' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username'] . '/posts') ?>">
<span class="label"><?= lang('profile_posts') ?></span>
<span class="count"
data-count="<?= $stats['postCount'] ?>"><?= $stats['postCount'] ?></span>
</a>
</div>
<div class="item <?= isset($active) && $active == 'blog-posts' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username'] . '/blogposts') ?>">
<span class="label"><?= lang('profile_blog_posts') ?></span>
<span class="count"
data-count="<?= $stats['blogCount'] ?>"><?= $stats['blogCount'] ?></span>
</a>
</div>
<div class="item <?= isset($active) && $active == 'blog-comments' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username'] . '/comments') ?>">
<span class="label"><?= lang('profile_blog_comments') ?></span>
<span class="count"
data-count="<?= $stats['commentCount'] ?>"><?= $stats['commentCount'] ?></span>
</a>
</div>
<div class="item <?= isset($active) && $active == 'followers' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username'] . '/followers') ?>">
<span class="label"><?= lang('profile_followers') ?></span>
<span class="count"
data-count="<?= $stats['followerCount'] ?>"><?= $stats['followerCount'] ?></span>
</a>
</div>
<div class="item <?= isset($active) && $active == 'following' ? 'active' : '' ?>">
<a href="<?= base_url('user/' . $data['username'] . '/following') ?>">
<span class="label"><?= lang('profile_followed_users') ?></span>
<span class="count"
data-count="<?= $stats['followedCount'] ?>"><?= $stats['followedCount'] ?></span>
</a>
</div>
<?php if (isset($_SESSION['user']) && $_SESSION['user']['username'] == $data['username']): ?>
<a class="btn btn-default btn-sm edit-profile"
href="<?= base_url('user/' . $data['username'] . '/edit') ?>"><?= lang('profile_edit') ?></a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="mustBeLoggedInModal" tabindex="-1" role="dialog" aria-labelledby="mustBeLoggedInModalLabel">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="mustBeLoggedInModalLabel">Du musst eingeloggt sein!</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p class="text-danger"><b>Du musst in einen Account eingeloggt sein, um Nutzern folgen zu können!</b>
</p>
<p>Solltest du noch keinen Account besitzen, kannst du kostenlos einen erstellen. Es dauert nicht
lange!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?= lang('close') ?></button>
<a type="button" class="btn btn-primary"
href="<?= base_url('login?r=' . base64_encode(base_url(uri_string()))) ?>"><?= lang('login') ?></a>
</div>
</div>
</div>
</div>
<div class="modal fade" id="cantFollowYourself" tabindex="-1" role="dialog" aria-labelledby="cantFollowYourselfLabel">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="cantFollowYourselfLabel">Du kannst nicht dir selbst folgen!</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p class="text-danger"><b>Aus Gründen der physikalischen Gesetze ist es leider nicht möglich, dass du
dir selbst folgst - geschweige denn, dass du dich selbst <i>ver</i>folgst.</b></p>
<p>Daher können wir es dir leider auch auf dieser Webseite nicht gewähren, dir selbst zu folgen! Außer,
du hast zufälligerweise ein Wurmloch entdeckt, oder, du weißt wie man durch die Zeit reisen kann.
Dann würden wir diese Entscheidung eventuell überdenken.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Schließen</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->view('network/user/profile_page_header', ['active' => $active]);
?>
<section id="profile-content" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<?php $this->load->view('network/user/user_profile_card', ['data' => $data]) ?>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<h1><?= $active == 'followers' ? lang('profile_all_followers') : lang('profile_all_followed') ?></h1>
<ul class="followers-list">
<?php foreach ($followers as $follower) {
$this->load->view('network/user/user_followers_item', ['data' => $follower]);
} ?>
</ul>
</div>
</div>
</div>s
</section>

View File

@@ -0,0 +1,18 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
$dateFollowing = strtotime($data['followedSince']);
?>
<li>
<a href="<?= base_url('user/' . $data['username']) ?>">
<div style="background-image: url(<?= $data['header_image'] ?>)" class="header-image"></div>
<img src="<?= $data['profile_picture'] ?>" alt="" class="img-fluid rounded-circle profile-picture">
<div class="user-card-content">
<h3><?= $data['displayname'] ?></h3>
<small><?= $data['followerCount'] ?> Follower | folgt
seit <?= str_replace(['vor ', ' ago', 'il y a'], ['', '', ''], DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateFollowing"), $_SESSION['site_lang'])) ?></small>
</div>
</a>
</li>

View File

@@ -0,0 +1,25 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php if (!isset($noContainer) || !$noContainer): ?>
<div class="col-xs-12 col-md-4">
<?php endif; ?>
<div class="card">
<a href="<?= base_url('user/' . $username) ?>">
<img src="<?= $header_image ?>?w=350" class="card-img-top" alt="Header Image">
</a>
<a href="<?= base_url('user/' . $username) ?>">
<img src="<?= $profile_picture ?>?w=100" class="img-fluid rounded-circle card-profile-picture" alt="Profile Picture">
</a>
<div class="card-body">
<a href="<?= base_url('user/' . $username) ?>">
<h5 class="card-title"><?= $displayname ?></h5>
</a>
<a href="<?= base_url('user/' . $username) ?>">
<small class="card-text"><?= $about ?></small>
</a>
</div>
</div>
<?php if (!isset($noContainer) || !$noContainer): ?>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->view('network/user/profile_page_header', ['active' => 'posts']); ?>
<section id="profile-content" data-type="foreground" data-speed="10">
<div class="container">
<div class="row">
<?php $this->load->view('network/user/user_profile_card') ?>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" id="profile-content-container">
<h1><?= lang('profile_all_posts') ?></h1>
<div class="post-container">
<ul class="comment-list">
</ul>
<i class="fa fa-cog fa-spin fa-5x loading-spinner"></i>
</div>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,48 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<script>
var offset = 0;
var amount = 10;
var firstRun = true;
var itemsLeft = true;
var running = false;
loadEntries();
function loadEntries() {
if(!running && itemsLeft) {
$.ajax({
url: 'http://192.168.178.39/user/getPosts',
data: {
user: <?= $data['ID'] ?>,
amount: amount,
offset: offset
},
beforeSend: function () {
$('.loading-spinner').show();
running = true;
},
success: function (data) {
console.log(data);
$('.loading-spinner').hide();
$('.post-container .comment-list').append(data);
offset++;
if (data === "") {
$('.post-container').append("<p>Es konnten keine weiteren Posts gefunden werden. Bitte schaue später nochmal vorbei!</p>");
itemsLeft = false;
}
firstRun = false;
running = false;
registerPostEvents();
}
});
}
}
$(window).scroll(function() {
if($(document).scrollTop() + 360 + $(window).height() >= $('.comment-list').position().top + $('.comment-list').outerHeight()) {
loadEntries();
}
});
</script>

View File

@@ -0,0 +1,89 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 profile-card">
<a href="<?= base_url('user/' . $data['username']) ?>">
<h1 class="profile-displayname"><?= $data['displayname'] ?></h1>
</a>
<a href="<?= base_url('user/' . $data['username']) ?>">
<h2 class="profile-username">@<?= $data['username'] ?></h2>
</a>
<br>
<a class="subscribe-button <?= isset($_SESSION['user']) && $_SESSION['user']['ID'] == $data['ID'] ? 'disabled' : '' ?> <?= $isCurrentUserFollowing ? 'subbed' : '' ?>"
data-count="<?= $stats['followerCount'] ?>">
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<rect class="plus__line1" width="2" height="12" x="5" y="0"></rect>
<rect class="plus__line2" width="12" height="2" x="0" y="5"></rect>
</g>
</svg>
<span class="subscribe-text" data-follow="<?= lang('profile_follow') ?>" data-following="<?= lang('profile_following') ?>" data-unfollow="<?= lang('profile_unfollow') ?>"></span>
</a>
<p class="profile-biography"><?= $data['about'] ?></p>
<ul class="info-list">
<?php if (isset($data['country']) && $data['country'] != null): ?>
<li>
<a href="<?= base_url('posts/search?q=&type=type-users&country=' . $data['country']) ?>" data-toggle="tooltip" data-placement="left" title="<?= lang('profile_country') ?>">
<i class="fa fa-map-marker-alt"></i>
<?= lang('country_' . $data['country']) ?>
<span class="flag-icon squared rounded flag-icon-<?= strtolower($data['country']) ?>"></span>
<?php endif;
if (isset($data['language']) && $data['language'] != null): ?>
<li>
<a href="<?= base_url('posts/search?q=&type=type-users&lang=' . $data['language']) ?>" data-toggle="tooltip" data-placement="left" title="<?= lang('profile_language') ?>">
<i class="fa fa-language"></i>
<?= lang('lang_' . strtolower($data['language'])) ?>
<span class="flag-icon squared rounded flag-icon-<?= strtolower($data['language']) ?>"></span>
</a>
</li>
<?php endif;
if (isset($data['gender']) && $data['gender'] != null): ?>
<li>
<span data-toggle="tooltip" data-placement="left" title="<?= lang('profile_gender') ?>">
<?php if ($data['gender'] == 'male'): ?>
<i class="fa fa-mars"></i> <?= lang('profile_gender_male') ?>
<?php elseif ($data['gender'] == 'female'): ?>
<i class="fa fa-venus"></i> <?= lang('profile_gender_female') ?>
<?php else: ?>
<i class="fa fa-transgender"></i> <?= lang('profile_gender_other') ?>
<?php endif; ?>
</span>
</li>
<?php endif; ?>
<li>
<a href="<?= base_url('posts/search?q=&type=type-users&rank=' . $data['rank']) ?>" data-toggle="tooltip" data-placement="left" title="<?= lang('profile_user_rank') ?>">
<i class="fa fa-sitemap"></i> <?= lang('profile_rank') ?>: <?= $this->GeneralModel->getRankName($data['rank']) ?>
</a>
</li>
<li>
<span data-toggle="tooltip" data-placement="left" title="<?= lang('profile_account_age') ?>">
<i class="far fa-calendar"></i> <?= sprintf(lang('profile_account_created'), $data['time_existing']) ?>
</span>
</li>
<?php if (isset($data['birthdate']) && $data['birthdate'] != null): ?>
<li>
<span data-toggle="tooltip" data-placement="left" title="<?= lang('profile_birth_date') ?>">
<i class="fa fa-birthday-cake"></i>
<?= lang('profile_born') ?> <?= $data['birthdate'] ?> <?php if (isset($data['birthyear'])) {
echo $data['birthyear'];
} ?>
</span>
</li>
<?php endif; ?>
</ul>
<?php if (isset($data['social_networks']) && $data['social_networks'] != NULL):
$networks = explode('@', $data['social_networks']); ?>
<ul class="info-list">
<?php foreach ($networks as $network):
$networkData = explode('-', $network); ?>
<li>
<a href="<?= $networkData[2] ?>" target="_BLANK">
<i class="fab fa-<?= strtolower($networkData[0]) ?>"></i>
<?= $networkData[1] ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>