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

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>