summaryrefslogtreecommitdiff
path: root/templates/themes/recent/info.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-02-14 20:46:06 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-02-14 20:46:06 +1100
commit42abac99cf2b3a15871063243785a70de54adc5d (patch)
tree6ceecd21488ba344da400e47cad19db0dade80d9 /templates/themes/recent/info.php
parent0b421167171ab29199dbd4732c5182aaec094e21 (diff)
recent theme: transition to Twig template files
Diffstat (limited to 'templates/themes/recent/info.php')
-rw-r--r--templates/themes/recent/info.php49
1 files changed, 46 insertions, 3 deletions
diff --git a/templates/themes/recent/info.php b/templates/themes/recent/info.php
index 734908c4..ab983fdc 100644
--- a/templates/themes/recent/info.php
+++ b/templates/themes/recent/info.php
@@ -5,7 +5,7 @@
$theme['name'] = 'RecentPosts';
// Description (you can use Tinyboard markup here)
$theme['description'] = 'Show recent posts and images, like 4chan.';
- $theme['version'] = 'v0.9';
+ $theme['version'] = 'v0.9.1';
// Theme configuration
$theme['config'] = Array();
@@ -13,7 +13,8 @@
$theme['config'][] = Array(
'title' => 'Title',
'name' => 'title',
- 'type' => 'text'
+ 'type' => 'text',
+ 'default' => 'Recent Posts'
);
$theme['config'][] = Array(
@@ -23,6 +24,48 @@
'comment' => '(space seperated)'
);
+ $theme['config'][] = Array(
+ 'title' => '# of recent images',
+ 'name' => 'limit_images',
+ 'type' => 'text',
+ 'default' => '3',
+ 'comment' => '(maximum images to display)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => '# of recent posts',
+ 'name' => 'limit_posts',
+ 'type' => 'text',
+ 'default' => '30',
+ 'comment' => '(maximum posts to display)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'HTML file',
+ 'name' => 'html',
+ 'type' => 'text',
+ 'default' => 'recent.html',
+ 'comment' => '(eg. "recent.html")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'CSS file',
+ 'name' => 'css',
+ 'type' => 'text',
+ 'default' => 'recent.css',
+ 'comment' => '(eg. "recent.css")'
+ );
+
// Unique function name for building everything
$theme['build_function'] = 'recentposts_build';
-?> \ No newline at end of file
+ $theme['install_callback'] = 'recentposts_install';
+
+ if(!function_exists('recentposts_install')) {
+ function recentposts_install($settings) {
+ if(!is_numeric($settings['limit_images']) || $settings['limit_images'] < 0)
+ return Array(false, '<strong>' . utf8tohtml($settings['limit_images']) . '</strong> is not a non-negative integer.');
+ if(!is_numeric($settings['limit_posts']) || $settings['limit_posts'] < 0)
+ return Array(false, '<strong>' . utf8tohtml($settings['limit_posts']) . '</strong> is not a non-negative integer.');
+ }
+ }
+