Skip to content
Snippets Groups Projects
Commit 2eaa0567 authored by peterfromearth's avatar peterfromearth
Browse files

add check if a page has once existed and show new onceexisted page

parent ba18cc87
No related branches found
No related tags found
No related merge requests found
......@@ -743,6 +743,15 @@ abstract class ChangeLog {
return array(array_reverse($revs1), array_reverse($revs2));
}
/**
* Checks if the ID has old revisons
* @return boolean
*/
public function hasRevisions() {
$file = $this->getChangelogFilename();
return file_exists($file);
}
/**
* Returns lines from changelog.
......
======= This page does not exist anymore ======
You've followed a link to a page that no longer exists. You can check the list of [[?do=revisions|old revisions]] to see when and why it was deleted, access old revisions or restore it.
\ No newline at end of file
......@@ -82,7 +82,13 @@ function p_wiki_xhtml($id, $rev='', $excuse=true,$date_at=''){
if(file_exists($file)){
$ret = p_cached_output($file,'xhtml',$id);
}elseif($excuse){
$ret = p_locale_xhtml('newpage');
//check if the page once existed
$changelog = new PageChangelog($id);
if($changelog->hasRevisions()) {
$ret = p_locale_xhtml('onceexisted');
} else {
$ret = p_locale_xhtml('newpage');
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment