mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-31 12:23:48 +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) {
|
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());
|
$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 {
|
} else {
|
||||||
$boards = array();
|
$boards = array();
|
||||||
$query = query("SELECT `uri` FROM ``boards``" . ( $indexed_only ? " WHERE `indexed` = 1" : "" ) . " ORDER BY ``boards``.`uri`") or error(db_error());
|
$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('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.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']);
|
file_write($b.'/rules.txt', $_POST['rules']);
|
||||||
|
|
||||||
|
$_config = $config;
|
||||||
|
|
||||||
openBoard($b);
|
openBoard($b);
|
||||||
buildIndex();
|
|
||||||
buildJavascript();
|
// be smarter about rebuilds...only some changes really require us to rebuild all threads
|
||||||
$query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error());
|
if ($_config['blotter'] != $config['blotter'] || $_config['field_disable_name'] != $config['field_disable_name'] || $_config['show_sages'] != $config['show_sages']) {
|
||||||
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
buildIndex();
|
||||||
buildThread($post['id']);
|
$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);
|
modLog('Edited board settings', $b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user