summaryrefslogtreecommitdiff
path: root/pages/splitting.inc
diff options
context:
space:
mode:
Diffstat (limited to 'pages/splitting.inc')
-rw-r--r--pages/splitting.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/pages/splitting.inc b/pages/splitting.inc
index d1dccae..2f5fa39 100644
--- a/pages/splitting.inc
+++ b/pages/splitting.inc
@@ -3,10 +3,15 @@
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
+if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json", "{}");
+
+$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json"), true);
+
?>
<br>
<div class="container">
+ <?php if (!isset($cache["content"])): ob_start(); ?>
<div id="page-content">
<h2>Members by splitting date</h2>
<?php $members = scoreOrderGlobal(); uasort($members, function ($a, $b) {
@@ -50,6 +55,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
}
}
</style>
+ <?php $cache["content"] = ob_get_contents(); ob_end_clean(); endif;
+ echo($cache["content"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json", json_encode($cache)); ?>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>