summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-26 18:39:16 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-26 18:39:16 +0100
commit9007bb6790c283a29b28a24e4ea337a02326afc4 (patch)
tree15f637ae6ed7be70afece668ebe9d69c0b22559d /includes
parent47b52bc3f6a3b9fea86c46dbef34c2315c278b97 (diff)
sort news by date
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/admin_news.php8
-rw-r--r--includes/pages/user_news.php2
2 files changed, 8 insertions, 2 deletions
diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php
index 0653a045..a4474ff9 100644
--- a/includes/pages/admin_news.php
+++ b/includes/pages/admin_news.php
@@ -38,7 +38,13 @@ function admin_news() {
case 'save':
list($news) = $news;
- sql_query("UPDATE `News` SET `Datum`='" . sql_escape(time()) . "', `Betreff`='" . sql_escape($_POST["eBetreff"]) . "', `Text`='" . sql_escape($_POST["eText"]) . "', `UID`='" . sql_escape($user['UID']) . "', `Treffen`='" . sql_escape($_POST["eTreffen"]) . "' WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
+ sql_query("UPDATE `News` SET
+ `Datum`='" . sql_escape(time()) . "',
+ `Betreff`='" . sql_escape($_POST["eBetreff"]) . "',
+ `Text`='" . sql_escape($_POST["eText"]) . "',
+ `UID`='" . sql_escape($user['UID']) . "',
+ `Treffen`='" . sql_escape($_POST["eTreffen"]) . "'
+ WHERE `ID`=" . sql_escape($id));
engelsystem_log("News updated: " . $_POST["eBetreff"]);
success(_("News entry updated."));
redirect(page_link_to("news"));
diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php
index 8a4c0aa8..9536c2ea 100644
--- a/includes/pages/user_news.php
+++ b/includes/pages/user_news.php
@@ -132,7 +132,7 @@ function user_news() {
else
$page = 0;
- $news = sql_select("SELECT * FROM `News` ORDER BY `ID` DESC LIMIT " . sql_escape($page * $DISPLAY_NEWS) . ", " . sql_escape($DISPLAY_NEWS));
+ $news = sql_select("SELECT * FROM `News` ORDER BY `Datum` DESC LIMIT " . sql_escape($page * $DISPLAY_NEWS) . ", " . sql_escape($DISPLAY_NEWS));
foreach ($news as $entry)
$html .= display_news($entry);