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 .= '
' . $result['postTitle'] . ' ' . lang('footer_published') . ' ' . DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date"), $_SESSION['site_lang']) . '
'; } 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"; } }