forked from GithubBackups/vichan
Log in tools/import_rules
This commit is contained in:
parent
ce596aaf65
commit
6644bd5b1d
@ -7,10 +7,11 @@ $boards = listBoards(TRUE);
|
|||||||
|
|
||||||
foreach ($boards as $i => $b) {
|
foreach ($boards as $i => $b) {
|
||||||
$rules = @file_get_contents($b.'/rules.txt');
|
$rules = @file_get_contents($b.'/rules.txt');
|
||||||
|
echo "Processing board $b...\n";
|
||||||
if ($rules && !empty(trim($rules))) {
|
if ($rules && !empty(trim($rules))) {
|
||||||
$query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)');
|
$query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)');
|
||||||
$query->bindValue(':board', $b);
|
$query->bindValue(':board', $b);
|
||||||
$query->bindValue(':content', $rules);
|
$query->bindValue(':content', $rules);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user