Fix 404 error view
This commit is contained in:
@@ -27,7 +27,7 @@ class WikiPage
|
||||
public $content = NULL;
|
||||
|
||||
/*****
|
||||
** Checks if a page at this URL exists and return the ID
|
||||
** Checks if a page at this URL exists and return the populated element
|
||||
*****/
|
||||
public function checkUrl($url, $withArchive=0, $elementNb=0) {
|
||||
global $config;
|
||||
@@ -37,7 +37,7 @@ class WikiPage
|
||||
|
||||
$query = "SELECT * FROM contents WHERE permalink=$1";
|
||||
if($withArchive==0) {
|
||||
$query .= " AND is_archive=FALSE AND is_public=FALSE";
|
||||
$query .= " AND is_archive=FALSE AND is_public=TRUE";
|
||||
}
|
||||
$query .= " ORDER BY update_date DESC LIMIT 1 OFFSET $2";
|
||||
|
||||
@@ -59,7 +59,7 @@ class WikiPage
|
||||
}
|
||||
|
||||
/*****
|
||||
** Populate the object using its ID
|
||||
** Populate the object using raw data from SQL
|
||||
*****/
|
||||
private function populate($row) {
|
||||
$this->permalink = $row['permalink'];
|
||||
@@ -76,6 +76,20 @@ class WikiPage
|
||||
$this->content = $row['content'];
|
||||
}
|
||||
|
||||
/*****
|
||||
** Return archive status
|
||||
*****/
|
||||
public function is_archive() {
|
||||
return $this->is_archive;
|
||||
}
|
||||
|
||||
/*****
|
||||
** Return archive status
|
||||
*****/
|
||||
public function update_date() {
|
||||
return $this->update_date;
|
||||
}
|
||||
|
||||
/*****
|
||||
** Edit a page by archiving the current one and inserting a new one ID
|
||||
*****/
|
||||
|
||||
Reference in New Issue
Block a user