diff options
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r-- | h-source/Application/Models/WikiModel.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php index dd8d5a6..7357705 100644 --- a/h-source/Application/Models/WikiModel.php +++ b/h-source/Application/Models/WikiModel.php @@ -223,12 +223,23 @@ class WikiModel extends Model_Map { } //get the model name - public function getTheModelName($id) + public function getTheModelName($id, $cleaned = false) { $clean['id'] = (int)$id; $this->setWhereQueryClause(array('id_wiki' => $clean['id'])); - $res = $this->getFields('title'); - $name = count($res) > 0 ? $res[0]['wiki']['title'] : ''; + $res = $this->getFields('title,title_clean'); + $name = ''; + if (count($res) > 0) + { + if ($cleaned) + { + $name = $res[0]['wiki']['title_clean']; + } + else + { + $name = $res[0]['wiki']['title']; + } + } return $name; } @@ -297,8 +308,8 @@ class WikiModel extends Model_Map { public function toWikiPage($id) { $clean['id'] = (int)$id; - $title = $this->getTheModelName($clean['id']); - return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($title); + $title = $this->getTheModelName($clean['id'], true); + return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".$title; } public function getDiffArray($oldArray, $newArray) |