summaryrefslogtreecommitdiff
path: root/templates/themes/stream/theme.php
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2016-10-08 15:29:06 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2016-10-08 15:29:06 +0900
commitfa01d816b3b2d9dfb4f6b37435d1a6fd3cbf76f7 (patch)
treee1ed81ce6cfa69389ebfc4d83dacfa35550945e4 /templates/themes/stream/theme.php
parent2abb80ba296908be3d4480ff32e5eda3822881a6 (diff)
Add stream theme / extension to Lainchan
Diffstat (limited to 'templates/themes/stream/theme.php')
-rw-r--r--templates/themes/stream/theme.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/templates/themes/stream/theme.php b/templates/themes/stream/theme.php
new file mode 100644
index 00000000..6d11a0dc
--- /dev/null
+++ b/templates/themes/stream/theme.php
@@ -0,0 +1,34 @@
+<?php
+ require 'info.php';
+
+ function stream_build($action, $settings, $board) {
+ // Possible values for $action:
+ // - all (rebuild everything, initialization)
+ // - boards (board list changed)
+
+ Stream::build($action, $settings);
+ }
+
+ // Wrap functions in a class so they don't interfere with normal Tinyboard operations
+ class Stream {
+ public static function build($action, $settings) {
+ global $config;
+
+ if ($action == 'all' )
+ file_write($config['dir']['home'] . $settings['file'], Stream::homepage($settings));
+ }
+
+ // Build news page
+ public static function homepage($settings) {
+ global $config;
+
+
+ return Element('themes/stream/stream.html', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'boardlist' => createBoardlist(),
+ ));
+ }
+ };
+
+?>