From 3f12e235abf1cad562bf5df94164bf3c2146924e Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 28 May 2019 17:57:29 +0200
Subject: [news] Modularize; add 'login-news' category
TODO: Use date/time picker for expire time
---
modules-available/news/api.inc.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'modules-available/news/api.inc.php')
diff --git a/modules-available/news/api.inc.php b/modules-available/news/api.inc.php
index cbfaa82b..851f31a8 100644
--- a/modules-available/news/api.inc.php
+++ b/modules-available/news/api.inc.php
@@ -6,7 +6,7 @@ $type = Request::any('type', 'news', 'string');
// Fetch news from DB
$row = Database::queryFirst('SELECT title, content, dateline FROM vmchooser_pages'
- . ' WHERE type = :type ORDER BY dateline DESC LIMIT 1', compact('type'));
+ . ' WHERE type = :type AND expires > UNIX_TIMESTAMP() ORDER BY dateline DESC LIMIT 1', compact('type'));
if ($row !== false ) {
echo '' . "\n";
@@ -15,7 +15,7 @@ if ($row !== false ) {
echo "\t\t" . htmlspecialchars($row['title']) . "\n";
echo "\t" . '' . "\n";
echo "\t" . "" . "\n";
- echo "\t\t" . htmlspecialchars(nl2br($row['content'])) . "\n";
+ echo "\t\t" . htmlspecialchars($row['content']) . "\n";
echo "\t" . '' . "\n";
echo "\t" . "" . "\n";
echo "\t\t" . $row['dateline'] . "\n";
--
cgit v1.2.3-55-g7522