forked from leftypol/leftypol
Changes to add recent news to the Recent Posts Theme for the front page
This commit is contained in:
parent
4139277cff
commit
aa8eb39dab
4 changed files with 34 additions and 3 deletions
|
@ -64,12 +64,21 @@
|
|||
'comment' => '(eg. "recent.css" - see templates/themes/recent for details)'
|
||||
);
|
||||
|
||||
$theme['config'][] = Array(
|
||||
'title' => '# of recent news',
|
||||
'name' => 'limit_news',
|
||||
'type' => 'text',
|
||||
'default' => '1',
|
||||
'comment' => '(maximum news to display)'
|
||||
);
|
||||
// Unique function name for building everything
|
||||
$theme['build_function'] = 'recentposts_build';
|
||||
$theme['install_callback'] = 'recentposts_install';
|
||||
|
||||
if (!function_exists('recentposts_install')) {
|
||||
function recentposts_install($settings) {
|
||||
if (!is_numeric($settings['limit_news']) || $settings['limit_news'] < 0)
|
||||
return Array(false, '<strong>' . utf8tohtml($settings['limit_news']) . '</strong> is not a non-negative integer.');
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue