diff options
| author | Michael Walker <mike@barrucadu.co.uk> | 2015-01-26 22:31:23 +0000 |
|---|---|---|
| committer | Michael Walker <mike@barrucadu.co.uk> | 2015-01-26 22:31:23 +0000 |
| commit | 9c091aaa4700fda3e2d03a2f1e42f6338a4d7cbc (patch) | |
| tree | 373e83d0d86eacebb39e80ab2e3970f267217612 /templates/themes/rand/info.php | |
| parent | e8737b23d5c4242d6b199998fde692dbfd5f032f (diff) | |
Add random theme. Like Ukko, but sorts threads randomly.
Diffstat (limited to 'templates/themes/rand/info.php')
| -rw-r--r-- | templates/themes/rand/info.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/templates/themes/rand/info.php b/templates/themes/rand/info.php new file mode 100644 index 00000000..c226e2e4 --- /dev/null +++ b/templates/themes/rand/info.php @@ -0,0 +1,54 @@ +<?php + $theme = array(); + + // Theme name + $theme['name'] = 'Random Overboard'; + // Description (you can use Tinyboard markup here) + $theme['description'] = 'Board with threads and messages from all boards, sorted randomly'; + $theme['version'] = 'v0.2'; + + // Theme configuration + $theme['config'] = array(); + + $theme['config'][] = array( + 'title' => 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Random' + ); + $theme['config'][] = array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'default' => '.', + 'comment' => '(rand for example)' + ); + $theme['config'][] = array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' + ); + $theme['config'][] = array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ); + // Unique function name for building everything + $theme['build_function'] = 'rand_build'; + $theme['install_callback'] = 'rand_install'; + + if(!function_exists('rand_install')) { + function rand_install($settings) { + if (!file_exists($settings['uri'])) + @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + } + } + |
