improve scoring to store to presubmitted localhost, fix style and
[ViQa-Kissu.git] / tools / import_rules.php
blobf583f035fa079795ddf57a4bf7b44ede40cb5d54
1 <?php
2 // This script imports rules.txt files from the old system into the new ``pages`` table.
4 require dirname(__FILE__) . '/inc/cli.php';
6 $boards = listBoards(TRUE);
8 foreach ($boards as $i => $b) {
9 $rules = @file_get_contents($b.'/rules.txt');
10 if ($rules && !empty(trim($rules))) {
11 $query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)');
12 $query->bindValue(':board', $b);
13 $query->bindValue(':content', $rules);
14 $query->execute() or error(db_error($query));