public function getNews($id) { $gUid = Ibos::app()->user->uid; $article = Article::model()->fetchByPk($id); $attribute = ICArticle::getShowData($article); return $attribute; }
private function show() { $articleId = intval($_GET["articleid"]); if (empty($articleId)) { $this->error(Ibos::lang("Parameters error", "error")); } $article = Article::model()->fetchByPk($articleId); if (empty($article)) { $this->error(Ibos::lang("No permission or article not exists"), $this->createUrl("default/index")); } $uid = Yii::app()->user->uid; if (!ArticleUtil::checkReadScope($uid, $article)) { $this->error(Ibos::lang("You do not have permission to read the article"), $this->createUrl("default/index")); } $data = ICArticle::getShowData($article); ArticleReader::model()->addReader($articleId, $uid); Article::model()->updateClickCount($articleId, $data["clickcount"]); $dashboardConfig = $this->getDashboardConfig(); if ($data["type"] == parent::ARTICLE_TYPE_LINK) { $urlArr = parse_url($data["url"]); $url = isset($urlArr["scheme"]) ? $data["url"] : "http://" . $data["url"]; header("Location: " . $url); exit; } $params = array("data" => $data, "dashboardConfig" => $dashboardConfig, "isInstallEmail" => $this->getEmailInstalled()); if (!empty($data["attachmentid"])) { $params["attach"] = AttachUtil::getAttach($data["attachmentid"]); } if ($data["type"] == parent::ARTICLE_TYPE_PICTURE) { $params["pictureData"] = ArticlePicture::model()->fetchPictureByArticleId($articleId); } if ($article["status"] == 2) { $temp[0] = $params["data"]; $temp = ICArticle::handleApproval($temp); $params["data"] = $temp[0]; $params["isApprovaler"] = $this->checkIsApprovaler($article, $uid); } $this->setPageTitle(Ibos::lang("Show Article")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Information center")), array("name" => Ibos::lang("Article"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Show Article")))); $this->render("show", $params); }