示例#1
0
 public function defaultAction()
 {
     self::$TYPE = (int) HttpNamespace::getGET('type', 1);
     if (empty(self::$CATEGORY) || empty(self::$PUID)) {
         $this->_error();
     }
     self::$ARTICLE = DetailNamespace::getArticle(self::$CATEGORY, self::$PUID);
     if (empty(self::$ARTICLE)) {
         $this->_error();
     }
     self::$ARTICLE['title'] = self::$ARTICLE['title'] . ' > ' . self::$ARTICLE['author'] . ' - 大头狗日记';
     self::$URL = 'http://datougou.cn' . UrlNamespace::detailUrl(self::$MAJORY['id'], self::$PUID);
     $this->_bulidUrl();
     DetailNamespace::increaseShareTimes(self::$CATEGORY, self::$PUID);
     HttpNamespace::redirect($this->_getUrl());
 }
示例#2
0
 public function defaultAction()
 {
     if (empty(self::$PUID)) {
         $this->_error();
     }
     self::$ARTICLE = DetailNamespace::getArticle(self::$PUID);
     if (empty(self::$ARTICLE)) {
         $this->_error();
     }
     //是否是日记类型
     if (self::$CATEGORY['table'] == 'article_diarybook') {
         $result['diary'] = true;
     }
     //
     $code = self::getErrorCode();
     $result['error'] = isset(ErrorConfig::$COMMENT[$code]) ? ErrorConfig::$COMMENT[$code] : null;
     //内容
     $result['title'] = self::$ARTICLE['title'];
     $result['article'] = self::$ARTICLE;
     //评论
     $result['comment'] = DetailNamespace::getComment(self::$CATEGORY, self::$PUID);
     //增加阅读次数
     DetailNamespace::increaseReadTimes(self::$PUID);
     //顶部ad
     $result['ad_top'] = $this->_getAdTop();
     //上面 下面 右侧的image
     $result['image'] = $this->_getImageTop();
     //面包屑
     $result['bread'] = $this->_setBread();
     //上一篇 下一篇
     $result['near'] = $this->_getNearArticle();
     //相关文章
     $result['related'] = $this->_getRelatedArticle();
     //全网热点
     $result['all_hot'] = IndexPageConfig::$TOP_ARTICLE;
     //频道热点
     $result['hot'] = CommonNamespace::getHotArticle(self::$CATEGORY['id'], self::$MAJORY['id'], 5);
     //频道最新
     $result['new'] = CommonNamespace::getNewArticle(self::$CATEGORY['id'], self::$MAJORY['id'], 5);
     $this->assign($result);
     $this->display();
 }