diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-24 14:03:36 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-24 14:03:36 +0200 |
commit | 633c92eae865e957121e08de634aeee11a8b3992 (patch) | |
tree | 09d881bee1dae0b6eee49db1dfaf0f500240606c /pages/rules.inc | |
parent | c4657e4509733699c0f26a3c900bab47e915d5a0 (diff) | |
download | pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.gz pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.bz2 pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.zip |
Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated)
Diffstat (limited to 'pages/rules.inc')
-rw-r--r-- | pages/rules.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pages/rules.inc b/pages/rules.inc index 967a4b4..23447f2 100644 --- a/pages/rules.inc +++ b/pages/rules.inc @@ -1,5 +1,6 @@ <?php +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/Parsedown.php"; $Parsedown = new Parsedown(); @@ -30,15 +31,21 @@ if (isset($_POST["updateRules"])) { } file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", json_encode($_POST["payload"])); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/rules.json", "{}"); + createJob("RefreshCache", []); header("Location: /-/rules"); die(); } require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/rules.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/rules.json", "{}"); +$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/rules.json"), true); ?> +<?php if (!isset($cache["content"])): ob_start(); ?> + <br> <div class="container"> <div id="page-content"> @@ -272,5 +279,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; filter: invert(1); } </style> +<?php $cache["content"] = ob_get_contents(); ob_end_clean(); endif; +echo($cache["content"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/rules.json", json_encode($cache)); ?> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> |