|
@ -16,20 +16,35 @@ |
|
|
if ($action == 'all') { |
|
|
if ($action == 'all') { |
|
|
foreach ($boards as $board) { |
|
|
foreach ($boards as $board) { |
|
|
$b = new Catalog(); |
|
|
$b = new Catalog(); |
|
|
|
|
|
if ($config['smart_build']) { |
|
|
|
|
|
file_unlink($config['dir']['home'] . $board . '/catalog.html'); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
$b->build($settings, $board); |
|
|
$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)) { |
|
|
} 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 = new Catalog(); |
|
|
|
|
|
|
|
|
|
|
|
if ($config['smart_build']) { |
|
|
|
|
|
file_unlink($config['dir']['home'] . $board . '/catalog.html'); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
$b->build($settings, $board); |
|
|
$b->build($settings, $board); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Wrap functions in a class so they don't interfere with normal Tinyboard operations |
|
|
// Wrap functions in a class so they don't interfere with normal Tinyboard operations |
|
|
class Catalog { |
|
|
class Catalog { |
|
|
public function build($settings, $board_name) { |
|
|
public function build($settings, $board_name) { |
|
|
global $config, $board; |
|
|
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_images = array(); |
|
|
$recent_posts = array(); |
|
|
$recent_posts = array(); |
|
|