execute() or error(db_error($tagQuery)); $boardResult = $boardQuery->fetchAll(PDO::FETCH_ASSOC)[0]; $boards_total = number_format( $boardResult['boards_total'], 0 ); $boards_public = number_format( $boardResult['boards_public'], 0 ); $boards_hidden = number_format( $boardResult['boards_total'] - $boardResult['boards_public'], 0 ); $posts_hour = number_format( fetchBoardActivity(), 0 ); $posts_total = number_format( $boardResult['posts_total'], 0 ); /* Create and distribute page */ $config['additional_javascript'] = array( 'js/jquery.min.js', 'js/board-directory.js' ); $boardsHTML = Element("8chan/boards-table.html", array( "config" => $config, "boards" => $boards, ) ); $tagsHTML = Element("8chan/boards-tags.html", array( "config" => $config, "tags" => $tags, ) ); $searchHTML = Element("8chan/boards-search.html", array( "config" => $config, "boards_total" => $boards_total, "boards_public" => $boards_public, "boards_hidden" => $boards_hidden, "posts_hour" => $posts_hour, "posts_total" => $posts_total, "founding_date" => $founding_date, "page_updated" => date('r'), "uptime" => shell_exec('uptime -p'), "html_boards" => $boardsHTML, "html_tags" => $tagsHTML ) ); $pageHTML = Element("page.html", array( "config" => $config, "body" => $searchHTML, "title" => "Boards on ∞chan" ) ); file_write("boards.html", $pageHTML); echo $pageHTML;