From bea631d3f5e7d533185187e284cd392da73de325 Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Tue, 25 Apr 2017 00:09:35 +0900 Subject: Changes to add recent news to the Recent Posts Theme for the front page --- templates/themes/recent/theme.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'templates/themes/recent/theme.php') diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index d4d4e9b8..7081346b 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -147,13 +147,17 @@ $stats['active_content'] += array_sum($matches[1]); } + $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC" . ($settings['limit_news'] ? ' LIMIT ' . $settings['limit_news'] : '')) or error(db_error()); + $recent_news = $query->fetchAll(PDO::FETCH_ASSOC); + return Element('themes/recent/recent.html', Array( 'settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), 'recent_images' => $recent_images, 'recent_posts' => $recent_posts, - 'stats' => $stats + 'stats' => $stats, + 'recent_news' => $recent_news, )); } }; -- cgit v1.3