summaryrefslogtreecommitdiffstats
path: root/modules-available/news/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-05-28 17:57:29 +0200
committerSimon Rettberg2019-06-25 10:17:22 +0200
commitf31b474e1f720e94b37cfedfe0febe453284f158 (patch)
tree7aa8b6c329e3d4dfa474e9c6ff403c3db970652c /modules-available/news/api.inc.php
parent[dnbd3] Put proxies from other locations into SLX_DNBD3_FALLBACK (diff)
downloadslx-admin-f31b474e1f720e94b37cfedfe0febe453284f158.tar.gz
slx-admin-f31b474e1f720e94b37cfedfe0febe453284f158.tar.xz
slx-admin-f31b474e1f720e94b37cfedfe0febe453284f158.zip
[news] Modularize; add 'login-news' category
TODO: Use date/time picker for expire time
Diffstat (limited to 'modules-available/news/api.inc.php')
-rw-r--r--modules-available/news/api.inc.php4
1 files changed, 2 insertions, 2 deletions
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 '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
@@ -15,7 +15,7 @@ if ($row !== false ) {
echo "\t\t" . htmlspecialchars($row['title']) . "\n";
echo "\t" . '</headline>' . "\n";
echo "\t" . "<info>" . "\n";
- echo "\t\t" . htmlspecialchars(nl2br($row['content'])) . "\n";
+ echo "\t\t" . htmlspecialchars($row['content']) . "\n";
echo "\t" . '</info>' . "\n";
echo "\t" . "<date>" . "\n";
echo "\t\t" . $row['dateline'] . "\n";