From b168dbb811c4f86dc8c3daa64676aabb102e77d2 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 4 Jun 2016 19:55:22 +0100 Subject: [PATCH] Display revision details. Fixes #75 and #76. --- build/index.php | 3 ++- module_index.json | 2 +- modules/page-view.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/index.php b/build/index.php index 74d08d5..84991b9 100644 --- a/build/index.php +++ b/build/index.php @@ -4386,6 +4386,7 @@ register_module([ // We have a revision number! $isHistoryRevision = true; $revisionNumber = intval($_GET["revision"]); + $revisionData = $pageindex->{$env->page}->history[$revisionNumber]; // Make sure that the revision exists for later on if(!isset($pageindex->{$env->page}->history[$revisionNumber])) @@ -4405,7 +4406,7 @@ register_module([ else { $content .= "

Revision #$revisionNumber of $env->page

\n"; - $content .= "

(See current)

\n"; + $content .= "

(Revision created by $revisionData->editor " . render_rchange_timestamp($revisionData->timestamp) . ". Jump to the current revision.)

\n"; } // Add an extra message if the requester was redirected from another page diff --git a/module_index.json b/module_index.json index 01728be..c256a70 100644 --- a/module_index.json +++ b/module_index.json @@ -185,7 +185,7 @@ "author": "Starbeamrainbowlabs", "description": "Allows you to view pages. You really should include this one.", "id": "page-view", - "lastupdate": 1465063952, + "lastupdate": 1465066305, "optional": false }, { diff --git a/modules/page-view.php b/modules/page-view.php index 018382d..38b980d 100644 --- a/modules/page-view.php +++ b/modules/page-view.php @@ -59,6 +59,7 @@ register_module([ // We have a revision number! $isHistoryRevision = true; $revisionNumber = intval($_GET["revision"]); + $revisionData = $pageindex->{$env->page}->history[$revisionNumber]; // Make sure that the revision exists for later on if(!isset($pageindex->{$env->page}->history[$revisionNumber])) @@ -78,7 +79,7 @@ register_module([ else { $content .= "

Revision #$revisionNumber of $env->page

\n"; - $content .= "

(See current)

\n"; + $content .= "

(Revision created by $revisionData->editor " . render_rchange_timestamp($revisionData->timestamp) . ". Jump to the current revision.)

\n"; } // Add an extra message if the requester was redirected from another page