diff --git a/boards.php b/boards.php index b6fa8eaa2..97f3a964b 100644 --- a/boards.php +++ b/boards.php @@ -1,3 +1,4 @@ + $config, - "boards" => $boards, - "tag_query" => $tag_query, - - ) + "config" => $config, + "boards" => $boards, + "tag_query" => $tag_query, + + ) ); $tagsHTML = Element("8chan/boards-tags.html", array( - "config" => $config, - "tags" => $tags, - "tag_query" => $tag_query, - - ) + "config" => $config, + "tags" => $tags, + "tag_query" => $tag_query, + + ) ); $query = query('SELECT np.* FROM newsplus np INNER JOIN `posts_n` p ON np.thread=p.id WHERE np.dead IS FALSE ORDER BY p.bump DESC'); if ($query) { - $newsplus = $query->fetchAll(PDO::FETCH_ASSOC); + $newsplus = $query->fetchAll(PDO::FETCH_ASSOC); } else { - $newsplus = false; + $newsplus = []; } +include("recent_threads.php"); + $searchArray = array( - "config" => $config, - "boards" => $boards, - "tags" => $tags, - "search" => $searchJson['search'], - "languages" => $config['languages'], - - "boards_total" => $boards_total, - "boards_public" => $boards_public, - "boards_hidden" => $boards_hidden, - "boards_omitted" => $boards_omitted, - - "posts_hour" => $posts_hour, - "posts_total" => $posts_total, - - "founding_date" => $founding_date, - "page_updated" => date('r'), - - "html_boards" => $boardsHTML, - "html_tags" => $tagsHTML, - "newsplus" => $newsplus + "config" => $config, + "boards" => $boards, + "tags" => $tags, + "search" => $searchJson['search'], + "languages" => $config['languages'], + + "boards_total" => $boards_total, + "boards_public" => $boards_public, + "boards_hidden" => $boards_hidden, + "boards_omitted" => $boards_omitted, + + "posts_hour" => $posts_hour, + "posts_total" => $posts_total, + + "founding_date" => $founding_date, + "page_updated" => date('r'), + "recent_threads" => $RT_HTML, + + "html_boards" => $boardsHTML, + "html_tags" => $tagsHTML, + "newsplus" => $newsplus ); $searchHTML = Element("8chan/boards-index.html", $searchArray); $pageHTML = Element("page.html", array( - "title" => "8chan, the infinitely expanding imageboard", - "config" => $config, - "body" => $searchHTML, - ) + "title" => $config['site_slogan'], + "config" => $config, + "body" => $searchHTML, + ) ); $searchHTML2 = Element("8chan/boards-search.html", $searchArray); $pageHTML2 = Element("page.html", array( - "title" => "Boards on 8chan", - "config" => $config, - "body" => $searchHTML2, - ) + "title" => "Boards on ".$config['site_name'], + "config" => $config, + "body" => $searchHTML2, + ) ); // We only want to cache if this is not a dynamic form request. // Otherwise, our information will be skewed by the search criteria. if (php_sapi_name() == 'cli') { - // Preserves the JSON output format of [{board},{board}]. - $nonAssociativeBoardList = array_values($response['boardsFull']); - - file_write("index.html", $pageHTML); - file_write("boards.html", $pageHTML2); - file_write("boards.json", json_encode($nonAssociativeBoardList)); - - $topbar = array(); - foreach ($boards as $i => $b) { - if (is_array($config['no_top_bar_boards']) && !in_array($b['uri'], $config['no_top_bar_boards'])) { - $topbar[] = $b; - } - } - - file_write("boards-top20.json", json_encode(array_splice($topbar, 0, 48))); + // Preserves the JSON output format of [{board},{board}]. + $nonAssociativeBoardList = array_values($response['boardsFull']); + + file_write("index.html", $pageHTML); + file_write("boards.html", $pageHTML2); + file_write("boards.json", json_encode($nonAssociativeBoardList)); + + $topbar = array(); + foreach ($boards as $i => $b) { + if (is_array($config['no_top_bar_boards']) && !in_array($b['uri'], $config['no_top_bar_boards'])) { + $topbar[] = $b; + } + } + + file_write("boards-top20.json", json_encode(array_splice($topbar, 0, 48))); } echo $pageHTML;