mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 09:20:58 +01:00
18 lines
556 B
PHP
18 lines
556 B
PHP
<?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');
|
|
echo "Processing board $b...\n";
|
|
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();
|
|
}
|
|
}
|