diff options
| author | Fredrick Brennan <admin@8chan.co> | 2015-03-29 09:18:14 +0800 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-05-06 16:03:55 +0200 |
| commit | 95b1e103cb9f349d7d82dca071636d5cde855ead (patch) | |
| tree | 34e863a732d57a38adfe295a767423377f3c6b79 /tools/import_rules.php | |
| parent | 7911c374e86ef8fa69c4545867b9d9d3de12d5c6 (diff) | |
Edit static pages commit
Diffstat (limited to 'tools/import_rules.php')
| -rw-r--r-- | tools/import_rules.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/import_rules.php b/tools/import_rules.php new file mode 100644 index 00000000..f583f035 --- /dev/null +++ b/tools/import_rules.php @@ -0,0 +1,16 @@ +<?php +// This script imports rules.txt files from the old system into the new ``pages`` table. + +require dirname(__FILE__) . '/inc/cli.php'; + +$boards = listBoards(TRUE); + +foreach ($boards as $i => $b) { + $rules = @file_get_contents($b.'/rules.txt'); + if ($rules && !empty(trim($rules))) { + $query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)'); + $query->bindValue(':board', $b); + $query->bindValue(':content', $rules); + $query->execute() or error(db_error($query)); + } +} |
