Пример #1
0
 public function defaultAction()
 {
     $result['topic'] = IndexPageConfig::$TOPIC;
     $result['top_image'] = IndexPageConfig::$IMAGE_TOP;
     //$result['mid_image'] = IndexPageConfig::$IMAGE_MID;
     $result['down_image'] = IndexPageConfig::$IMAGE_DOWN;
     $result['top_article'][] = array('ad' => null, 'image' => null, 'article' => self::mergeResult($this->getNewArticle(self::$MAJORY['id'], 2), $this->getHotArticle(self::$MAJORY['id'], 2)));
     list($page, $list) = CommonNamespace::showPage(self::$MAJORY);
     $result['article'][] = array('ad' => null, 'image' => null, 'article' => $list);
     $this->assign('title', '最新发布');
     $this->assign('page', $page);
     $this->assign('result', $result);
     $this->display();
 }
Пример #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();
 }
Пример #3
0
 private function _returnMsg()
 {
     $flag = true;
     if ($this->MsgType == 'text') {
         $id = $this->msg['Content'];
         $cateogory = CategoryNamespace::getCategoryById($id);
         $majory = CategoryNamespace::getMajoryById($id);
         if ($cateogory) {
             //
             if ($cateogory['id'] == 400) {
             }
             $this->article = CommonNamespace::getNewArticle($cateogory['id'], null, 8);
             $this->title = $cateogory['name'];
             $this->url = 'http://datougou.cn/diary/index.php/category/?category=' . $cateogory['id'];
         } elseif ($majory) {
             $this->article = CommonNamespace::getNewArticle($majory['parent']['id'], $majory['id'], 8);
             $this->title = $majory['parent']['name'] . ' - ' . $majory['name'];
             $this->url = 'http://datougou.cn/diary/index.php/majory/?majory=' . $majory['id'];
         } else {
             $flag = false;
         }
     } elseif ($this->MsgType == 'event' && strtolower($this->msg['Event']) == 'subscribe') {
         //$this->article = IndexPageConfig::$TOP_ARTICLE;
         $this->title = '欢迎关注大头狗日记散文小站';
         $this->url = 'http://datougou.cn';
     }
     if ($flag) {
         $content = $this->_makeNews();
     } else {
         $content = $this->makeText();
     }
     //$content = $this->_makeNews();
     file_put_contents(dirname(__FILE__) . '/test.txt', $GLOBALS["HTTP_RAW_POST_DATA"] . "\r\n", FILE_APPEND);
     echo $content;
     exit;
 }
Пример #4
0
 public function getHotImage($majoryId, $limit)
 {
     return CommonNamespace::getHotImage($majoryId, '', $limit);
 }
Пример #5
0
 public function getHotArticle($majory, $limit)
 {
     return CommonNamespace::getHotArticle($majory, $limit);
 }