Archived
1
0

Various changes including contact messages in database, contact message notifications, notification emails, bugfixes and more

This commit is contained in:
Marcel 2018-11-02 16:23:16 +01:00
parent 5faffbf9fa
commit 72f3434803
17 changed files with 713 additions and 43 deletions

View File

@ -19,29 +19,7 @@
public function index()
{
// TODO: Add twitch, instagram and 500px as further services
// TODO: Receive posts async
// $this->SocialMediaModel->getTwitterPosts();
// $this->SocialMediaModel->getYouTubeVideos();
// $this->load->library('email');
// $config['protocol'] = 'sendmail';
// $config['mailpath'] = '/sendmail';
// $config['charset'] = 'iso-8859-1';
// $config['wordwrap'] = TRUE;
//
// $this->email->initialize($config);
//
// $this->email->from('info@kingofdog.eu', 'KingOfDog.de');
// $this->email->to('struckatmarcel@gmail.com');
//
// $this->email->subject('Email Test');
// $this->email->message('Testing the email class.');
//
// $this->email->send();
// ini_set('SMTP', 'smtp.gmail.com');
// ini_set('smtp_port', '465');
//
$video = $this->YoutubePlayerModel->newestVids(1)[0];
$currentlyActiveUsers = $this->UserModel->getActiveUsers(5);
@ -100,6 +78,11 @@
$email = $this->UserModel->getUser($_SESSION['user']['username'])[0]['email'];
if (preg_match("/[A-Za-z._]+@[A-Za-z._]+\.[A-Za-z._]+/", $email)) {
// TODO: Send contact mail
$userID = isset($_SESSION['user']) ? $_SESSION['user']['ID'] : null;
$this->GeneralModel->addContactMessage($email, $userID, $message);
$notice['type'] = true;
$notice['message'] = "Deine Nachricht wurde versendet!";
} else {

View File

@ -16,8 +16,8 @@ class Twitch extends MY_Controller {
// $data =
$result = $this->load->view('twitch_result', ['json' => $this->TwitchModel->getTwitchInfos($channel), 'stream' => $this->TwitchModel->getTwitchStream($channel), 'videos' => $this->TwitchModel->getTwitchVideos($channel)], true);
$this->load->view('twitch', ['result' => $result]);
$result = $this->load->view('tools/twitch_result', ['json' => $this->TwitchModel->getTwitchInfos($channel), 'stream' => $this->TwitchModel->getTwitchStream($channel), 'videos' => $this->TwitchModel->getTwitchVideos($channel)], true);
$this->load->view('tools/twitch', ['result' => $result]);
$this->load->view('footer');
}

View File

@ -22,3 +22,6 @@
$lang['admin.feedback.multiple'] = '%1$s haben ein neues Feedback verfasst.';
$lang['admin.feedback.many'] = '%1$s andere haben ein neues Feedback verfasst.';
$lang['admin.contactMessage.single'] = '%1$s hat eine neue Kontakt-Nachricht verfasst: "%2$s"';
$lang['admin.contactMessage.multiple'] = '%1$s haben neue Kontakt-Nachrichten verfasst.';
$lang['admin.contactMessage.many'] = '%1$s andere haben eine neue Kontakt-Nachricht verfasst.';

View File

@ -49,6 +49,14 @@
$this->NotificationModel->rankNotificationNewFeedback($userID != NULL ? $userID : -1, 9, $pageUrl);
}
function addContactMessage($email, $userID, $message) {
$this->db->query('INSERT INTO contact_messages (userID, userEmail, message) VALUES (?, ?, ?)', [$userID, $email, $message]);
$this->db->cache_delete('admin', 'contact');
// Send notifications
$this->NotificationModel->rankNotificationContactMessage($userID != NULL ? $userID : -1, 8, substr($message, 0, 30));
}
function getRankName($rankID)
{
$ranks = [

View File

@ -10,6 +10,7 @@
require_once 'notifications/PostReportNotification.php';
require_once 'notifications/NotificationUser.php';
require_once 'notifications/NewFeedbackNotification.php';
require_once 'notifications/ContactMessageNotification.php';
class NotificationModel extends CI_Model
{
@ -20,6 +21,7 @@
$_SESSION['site_lang'] = $lang;
$this->lang->load('notification', 'de');
$this->lang->load('notification', $_SESSION['site_lang']);
$this->load->model('EmailModel', '', TRUE);
}
public function getUserNotificationsRaw($userID, $limit = 20, $offset = 0)
@ -78,6 +80,13 @@
]);
}
$this->db->cache_delete('Main', 'getNotifications');
// Send email
$email = $this->UserModel->getUserEmailByID($notification->sender->getId());
$group = new NotificationGroup([$notification], 1);
$messageData = $group->message();
$message = sprintf(lang($messageData['line']), ...$messageData['attributes']);
$this->EmailModel->sendMail($email, sprintf('Neue Benachrichtigung auf KingOfDog.eu: "%1$s"', $message), 'notification', ['group' => $group, 'message' => $message]);
}
public function markAsRead(array $notifications) {
@ -117,6 +126,9 @@
case 'admin.reportedPost':
$items[] = new \Notification\Users\PostReportNotification($item);
break;
case 'admin.contactMessage':
$items[] = new \Notification\Admin\ContactMessageNotification($item);
break;
}
}
$groups[] = new NotificationGroup($items, $group['count']);
@ -171,7 +183,7 @@
}
public function rankNotificationNewUserRegistered($senderID, $rankRecipientID) {
$rankUsers = $this->db->query('SELECT ID FROM users WHERE rank >= ?', [$rankRecipientID])->result_array();
$rankUsers = $this->getRankUsers($rankRecipientID);
foreach ($rankUsers as $user) {
$notification = new \Notification\Admin\UserRegisteredNotification([
'senderID' => $senderID,
@ -183,7 +195,7 @@
}
public function rankNotificationNewFeedback($senderID, $rankRecipientID, $pageName) {
$rankUsers = $this->db->query('SELECT ID FROM users WHERE rank >= ?', [$rankRecipientID])->result_array();
$rankUsers = $this->getRankUsers($rankRecipientID);
foreach ($rankUsers as $user) {
$notification = new \Notification\Admin\NewFeedbackNotification([
'senderID' => $senderID,
@ -194,8 +206,21 @@
}
}
public function rankNotificationContactMessage($senderID, $rankRecipientID, $message) {
$rankUsers = $this->getRankUsers($rankRecipientID);
foreach ($rankUsers as $user) {
$notification = new \Notification\Admin\ContactMessageNotification([
'senderID' => $senderID,
'recipientID' => $user['ID'],
'referenceID' => $senderID,
'parameters' => $message
]);
$this->add($notification);
}
}
public function rankNotificationPostReport($senderID, $rankRecipientID, $postID, $postUUID) {
$rankUsers = $this->db->query('SELECT ID FROM users WHERE rank >= ?', [$rankRecipientID])->result_array();
$rankUsers = $this->getRankUsers($rankRecipientID);
foreach ($rankUsers as $user) {
$notification = new \Notification\Users\PostReportNotification([
'senderID' => $senderID,
@ -207,6 +232,10 @@
}
}
private function getRankUsers($rankID) {
return $this->db->query('SELECT ID FROM users WHERE rank >= ?', [$rankID])->result_array();
}
}

View File

@ -26,7 +26,7 @@
{
for ($i = 0; $i < sizeof($userList); $i++) {
if ((isset($userList[$i]['header_image']) && ($userList[$i]['header_image'] == '' || $userList[$i]['header_image'] == NULL)) || !isset($userList[$i]['header_image'])) {
$userList[$i]['header_image'] = substr(base_url(), 0, base_url() - 1) . ':3000/' . $userList[$i]['displayname'];
$userList[$i]['header_image'] = substr(base_url(), 0, base_url() - 1) . ':5000/' . $userList[$i]['displayname'];
}
if (isset($userList[$i]['profile_picture']) && $userList[$i]['profile_picture'] == '') {
$userList[$i]['profile_picture'] = base_url('/f/8d204712d8132b36d765640ce775ce15');
@ -82,6 +82,11 @@
return $result;
}
function getUserEmailByID($id) {
$result = $this->db->query('SELECT email FROM users WHERE ID = ? AND is_activated = TRUE', [$id])->result_array();
return !empty($result) ? $result[0]['email'] : '';
}
public function getFollowing($id)
{
$this->db->cache_off();

View File

@ -0,0 +1,46 @@
<?php
namespace Notification\Admin;
use Notification;
require_once 'Notification.php';
class ContactMessageNotification extends \Notification
{
public function __construct(array $data)
{
$data['type'] = 'admin.contactMessage';
parent::__construct($data);
}
public function getNotificationLink()
{
return '/admin/contact';
}
public function getNotificationImage()
{
return $this->sender->getProfilePicture();
}
public function messageForNotification(Notification $notification)
{
return ['line' => 'admin.contactMessage.single', 'attributes' => [$this->sender->getName(), $notification->parameters]];
}
public function messageForNotifications(array $notifications, $realCount = 0)
{
if ($realCount === 0) {
$realCount = count($notifications);
}
if ($realCount < 5) {
$names = $this->manyNames($notifications);
return ['line' => 'admin.contactMessage.multiple', 'attributes' => [$names]];
} else {
$names = $this->manyNamesCutoff($notifications, $realCount);
return ['line' => 'admin.contactMessage.many', 'attributes' => [$names]];
}
}
}

View File

@ -23,6 +23,13 @@
public function __get($attribute)
{
if($attribute == 'unread') {
foreach ($this->notifications as $notification) {
if($notification->unread)
return TRUE;
}
RETURN FALSE;
}
return !empty($this->notifications) ? $this->notifications[0]->{$attribute} : null;
}

View File

@ -0,0 +1,579 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG />
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Bitter" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<!--<![endif]-->
<style type="text/css" id="media-query">
body {
margin: 0;
padding: 0;
}
table, tr, td {
vertical-align: top;
border-collapse: collapse;
}
.ie-browser table, .mso-container table {
table-layout: fixed;
}
* {
line-height: inherit;
}
a[x-apple-data-detectors=true] {
color: inherit !important;
text-decoration: none !important;
}
[owa] .img-container div, [owa] .img-container button {
display: block !important;
}
[owa] .fullwidth button {
width: 100% !important;
}
[owa] .block-grid .col {
display: table-cell;
float: none !important;
vertical-align: top;
}
.ie-browser .num12, .ie-browser .block-grid, [owa] .num12, [owa] .block-grid {
width: 605px !important;
}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
line-height: 100%;
}
.ie-browser .mixed-two-up .num4, [owa] .mixed-two-up .num4 {
width: 200px !important;
}
.ie-browser .mixed-two-up .num8, [owa] .mixed-two-up .num8 {
width: 400px !important;
}
.ie-browser .block-grid.two-up .col, [owa] .block-grid.two-up .col {
width: 302px !important;
}
.ie-browser .block-grid.three-up .col, [owa] .block-grid.three-up .col {
width: 201px !important;
}
.ie-browser .block-grid.four-up .col, [owa] .block-grid.four-up .col {
width: 151px !important;
}
.ie-browser .block-grid.five-up .col, [owa] .block-grid.five-up .col {
width: 121px !important;
}
.ie-browser .block-grid.six-up .col, [owa] .block-grid.six-up .col {
width: 100px !important;
}
.ie-browser .block-grid.seven-up .col, [owa] .block-grid.seven-up .col {
width: 86px !important;
}
.ie-browser .block-grid.eight-up .col, [owa] .block-grid.eight-up .col {
width: 75px !important;
}
.ie-browser .block-grid.nine-up .col, [owa] .block-grid.nine-up .col {
width: 67px !important;
}
.ie-browser .block-grid.ten-up .col, [owa] .block-grid.ten-up .col {
width: 60px !important;
}
.ie-browser .block-grid.eleven-up .col, [owa] .block-grid.eleven-up .col {
width: 55px !important;
}
.ie-browser .block-grid.twelve-up .col, [owa] .block-grid.twelve-up .col {
width: 50px !important;
}
@media only screen and (min-width: 625px) {
.block-grid {
width: 605px !important;
}
.block-grid .col {
vertical-align: top;
}
.block-grid .col.num12 {
width: 605px !important;
}
.block-grid.mixed-two-up .col.num4 {
width: 200px !important;
}
.block-grid.mixed-two-up .col.num8 {
width: 400px !important;
}
.block-grid.two-up .col {
width: 302px !important;
}
.block-grid.three-up .col {
width: 201px !important;
}
.block-grid.four-up .col {
width: 151px !important;
}
.block-grid.five-up .col {
width: 121px !important;
}
.block-grid.six-up .col {
width: 100px !important;
}
.block-grid.seven-up .col {
width: 86px !important;
}
.block-grid.eight-up .col {
width: 75px !important;
}
.block-grid.nine-up .col {
width: 67px !important;
}
.block-grid.ten-up .col {
width: 60px !important;
}
.block-grid.eleven-up .col {
width: 55px !important;
}
.block-grid.twelve-up .col {
width: 50px !important;
}
}
@media (max-width: 625px) {
.block-grid, .col {
min-width: 320px !important;
max-width: 100% !important;
display: block !important;
}
.block-grid {
width: calc(100% - 40px) !important;
}
.col {
width: 100% !important;
}
.col > div {
margin: 0 auto;
}
img.fullwidth, img.fullwidthOnMobile {
max-width: 100% !important;
}
.no-stack .col {
min-width: 0 !important;
display: table-cell !important;
}
.no-stack.two-up .col {
width: 50% !important;
}
.no-stack.mixed-two-up .col.num4 {
width: 33% !important;
}
.no-stack.mixed-two-up .col.num8 {
width: 66% !important;
}
.no-stack.three-up .col.num4 {
width: 33% !important;
}
.no-stack.four-up .col.num3 {
width: 25% !important;
}
.mobile_hide {
min-height: 0px;
max-height: 0px;
max-width: 0px;
display: none;
overflow: hidden;
font-size: 0px;
}
}
</style>
</head>
<body class="clean-body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #FFFFFF">
<style type="text/css" id="media-query-bodytag">
@media (max-width: 520px) {
.block-grid {
min-width: 320px !important;
max-width: 100% !important;
width: 100% !important;
display: block !important;
}
.col {
min-width: 320px !important;
max-width: 100% !important;
width: 100% !important;
display: block !important;
}
.col > div {
margin: 0 auto;
}
img.fullwidth {
max-width: 100% !important;
}
img.fullwidthOnMobile {
max-width: 100% !important;
}
.no-stack .col {
min-width: 0 !important;
display: table-cell !important;
}
.no-stack.two-up .col {
width: 50% !important;
}
.no-stack.mixed-two-up .col.num4 {
width: 33% !important;
}
.no-stack.mixed-two-up .col.num8 {
width: 66% !important;
}
.no-stack.three-up .col.num4 {
width: 33% !important;
}
.no-stack.four-up .col.num3 {
width: 25% !important;
}
.mobile_hide {
min-height: 0px !important;
max-height: 0px !important;
max-width: 0px !important;
display: none !important;
overflow: hidden !important;
font-size: 0px !important;
}
}
</style>
<!--[if IE]>
<div class="ie-browser"><![endif]-->
<!--[if mso]>
<div class="mso-container"><![endif]-->
<table class="nl-container" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #FFFFFF;width: 100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" style="background-color: #FFFFFF;"><![endif]-->
<div style="background-color:#2272ff;">
<div style="Margin: 0 auto;min-width: 320px;max-width: 605px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;" class="block-grid ">
<div style="border-collapse: collapse;display: table;width: 100%;background-color:transparent;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="background-color:#2272ff;" align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width: 605px;">
<tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="605" style=" width:605px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top">
<![endif]-->
<div class="col num12" style="min-width: 320px;max-width: 605px;display: table-cell;vertical-align: top;">
<div style="background-color: transparent; width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;">
<!--<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="divider " style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 100%;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td class="divider_inner" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;padding-right: 20px;padding-left: 20px;padding-top: 20px;padding-bottom: 20px;min-width: 100%;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<table class="divider_content" height="200px" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 0px solid transparent;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 200px;line-height: 200px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<span>&#160;</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div align="center" class="img-container center fixedwidth " style="padding-right: 20px; padding-left: 20px;">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr style="line-height:0px;line-height:0px;">
<td style="padding-right: 20px; padding-left: 20px;" align="center"><![endif]-->
<div style="line-height:20px;font-size:1px">&#160;</div>
<a href="https://kingofdog.eu" target="_blank">
<img class="center fixedwidth" align="center" border="0" src="https://kingofdog.eu/assets/images/logo_white.png" alt="KingOfDog Logo" title="KingOfDog Logo" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;width: 100%;max-width: 302.5px" width="302.5">
</a>
<div style="line-height:20px;font-size:1px">&#160;</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<div class="">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top: 20px; padding-bottom: 10px;"><![endif]-->
<div style="color:#FFFFFF;font-family:'Bitter', Georgia, Times, 'Times New Roman', serif;line-height:120%; padding-right: 10px; padding-left: 10px; padding-top: 20px; padding-bottom: 10px;">
<div style="font-size:12px;line-height:14px;font-family:Bitter, Georgia, Times, 'Times New Roman', serif;color:#FFFFFF;text-align:left;">
<p style="margin: 0;font-size: 14px;line-height: 17px;text-align: center">
<span style="font-size: 28px; line-height: 33px;">Du hast eine neue Benachrichtigung auf KingOfDog.eu!<br></span>
</p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<div class="">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><![endif]-->
<div style="color:#fff;line-height:200%;font-family:'Open Sans', Helvetica, Arial, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
<div style="font-size:12px;line-height:24px;text-align:center;color:#fff;font-family:'Open Sans', Helvetica, Arial, sans-serif;">
<div style="margin: 0;font-size: 12px;line-height: 24px;text-align: center">
<blockquote style="font-size: 16px; line-height: 32px; border-left: 5px solid grey; font-style: italic;">
<?= $message ?>
</blockquote>
</div>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<div align="center" class="button-container center " style="padding-right: 10px; padding-left: 10px; padding-top:10px; padding-bottom:10px;">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top:10px; padding-bottom:10px;" align="center">
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:31pt; v-text-anchor:middle; width:111pt;" arcsize="58%" strokecolor="#134C75" fillcolor="#134C75">
<w:anchorlock />
<v:textbox inset="0,0,0,0">
<center style="color:#ffffff; font-family:'Open Sans', Helvetica, Arial, sans-serif; font-size:16px;"><![endif]-->
<div style="color: #ffffff; background-color: #134C75; border-radius: 24px; -webkit-border-radius: 24px; -moz-border-radius: 24px; max-width: 148px; width: 88px;width: auto; border-top: 0px solid transparent; border-right: 0px solid transparent; border-bottom: 0px solid transparent; border-left: 0px solid transparent; padding-top: 5px; padding-right: 30px; padding-bottom: 5px; padding-left: 30px; font-family: 'Open Sans', Helvetica, Arial, sans-serif; text-align: center; mso-border-alt: none;">
<span style="font-family:'Open Sans', Helvetica, Arial, sans-serif;font-size:16px;line-height:32px;"><a href="<?= base_url($group->getNotificationLink()) ?>" style="font-size: 14px; color: #fff;">MEHR ERFAHREN</a></span>
</div>
<!--[if mso]></center></v:textbox></v:roundrect></td></tr></table><![endif]-->
</div>
<div class="">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><![endif]-->
<div style="color:#fff;line-height:200%;font-family:'Open Sans', Helvetica, Arial, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
<div style="font-size:12px;line-height:24px;text-align:center;color:#fff;font-family:'Open Sans', Helvetica, Arial, sans-serif;">
<p style="margin: 0;font-size: 12px;line-height: 24px;text-align: center">Sollte der Button nicht funktionieren, besuche folgenden Link:<br>
<a href="<?= base_url($group->getNotificationLink()) ?>" style="color: #fff;"><?= base_url($group->getNotificationLink()) ?></a>
</p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="divider " style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 100%;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td class="divider_inner" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;padding-right: 20px;padding-left: 20px;padding-top: 20px;padding-bottom: 20px;min-width: 100%;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<table class="divider_content" height="200px" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 0px solid transparent;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 200px;line-height: 200px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<span>&#160;</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div style="background-color:transparent;">
<div style="Margin: 0 auto;min-width: 320px;max-width: 605px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;" class="block-grid mixed-two-up ">
<div style="border-collapse: collapse;display: table;width: 100%;background-color:transparent;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="background-color:transparent;" align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width: 605px;">
<tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="403" style=" width:403px; padding-right: 0px; padding-left: 0px; padding-top:15px; padding-bottom:15px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top">
<![endif]-->
<div class="col num8" style="display: table-cell;vertical-align: top;min-width: 320px;max-width: 400px;">
<div style="background-color: transparent; width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:15px; padding-bottom:15px; padding-right: 0px; padding-left: 0px;">
<!--<![endif]-->
<div class="">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><![endif]-->
<div style="color:#8F8F8F;font-family:'Open Sans', Helvetica, Arial, sans-serif;line-height:120%; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
<div style="font-size:12px;line-height:14px;color:#8F8F8F;font-family:'Open Sans', Helvetica, Arial, sans-serif;text-align:left;">
<p style="margin: 0;font-size: 14px;line-height: 17px">
<span style="font-size: 11px; line-height: 13px;">Copyright © 2018 KingOfDog.eu, All rights reserved. </span>
<span style="font-size: 11px; line-height: 13px;"></span>
<span style="font-size: 11px; line-height: 13px;"></span>
</p>
<p style="margin: 0;font-size: 14px;line-height: 17px">&#160;</p>
<p style="margin: 0;font-size: 14px;line-height: 17px">
<span style="font-size: 11px; line-height: 13px;">Du möchtest keine E-Mails mehr von uns erhalten? <a style="color:#8F8F8F;text-decoration: underline;" href="https://kingofdog.eu" target="_blank" rel="noopener">Bestelle alle E-Mails ab</a></span>
</p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td>
<td align="center" width="202" style=" width:202px; padding-right: 10px; padding-left: 10px; padding-top:15px; padding-bottom:15px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top">
<![endif]-->
<div class="col num4" style="display: table-cell;vertical-align: top;max-width: 320px;min-width: 200px;">
<div style="background-color: transparent; width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:15px; padding-bottom:15px; padding-right: 10px; padding-left: 10px;">
<!--<![endif]-->
<div align="right" style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;" class="">
<div style="line-height:10px;font-size:1px">&#160;</div>
<div style="display: table; max-width:119px;">
<!--[if (mso)|(IE)]>
<table width="99" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="border-collapse:collapse; padding-right: 10px; padding-left: 10px; padding-bottom: 10px;" align="right">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:99px;">
<tr>
<td width="32" style="width:32px; padding-right: 5px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;Margin-right: 5px">
<tbody>
<tr style="vertical-align: top">
<td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="http://twitter.com/KingOfDogTV" title="Twitter" target="_blank">
<img src="images/twitter.png" alt="Twitter" title="Twitter" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
<div style="line-height:5px;font-size:1px">&#160;</div>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td>
<td width="32" style="width:32px; padding-right: 0;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;Margin-right: 0">
<tbody>
<tr style="vertical-align: top">
<td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="https://www.youtube.com/KingOfDog" title="YouTube" target="_blank">
<img src="images/youtube@2x.png" alt="YouTube" title="YouTube" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
<div style="line-height:5px;font-size:1px">&#160;</div>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></div><![endif]-->
</body>
</html>

View File

@ -169,7 +169,7 @@ p {
color: #2272ff !important;
}
.breadcrumb .breadcrumb-item:hover a {
.breadcrumb .breadcrumb-item:hover a, .breadcrumb .breadcrumb-item a:hover {
color: #0D47A1 !important;
}

View File

@ -168,7 +168,8 @@
}
#notificationMenu a:not(.disabled) {
color: #0d0d0d !important;
color: #333 !important;
background-color: #2272ff1a;
}
#notificationMenu a:hover,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -48,9 +48,7 @@ function loadPosts(onLoad) {
},
success: function (data) {
const $items = $(data);
console.log(data);
if(onLoad) {
// $('#social-posts').isotope('insert', $items);
$('#social-posts').append($items)
.isotope('appended', $items);
$('#load-more-button').fadeIn();
@ -61,11 +59,7 @@ function loadPosts(onLoad) {
$('#load-more-button').html($('#load-more-button').attr('data-load'));
autoHeight();
$('#social-posts').isotope({filter: '*'}).isotope('layout');
// $('#social-posts-list .social-post-item').each(function () {
// $(this).css('height', $(this).outerHeight());
// });
offset += 1;
// data = ' ';
if(data === ' ') {
$('#load-more-button').fadeOut().delay(1000).remove();
$('#social-post-container').parent().append('<div class="alert alert-warning">' + $('#social-post-container').attr('data-error-msg') + '</div>');

View File

@ -149,6 +149,7 @@ function sendContactMessage() {
}
},
error: function (data) {
console.log(data);
$('#contactModal .modal-loading-container .modal-loading-icon i').removeClass('fa-cog fa-spin').addClass('fa-times').parents('.modal-loading-icon').addClass('error').append('<span>Ein unbekannter Fehler ist aufgetreten</span>');
}
});
@ -314,8 +315,9 @@ function loadNotificationsAsync() {
if (data.status === 'success') {
const container = $('#notificationMenu .list-group');
for (let notification of data.notifications) {
console.log(notification);
container.append(`
<a href="${notification.link}" class="list-group-item list-group-item-action flex-column align-items-start ${notification.unread === 1 ? '' : 'disabled'}">
<a href="${notification.link}" class="list-group-item list-group-item-action flex-column align-items-start ${notification.unread ? '' : 'disabled'}">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">${notification.sender}</h5>
<small>${notification.time}</small>
@ -325,7 +327,7 @@ function loadNotificationsAsync() {
`)
}
if (data.notifications.length > 0) {
const unread = data.notifications.filter(e => e.unread === 1);
const unread = data.notifications.filter(e => e.unread);
if (unread.length > 0) {
$('#notificationCount').text(unread.length);
}

View File

@ -96,9 +96,9 @@
while (list(, $element) = each($elements)) {
$path = realpath($base . '/' . $element);
$contents .= "\n\n" . file_get_contents($path);
$contents = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $contents);
$contents = str_replace(': ', ':', $contents);
$contents = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $contents);
// $contents = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $contents);
// $contents = str_replace(': ', ':', $contents);
// $contents = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $contents);
// $contents = fn_minify_css($contents);
}

View File

@ -1,6 +1,7 @@
import json
import os
import random
import re
import pymysql
import urllib.request
@ -11,7 +12,8 @@ import requests
import twitter
from PIL import Image
db = pymysql.connect('localhost', 'kingofdog', 'XrE#513*IOC&tA*B', 'kingofdog')
# db = pymysql.connect('localhost', 'kingofdog', 'XrE#513*IOC&tA*B', 'kingofdog')
db = pymysql.connect('localhost', 'kingofdog', '123456', 'kingofdog')
cur = db.cursor()
@ -102,6 +104,7 @@ def getTwitterPosts():
for tweet in tweets:
content = tweet.text
re.sub(r' https://t.co/.+', '', content)
published = datetime.strptime(tweet.created_at, '%a %b %d %H:%M:%S %z %Y').timestamp()
author = tweet.user.name
authorUrl = 'https://twitter.com/' + tweet.user.screen_name
@ -116,6 +119,6 @@ def getTwitterPosts():
insertIntoDatabase('Twitter', content, url, author, authorUrl, published, image, originalID)
getYouTubeVideos()
# getYouTubeVideos()
getTwitterPosts()
db.close()