diff --git a/admin_reports.php b/admin_reports.php
index 778425b..1f735e7 100644
--- a/admin_reports.php
+++ b/admin_reports.php
@@ -66,15 +66,24 @@ if (!empty($_POST)) {
// Check if changelog exist (`id`, `text`, `time`, `report_id`, `status`)
$changelog = mysql_select_single("SELECT * FROM `znote_changelog` WHERE `report_id`='$changelogReportId' LIMIT 1;");
// If changelog exist
+ $updatechangelog = false;
if ($changelog !== false) {
// Update it
mysql_update("UPDATE `znote_changelog` SET `text`='$changelogText', `time`='$time' WHERE `id`='".$changelog['id']."' LIMIT 1;");
echo "
Changelog message updated!
";
+ $updatechangelog = true;
} else {
// Create it
mysql_insert("INSERT INTO `znote_changelog` (`text`, `time`, `report_id`, `status`)
VALUES ('$changelogText', '$time', '$changelogReportId', '$status');");
echo "Changelog message created!
";
+ $updatechangelog = true;
+ }
+ if ($updatechangelog) {
+ // Cache changelog
+ $cache = new Cache('engine/cache/changelog');
+ $cache->setContent(mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;"));
+ $cache->save();
}
}
diff --git a/changelog.php b/changelog.php
index bc628db..629a17c 100644
--- a/changelog.php
+++ b/changelog.php
@@ -54,7 +54,7 @@ if (user_logged_in()) {
Changelog
hasExpired() || $updateCache === true) {
+if ($updateCache === true) {
$changelogs = mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;");
$cache->setContent($changelogs);
@@ -64,7 +64,7 @@ if ($cache->hasExpired() || $updateCache === true) {
}
if (isset($changelogs) && !empty($changelogs) && $changelogs !== false) {
?>
-
+
Changelogs |
100,
diff --git a/index.php b/index.php
index 973a05e..94848c5 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,34 @@
load();
+
+ if (isset($changelogs) && !empty($changelogs) && $changelogs !== false) {
+ ?>
+
+ hasExpired()) {
$news = fetchAllNews();
diff --git a/layout/css/style.css b/layout/css/style.css
index afe0a68..ba7b020 100644
--- a/layout/css/style.css
+++ b/layout/css/style.css
@@ -606,4 +606,8 @@ hr {
}
.updateTable tr td input {
width: 500px;
+}
+
+#changelogTable {
+ width: 735px;
}
\ No newline at end of file