From 658a7b43791921a06132ad5db8beacb33a6ef5dc Mon Sep 17 00:00:00 2001 From: Michael Save Date: Wed, 8 Feb 2012 09:08:13 +1100 Subject: use Twig template for "basic" theme --- templates/themes/basic/theme.php | 46 +++++++--------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) (limited to 'templates/themes/basic/theme.php') diff --git a/templates/themes/basic/theme.php b/templates/themes/basic/theme.php index 2513754a..8dba89cc 100644 --- a/templates/themes/basic/theme.php +++ b/templates/themes/basic/theme.php @@ -23,45 +23,15 @@ public static function homepage($settings) { global $config; - // HTML5 - $body = '' - . '' - . '' - . '' . $settings['title'] . '' - . ''; - - $boardlist = createBoardlist(); - $body .= '
' . $boardlist['top'] . '
'; - - $body .= '

' . $settings['title'] . '

' - . '
' . ($settings['subtitle'] ? utf8tohtml($settings['subtitle']) : '') . '
'; - - $body .= '
'; - $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); - if($query->rowCount() == 0) { - $body .= '

(No news to show.)

'; - } else { - // List news - while($news = $query->fetch()) { - $body .= '

' . - ($news['subject'] ? - $news['subject'] - : - 'no subject' - ) . - ' — by ' . - $news['name'] . - ' at ' . - strftime($config['post_date'], $news['time']) . - '

' . $news['body'] . '

'; - } - } - - $body .= '
'; - - // Finish page - $body .= '

Powered by Tinyboard'; + $news = $query->fetchAll(PDO::FETCH_ASSOC); + + return Element('themes/basic/index.html', Array( + 'settings' => $settings, + 'config' => $config, + 'boardlist' => createBoardlist(), + 'news' => $news + )); return $body; } -- cgit v1.3