The version of vichan running on lainchan.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
549B

  1. <?php
  2. // This script imports rules.txt files from the old system into the new ``pages`` table.
  3. require dirname(__FILE__) . '/inc/cli.php';
  4. $boards = listBoards(TRUE);
  5. foreach ($boards as $i => $b) {
  6. $rules = @file_get_contents($b.'/rules.txt');
  7. if ($rules && !empty(trim($rules))) {
  8. $query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)');
  9. $query->bindValue(':board', $b);
  10. $query->bindValue(':content', $rules);
  11. $query->execute() or error(db_error($query));
  12. }
  13. }