X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=admin_pages.php;h=ae0fa33de24af5eabefd46421d4bfd6e0f133eca;hb=9ff52f0dfa297b13659a78a55596c8904a9732d0;hp=06aa3ea6b67e11f293ace4be670fda59ccaf5c71;hpb=2de7be27f43afd1c2ea911cd3235b56a44f74573;p=wfpl-cms.git diff --git a/admin_pages.php b/admin_pages.php index 06aa3ea..ae0fa33 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); } @@ -169,6 +173,10 @@ function admin_pages_main_form($id = false, $history_id = false) { return './admin_pages'; } $id = $history_data['id']; + } elseif ($id) { + if (db_count('history_cms_pages', 'where id=%i', $id) > 1) { + tem_set('archived_versions'); + } } if($id) { tem_set('id', $id);