forked from leftypol/leftypol
Edit static pages commit
This commit is contained in:
parent
7911c374e8
commit
95b1e103cb
9 changed files with 328 additions and 6 deletions
16
tools/import_rules.php
Normal file
16
tools/import_rules.php
Normal file
|
@ -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));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue