Example #1
0
 public function init()
 {
     $this->assign('css', array('category/common.css', 'footer.css'));
     parent::init();
     if (isset(self::$REQUEST['type']) && self::$REQUEST['type'] >= 1) {
         self::$CATEGORY = CategoryNamespace::getCategoryById(self::$REQUEST['type']);
         $this->assign('category', self::$CATEGORY);
     }
 }
Example #2
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;
 }