From 80961022207dd7af4456b4f1247fc706395c8728 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 20 Jun 2017 23:03:36 -0400 Subject: [PATCH] first entry in page history links to actual page --- admin_pages.html | 47 +++++++++++++++++++++++++++++++---------------- admin_pages.php | 8 ++++++-- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/admin_pages.html b/admin_pages.html index 26c7f18..798cdcb 100644 --- a/admin_pages.html +++ b/admin_pages.html @@ -403,24 +403,39 @@

Edit history for page "~title html~"

- - - - - - - - + +

There are no archived versions of this page.

+ + +
titleatby
- - - - + + + + - -
~title html~(untitled)~timestamp~~who html~ -
-
titleatby
+ + + ~title html~(untitled) + ~timestamp~ + ~who html~ + + + +
+ + +
+ + + +
+ + + + + + diff --git a/admin_pages.php b/admin_pages.php index 06aa3ea..910acef 100644 --- a/admin_pages.php +++ b/admin_pages.php @@ -140,10 +140,14 @@ function admin_pages_main_listing() { function admin_pages_main_page_history ($id) { $data = array(); - $rows = db_get_assocs('history_cms_pages left join users on history_cms_pages.history_user_id = users.id', 'history_cms_pages.id as page_id,history_cms_pages.history_id,coalesce(nullif(history_cms_pages.nav_title,""), history_cms_pages.title) as title,history_when as timestamp,coalesce(nullif(users.name,""), users.username) as who', 'where history_cms_pages.id=%i order by history_id desc', $id); + $rows = db_get_assocs('history_cms_pages left join users on history_cms_pages.history_user_id = users.id', 'history_cms_pages.id as page_id,history_cms_pages.history_id,history_cms_pages.filename,coalesce(nullif(history_cms_pages.nav_title,""), history_cms_pages.title) as title,history_when as timestamp,coalesce(nullif(users.name,""), users.username) as who', 'where history_cms_pages.id=%i order by history_id desc', $id); if (count($rows) !== 0) { - $data['rows'] = $rows; $data['title'] = $rows[0]['title']; + $rows[0]['first'] = true; + if ($rows[0]['filename'] === 'index') { + $rows[0]['filename'] = './'; + } + $data['rows'] = $rows; } tem_set('page_history', $data); } -- 1.7.10.4