diff options
Diffstat (limited to 'h-source/Application/Models/WikiModel.php')
-rw-r--r-- | h-source/Application/Models/WikiModel.php | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php index 0a00bfb..6cdc632 100644 --- a/h-source/Application/Models/WikiModel.php +++ b/h-source/Application/Models/WikiModel.php @@ -37,7 +37,9 @@ class WikiModel extends Model_Map { 'username' => 'regusers', 'id_user' => 'regusers', 'has_confirmed' => 'regusers', - 'deleted' => 'regusers' + 'deleted' => 'regusers', + '-deleted' => 'wiki', + '-blocked' => 'wiki', ); $this->printAssError = "no"; @@ -70,6 +72,11 @@ class WikiModel extends Model_Map { parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } + public function insert() { $this->values['created_by'] = (int)$this->id_user; @@ -254,6 +261,35 @@ class WikiModel extends Model_Map { return false; } + public function isDeleted($id) + { + $clean['id'] = (int)$id; + $res = $this->select('wiki.deleted')->where(array('id_wiki'=>$clean['id']))->send(); + if ( count($res) > 0 ) + { + return $res[0]['wiki']['deleted']; + } + return 'no'; + } + + public function isBlocked($id) + { + $clean['id'] = (int)$id; + $res = $this->select('blocked')->where(array('id_wiki'=>$clean['id']))->send(); + if ( count($res) > 0 ) + { + return strcmp($res[0]['wiki']['blocked'],'no') === 0 ? false : true; + } + return false; + } + + public function toWikiPage($id) + { + $clean['id'] = (int)$id; + $title = $this->getTheModelName($clean['id']); + return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($title); + } + public function getDiffArray($oldArray, $newArray) { return getDiffArray($this->diffFields, $oldArray, $newArray); |