function mb_substr_replace($string, $replacement, $start, $length) {
@ -344,6 +344,11 @@ function setupBoard($array) {
}
function openBoard($uri) {
global $config, $build_pages;
if ($config['try_smarter'])
$build_pages = array();
$board = getBoardInfo($uri);
if ($board) {
setupBoard($board);
@ -996,6 +1001,16 @@ function clean() {
}
}
function thread_find_page($thread) {
global $config, $board;
$query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC", $board['uri'])) or error(db_error($query));
$threads = $query->fetchAll(PDO::FETCH_COLUMN);
if (($index = array_search($thread, $threads)) === false)