summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2016-06-24 17:23:35 +0200
committerSimon Rettberg2016-06-24 17:23:35 +0200
commitd78c234a7244e93ac53fc7bcba8cdb152fa00130 (patch)
tree3c8c070f9c317f7c9afd9bc03b3c13f61b016620 /apis
parent[news] Fix install script (SQL syntax), add error messages/handling (diff)
downloadslx-admin-d78c234a7244e93ac53fc7bcba8cdb152fa00130.tar.gz
slx-admin-d78c234a7244e93ac53fc7bcba8cdb152fa00130.tar.xz
slx-admin-d78c234a7244e93ac53fc7bcba8cdb152fa00130.zip
[news] Move over global news API, add support for type param
Diffstat (limited to 'apis')
-rw-r--r--apis/news.inc.php26
1 files changed, 0 insertions, 26 deletions
diff --git a/apis/news.inc.php b/apis/news.inc.php
deleted file mode 100644
index 610db289..00000000
--- a/apis/news.inc.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-header('Content-Type: application/xml; charset=utf-8');
-
-// Fetch news from DB
-$row = Database::queryFirst('SELECT title, content, dateline FROM news ORDER BY dateline DESC LIMIT 1');
-if ($row !== false ) {
-
- echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
- echo "<news>" . "\n";
- echo "\t" . '<headline>' . "\n";
- 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" . '</info>' . "\n";
- echo "\t" . "<date>" . "\n";
- echo "\t\t" . $row['dateline'] . "\n";
- echo "\t" . "</date>" . "\n";
- echo "</news>";
-
-} else {
- // no news in DB, output a 'null' news xml
- echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
- echo "<news>null</news>";
-}