mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-19 01:24:05 +01:00
Be smarter about rebuilds
This commit is contained in:
parent
f1c2388840
commit
fceea15317
@ -680,7 +680,7 @@ function listBoards($just_uri = false, $indexed_only = false) {
|
||||
|
||||
if (!$just_uri) {
|
||||
$query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time, ``boards``.`indexed` indexed FROM ``boards``" . ( $indexed_only ? " WHERE `indexed` = 1 " : "" ) . "LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error());
|
||||
$boards = $query->fetchAll();
|
||||
$boards = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||
} else {
|
||||
$boards = array();
|
||||
$query = query("SELECT `uri` FROM ``boards``" . ( $indexed_only ? " WHERE `indexed` = 1" : "" ) . " ORDER BY ``boards``.`uri`") or error(db_error());
|
||||
|
@ -355,13 +355,22 @@ EOT;
|
||||
file_write('stylesheets/board/'.$b.'.css', $_POST['css']);
|
||||
file_write($b.'/rules.html', Element('page.html', array('title'=>'Rules', 'subtitle'=>'', 'config'=>$config, 'body'=>'<div class="ban">'.purify($_POST['rules']).'</div>')));
|
||||
file_write($b.'/rules.txt', $_POST['rules']);
|
||||
|
||||
$_config = $config;
|
||||
|
||||
openBoard($b);
|
||||
buildIndex();
|
||||
buildJavascript();
|
||||
$query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error());
|
||||
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
buildThread($post['id']);
|
||||
|
||||
// be smarter about rebuilds...only some changes really require us to rebuild all threads
|
||||
if ($_config['blotter'] != $config['blotter'] || $_config['field_disable_name'] != $config['field_disable_name'] || $_config['show_sages'] != $config['show_sages']) {
|
||||
buildIndex();
|
||||
$query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error());
|
||||
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
buildThread($post['id']);
|
||||
}
|
||||
}
|
||||
|
||||
buildJavascript();
|
||||
|
||||
modLog('Edited board settings', $b);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user