forked from leftypol/leftypol
themes can use smart_build now
This commit is contained in:
parent
e1a8c4aa7d
commit
61d2729a40
3 changed files with 36 additions and 7 deletions
|
@ -16,11 +16,22 @@
|
|||
if ($action == 'all') {
|
||||
foreach ($boards as $board) {
|
||||
$b = new Catalog();
|
||||
$b->build($settings, $board);
|
||||
if ($config['smart_build']) {
|
||||
file_unlink($config['dir']['home'] . $board . '/catalog.html');
|
||||
}
|
||||
else {
|
||||
$b->build($settings, $board);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) {
|
||||
$b = new Catalog();
|
||||
$b->build($settings, $board);
|
||||
|
||||
if ($config['smart_build']) {
|
||||
file_unlink($config['dir']['home'] . $board . '/catalog.html');
|
||||
}
|
||||
else {
|
||||
$b->build($settings, $board);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +39,12 @@
|
|||
class Catalog {
|
||||
public function build($settings, $board_name) {
|
||||
global $config, $board;
|
||||
|
||||
openBoard($board_name);
|
||||
|
||||
if ($board['uri'] != $board_name) {
|
||||
if (!openBoard($board_name)) {
|
||||
error(sprintf(_("Board %s doesn't exist"), $board_name));
|
||||
}
|
||||
}
|
||||
|
||||
$recent_images = array();
|
||||
$recent_posts = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue