diff --git a/templates/homepage/basic/theme.php b/templates/homepage/basic/theme.php new file mode 100644 index 00000000..fb45be66 --- /dev/null +++ b/templates/homepage/basic/theme.php @@ -0,0 +1,88 @@ + 'Title', + 'name' => 'title', + 'type' => 'text' + ); + + $theme['config'][] = Array( + 'title' => 'Slogan', + 'name' => 'subtitle', + 'type' => 'text' + ); + + // Unique function name for building everything + $config['build_function'] = 'basic_build'; + + function basic_build($settings) { + Basic::build($settings); + } + + // Wrap functions in a class so they don't interfere with normal Tinyboard operations + class Basic { + public static function build($settings) { + global $config; + + file_put_contents($config['dir']['home'] . $config['file_index'], Basic::homepage($settings)); + } + + // Build news page + 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 ' . + date($config['post_date'], $news['time']) . + '

' . $news['body'] . '

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

Powered by Tinyboard'; + + return $body; + } + }; + +?> \ No newline at end of file diff --git a/templates/homepage/basic/thumb.png b/templates/homepage/basic/thumb.png new file mode 100644 index 00000000..05dcd96c Binary files /dev/null and b/templates/homepage/basic/thumb.png differ