Small changes
This commit is contained in:
@@ -53,4 +53,11 @@
|
||||
$lang['feed_search_posts'] = 'Posts';
|
||||
$lang['feed_search_media'] = 'Medien';
|
||||
|
||||
$lang['post_reply_to'] = 'als Antwort an';
|
||||
$lang['post_reply'] = 'Antworten';
|
||||
$lang['post_no_replies'] = 'Es gibt zu diesem Post keine Antworten. Wie wär\'s, wenn du der Erste bist, eine zu verfassen?';
|
||||
$lang['post_like'] = 'Gefällt mir';
|
||||
$lang['post_like_account_missing'] = 'Du musst eingeloggt sein, um Posts zu bewerten. <a href="' . base_url('login') . '" class="alert-link">Erstelle dir kostenlos einen Account oder melde dich an.</a>';
|
||||
$lang['post_copy_link'] = 'Link zum Post kopieren';
|
||||
$lang['post_report'] = 'Post melden';
|
||||
$lang['post_delete'] = 'Post löschen';
|
||||
|
@@ -52,3 +52,12 @@
|
||||
$lang['feed_search_user'] = 'Users';
|
||||
$lang['feed_search_posts'] = 'Posts';
|
||||
$lang['feed_search_media'] = 'Media';
|
||||
|
||||
$lang['post_reply_to'] = 'as a reply to';
|
||||
$lang['post_reply'] = 'Reply';
|
||||
$lang['post_no_replies'] = 'There are no replies to this post currently. How about you\'re becoming the first one to write a reply?';
|
||||
$lang['post_like'] = 'Like';
|
||||
$lang['post_like_account_missing'] = 'You have to be logged in to like posts. <a href="' . base_url('login') . '" class="alert-link">Create a new account for free now or sign in with an existing profile.</a>';
|
||||
$lang['post_copy_link'] = 'Copy Post Link';
|
||||
$lang['post_report'] = 'Report Post';
|
||||
$lang['post_delete'] = 'Delete Post';
|
||||
|
@@ -1,62 +1,68 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
||||
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
||||
|
||||
class GeneralModel extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
class GeneralModel extends CI_Model
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('BlogModel', '', TRUE);
|
||||
$this->load->model('NotificationModel', '', TRUE);
|
||||
}
|
||||
|
||||
function getBlogPosts($count)
|
||||
{
|
||||
$posts = $this->BlogModel->getMostRecentPosts($count);
|
||||
|
||||
$return = '';
|
||||
foreach($posts as $result) {
|
||||
$date = strtotime($result['postPublishDate']);
|
||||
$return .= '<div class="media">
|
||||
<div class="pull-left">
|
||||
<img src="' . $result['postImage'] . '?w=100" style="max-width:100px" class="img-fluid">
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<span class="media-heading"><a href="#">' . $result['postTitle'] . '</a></span>
|
||||
<small class="muted">' . lang('footer_published') . ' ' . DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date"), $_SESSION['site_lang']) . '</small>
|
||||
</div>
|
||||
</div>';
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('BlogModel', '', TRUE);
|
||||
$this->load->model('NotificationModel', '', TRUE);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function addFeedbackAnonymously($pageUrl, $message) {
|
||||
$this->addFeedback($pageUrl, $message, true, NULL, NULL);
|
||||
}
|
||||
function getBlogPosts($count)
|
||||
{
|
||||
$posts = $this->BlogModel->getMostRecentPosts($count);
|
||||
|
||||
function addFeedback($pageUrl, $message, $anonymous, $userID, $email) {
|
||||
$this->db->query('INSERT INTO feedback (page, message, anonymous, userID, email) VALUES (?, ?, ?, ?, ?)', [$pageUrl, $message, $anonymous, $userID, $email]);
|
||||
$this->db->cache_delete('admin', 'feedback');
|
||||
$return = '';
|
||||
foreach ($posts as $result) {
|
||||
$date = strtotime($result['postPublishDate']);
|
||||
$return .= '<div class="media">';
|
||||
|
||||
// Send notifications
|
||||
$this->NotificationModel->rankNotificationNewFeedback($userID != NULL ? $userID : -1, 9, $pageUrl);
|
||||
}
|
||||
if ($result['postImage'] != '') {
|
||||
$return .= '<img src="' . $result['postImage'] . '?w=100" style="width:75px" class="img-fluid mr-3">';
|
||||
}
|
||||
|
||||
function getRankName($rankID) {
|
||||
$ranks = [
|
||||
0 => "Nutzer",
|
||||
1 => "Registrierter Nutzer",
|
||||
2 => "Premium-Nutzer",
|
||||
3 => "Plus-Nutzer",
|
||||
6 => "Autor (Blog)",
|
||||
7 => "Editor (Blog)",
|
||||
8 => "Moderator",
|
||||
9 => "Admin",
|
||||
10 => "Admin"
|
||||
];
|
||||
return isset($ranks[$rankID]) ? $ranks[$rankID] : "Nutzer";
|
||||
}
|
||||
$return .= '<div class="media-body">
|
||||
<h6 class="my-0"><a href="#">' . $result['postTitle'] . '</a></h6>
|
||||
<small class="text-white-50">' . lang('footer_published') . ' ' . DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date"), $_SESSION['site_lang']) . '</small>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
}
|
||||
function addFeedbackAnonymously($pageUrl, $message)
|
||||
{
|
||||
$this->addFeedback($pageUrl, $message, true, NULL, NULL);
|
||||
}
|
||||
|
||||
function addFeedback($pageUrl, $message, $anonymous, $userID, $email)
|
||||
{
|
||||
$this->db->query('INSERT INTO feedback (page, message, anonymous, userID, email) VALUES (?, ?, ?, ?, ?)', [$pageUrl, $message, $anonymous, $userID, $email]);
|
||||
$this->db->cache_delete('admin', 'feedback');
|
||||
|
||||
// Send notifications
|
||||
$this->NotificationModel->rankNotificationNewFeedback($userID != NULL ? $userID : -1, 9, $pageUrl);
|
||||
}
|
||||
|
||||
function getRankName($rankID)
|
||||
{
|
||||
$ranks = [
|
||||
0 => "Nutzer",
|
||||
1 => "Registrierter Nutzer",
|
||||
2 => "Premium-Nutzer",
|
||||
3 => "Plus-Nutzer",
|
||||
6 => "Autor (Blog)",
|
||||
7 => "Editor (Blog)",
|
||||
8 => "Moderator",
|
||||
9 => "Admin",
|
||||
10 => "Admin"
|
||||
];
|
||||
return isset($ranks[$rankID]) ? $ranks[$rankID] : "Nutzer";
|
||||
}
|
||||
|
||||
}
|
@@ -23,7 +23,7 @@
|
||||
<?php if ($reply_to != NULL): ?>
|
||||
<small>
|
||||
<i class="fa fa-reply"></i>
|
||||
als Antwort an
|
||||
<?= lang('post_reply_to') ?>
|
||||
<a href="#" onclick="showFullPost('<?= $replyToPost['uuid'] ?>', '<?= $replyToPost['username'] ?>')">@<?= $replyToPost['displayname'] ?></a>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
@@ -45,11 +45,11 @@
|
||||
</div>
|
||||
<?php if (!isset($hideActionBtns) || !$hideActionBtns): ?>
|
||||
<div class="action-btns">
|
||||
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="Antworten">
|
||||
<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>
|
||||
</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">
|
||||
<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>
|
||||
@@ -61,17 +61,17 @@
|
||||
<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
|
||||
<?= lang('post_copy_link') ?>
|
||||
</a>
|
||||
<a href="#" onclick="openPostReportModal('<?= $uuid ?>')" class="dropdown-item">
|
||||
<i class="fa fa-flag"></i>
|
||||
Post melden
|
||||
<?= 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>
|
||||
Post löschen
|
||||
<?= lang('post_delete') ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
@@ -97,7 +97,7 @@
|
||||
<?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?
|
||||
<?= lang('post_no_replies') ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user