diff --git a/mod.php b/mod.php index 14bed8d1..89085d66 100644 --- a/mod.php +++ b/mod.php @@ -286,7 +286,7 @@ // Check if everything is submitted foreach($theme['config'] as &$c) { if(!isset($_POST[$c['name']]) && $c['type'] != 'checkbox') - error(spritnf($config['error']['required'], $c['title'])); + error(sprintf($config['error']['required'], $c['title'])); } // Clear previous settings @@ -327,6 +327,8 @@ default: $body .= ''; } + if(isset($c['comment'])) + $body .= ' ' . $c['comment'] . ''; $body .= ''; } $body .= ''; diff --git a/templates/homepage/recent/info.php b/templates/homepage/recent/info.php index 2f5c977a..734908c4 100644 --- a/templates/homepage/recent/info.php +++ b/templates/homepage/recent/info.php @@ -16,6 +16,13 @@ 'type' => 'text' ); + $theme['config'][] = Array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + // Unique function name for building everything $theme['build_function'] = 'recentposts_build'; ?> \ No newline at end of file diff --git a/templates/homepage/recent/theme.php b/templates/homepage/recent/theme.php index 963ce235..f7c5da45 100644 --- a/templates/homepage/recent/theme.php +++ b/templates/homepage/recent/theme.php @@ -8,25 +8,28 @@ // - boards (board list changed) // - post (a post has been made) - Basic::build($action, $settings); + $b = new Basic(); + $b->build($action, $settings); } // Wrap functions in a class so they don't interfere with normal Tinyboard operations class Basic { - public static function build($action, $settings) { + public function build($action, $settings) { global $config, $_theme; if($action == 'all') { copy($config['dir']['homepage'] . '/' . $_theme . '/recent.css', $config['dir']['home'] . 'recent.css'); } + $this->excluded = explode(' ', $settings['exclude']); + if($action == 'all' || $action == 'post') - // file_put_contents($config['dir']['home'] . $config['file_index'], Basic::homepage($settings)); - file_put_contents($config['dir']['home'] . 'recent.html', Basic::homepage($settings)); + // file_put_contents($config['dir']['home'] . $config['file_index'], $this->homepage($settings)); + file_put_contents($config['dir']['home'] . 'recent.html', $this->homepage($settings)); } // Build news page - public static function homepage($settings) { + public function homepage($settings) { global $config, $board; // HTML5 @@ -52,6 +55,8 @@ $body .= '

Recent Images