'Rules', 'subtitle'=>'', 'config'=>$config, 'body'=>''.purify($_POST['rules']).'
')));
+ file_write($b.'/rules.txt', $_POST['rules']);
+ openBoard($b);
+ buildIndex();
+ buildJavascript();
+ $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error());
+ while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
+ buildThread($post['id']);
+ }
+ modLog('Edited board settings', $b);
+ }
+
+ $query = prepare('SELECT * FROM boards WHERE uri = :board');
+ $query->bindValue(':board', $b);
+ $query->execute() or error(db_error($query));
+ $board = $query->fetchAll()[0];
+
+ $rules = @file_get_contents($board['uri'] . '/rules.txt');
+ $css = @file_get_contents('stylesheets/board/' . $board['uri'] . '.css');
+
+ openBoard($b);
+
+ rebuildThemes('bans');
+
+ if ($config['cache']['enabled'])
+ cache::delete('board_' . $board['uri']);
+ cache::delete('all_boards');
+
+ mod_page(_('Board configuration'), 'mod/settings.html', array('board'=>$board, 'rules'=>prettify_textarea($rules), 'css'=>prettify_textarea($css), 'token'=>make_secure_link_token('settings/'.$board['uri']), 'languages'=>$possible_languages));
+ };
+ $config['embedding'] = array(
+ array(
+ '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
+ ''
+ ),
+ array(
+ '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i',
+ ''
+ ),
+ array(
+ '/^https?:\/\/(\w+\.)?dailymotion\.com\/video\/([a-zA-Z0-9]{2,10})(_.+)?$/i',
+ ''
+ ),
+ array(
+ '/^https?:\/\/(\w+\.)?metacafe\.com\/watch\/(\d+)\/([a-zA-Z0-9_\-.]+)\/(\?.+)?$/i',
+ ''
+ ),
+ array(
+ '/^https?:\/\/video\.google\.com\/videoplay\?docid=(\d+)([](.+)?)?$/i',
+ ''
+ ),
+ array(
+ '/^https?:\/\/(\w+\.)?vocaroo\.com\/i\/([a-zA-Z0-9]{2,15})$/i',
+ ''
+ )
+ );
+
+$config['gzip_static'] = false;