changelog.php

main 36 lines · 925 bytes Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1<?php require_once 'engine/init.php'; theme_open();
2
3/**
4 * Public changelog.
5 *
6 * Creating, editing and deleting entries moved to the admin panel
7 * (Content > Changelog). This page only reads now - it used to carry the whole
8 * editor inline, which meant a public page held database writes.
9 */
10
11$cache = new Cache('engine/cache/changelog');
12$cache->useMemory(false);
13$changelogs = $cache->load();
14
15// The cache is written by the admin panel. If it has never been built - a
16// fresh install, or someone cleared engine/cache/ - fall back to the table.
17if ($changelogs === false || $changelogs === null) {
18 $changelogs = db()->fetchAll("
19 SELECT `id`, `text`, `time`, `report_id`, `status`
20 FROM `znote_changelog`
21 ORDER BY `id` DESC;
22 ");
23 if (is_array($changelogs)) {
24 $cache->setContent($changelogs);
25 $cache->save();
26 }
27}
28
29if (!is_array($changelogs)) {
30 $changelogs = array();
31}
32
33view('changelog');
34
35theme_close();
36
Top