forked from leftypol/leftypol
Add stream theme / extension to Lainchan
This commit is contained in:
parent
f469416073
commit
a1a83f50ba
4 changed files with 192 additions and 0 deletions
34
templates/themes/stream/theme.php
Normal file
34
templates/themes/stream/theme.php
Normal file
|
@ -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(),
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue