From 3ab6489154fa4a0e3777bf47b6b25b8b0eed27f4 Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 28 Jan 2015 17:55:58 -0800 Subject: [PATCH] Top 2k in separate file --- boards.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boards.php b/boards.php index e9e5e29f..fb90c771 100644 --- a/boards.php +++ b/boards.php @@ -115,9 +115,14 @@ $boards = array_values($boards); arsort($all_tags); $config['additional_javascript'] = array('js/jquery.min.js', 'js/jquery.tablesorter.min.js'); -$body = Element("8chan/boards-tags.html", array("config" => $config, "n_boards" => $n_boards, "t_boards" => $t_boards, "hidden_boards_total" => $hidden_boards_total, "total_posts" => $total_posts, "total_posts_hour" => $total_posts_hour, "boards" => $boards, "last_update" => date('r'), "uptime_p" => shell_exec('uptime -p'), 'tags' => $all_tags)); +$body = Element("8chan/boards-tags.html", array("config" => $config, "n_boards" => $n_boards, "t_boards" => $t_boards, "hidden_boards_total" => $hidden_boards_total, "total_posts" => $total_posts, "total_posts_hour" => $total_posts_hour, "boards" => $boards, "last_update" => date('r'), "uptime_p" => shell_exec('uptime -p'), 'tags' => $all_tags, 'top2k' => false)); $html = Element("page.html", array("config" => $config, "body" => $body, "title" => "Boards on ∞chan")); +array_splice($boards, 2000); +$boards = array_values($boards); +$body = Element("8chan/boards-tags.html", array("config" => $config, "n_boards" => $n_boards, "t_boards" => $t_boards, "hidden_boards_total" => $hidden_boards_total, "total_posts" => $total_posts, "total_posts_hour" => $total_posts_hour, "boards" => $boards, "last_update" => date('r'), "uptime_p" => shell_exec('uptime -p'), 'tags' => $all_tags, 'top2k' => true)); +$html_top2k = Element("page.html", array("config" => $config, "body" => $body, "title" => "Boards on ∞chan")); + if ($admin) { echo $html; } else { @@ -135,7 +140,8 @@ if ($admin) { $boards = array_values($boards); file_write("boards-top20.json", json_encode($boards)); - file_write("boards.html", $html); + file_write("boards.html", $html_top2k); + file_write("boards_full.html", $html); echo 'Done'; }