2011-04-14 14:53:29 -04:00
|
|
|
<?php
|
|
|
|
$theme = Array();
|
|
|
|
|
|
|
|
// Theme name
|
|
|
|
$theme['name'] = 'RecentPosts';
|
|
|
|
// Description (you can use Tinyboard markup here)
|
|
|
|
$theme['description'] = 'Show recent posts and images, like 4chan.';
|
2012-02-14 04:49:21 -05:00
|
|
|
$theme['version'] = 'v1.0';
|
2011-04-14 14:53:29 -04:00
|
|
|
|
|
|
|
// Theme configuration
|
|
|
|
$theme['config'] = Array();
|
|
|
|
|
|
|
|
$theme['config'][] = Array(
|
|
|
|
'title' => 'Title',
|
|
|
|
'name' => 'title',
|
2012-02-14 04:46:06 -05:00
|
|
|
'type' => 'text',
|
|
|
|
'default' => 'Recent Posts'
|
2011-04-14 14:53:29 -04:00
|
|
|
);
|
|
|
|
|
2011-04-16 11:28:25 -04:00
|
|
|
$theme['config'][] = Array(
|
|
|
|
'title' => 'Excluded boards',
|
|
|
|
'name' => 'exclude',
|
|
|
|
'type' => 'text',
|
|
|
|
'comment' => '(space seperated)'
|
|
|
|
);
|
|
|
|
|
2012-02-14 04:46:06 -05:00
|
|
|
$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")'
|
|
|
|
);
|
|
|
|
|
2011-04-14 14:53:29 -04:00
|
|
|
// Unique function name for building everything
|
|
|
|
$theme['build_function'] = 'recentposts_build';
|
2012-02-14 04:46:06 -05:00
|
|
|
$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.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|