diff options
| author | Matěj Grabovský <mgrabovsky@yahoo.com> | 2015-06-02 15:28:06 +0200 |
|---|---|---|
| committer | Matěj Grabovský <mgrabovsky@yahoo.com> | 2015-07-03 16:13:16 +0200 |
| commit | 7c6eef81c55d6f5ccfa6ebba759afcec7b79115d (patch) | |
| tree | 8c5dbfee3d267700ff5a3c53a486eee607368c7d /templates/themes/semirand/info.php | |
| parent | b25b443e55cf20420231e82e5ffdaeff6db595d5 (diff) | |
Add a semirandom theme
This theme displays random threads intermixed with recently bumped ones.
The number of each is configurable.
Diffstat (limited to 'templates/themes/semirand/info.php')
| -rw-r--r-- | templates/themes/semirand/info.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/templates/themes/semirand/info.php b/templates/themes/semirand/info.php new file mode 100644 index 00000000..255935c1 --- /dev/null +++ b/templates/themes/semirand/info.php @@ -0,0 +1,70 @@ +<?php + + // Basic theme properties + $theme = array( + 'name' => 'Mixed All/Random Overboard', + // Description (you can use Tinyboard markup here) + 'description' => 'Board with threads from all boards with most recently bumped and random ones intermixed', + 'version' => 'v0.1', + // Unique function name for building and installing whatever's necessary + 'build_function' => 'semirand_build', + 'install_callback' => 'semirand_install', + ); + + // Theme configuration + $theme['config'] = array( + array( + 'title' => 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Semirandom', + ), + array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'default' => '.', + 'comment' => '("mixed", for example)', + ), + array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit, for example "%s coolest threads")', + ), + array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)', + ), + array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ), + array( + 'title' => 'Random threads', + 'name' => 'random_count', + 'comment' => '(number of consecutive random threads)', + 'type' => 'text', + 'default' => '1', + ), + array( + 'title' => 'Bumped threads', + 'name' => 'bumped_count', + 'comment' => '(number of consecutive recent threads)', + 'type' => 'text', + 'default' => '1', + ), + ); + + if (!function_exists('semirand_install')) { + function semirand_install($settings) { + if (!file_exists($settings['uri'])) { + @mkdir($settings['uri'], 0777) or error("Couldn't create {$settings['uri']}. Check permissions.", true); + } + } + } + |
