Exemplo n.º 1
0
 public function showImage()
 {
     $result['image'] = true;
     $result['topic'] = IndexPageConfig::$TOPIC;
     $name_id = HttpNamespace::getGET('name');
     if ($name_id) {
         $image = DetailNamespace::getNameById($name_id);
         if (!$image) {
             HttpNamespace::redirect(UrlNamespace::categoryUrl(self::$CATEGORY['id']));
         }
     } else {
         $category = self::$CATEGORY;
         $category['table'] = 'image';
         list($page, $list) = CommonNamespace::showPage($category, self::$MAJORY, 'id', 10);
         foreach ($list as $key => $value) {
             $list[$key]['list'] = $this->getHotImage(self::$MAJORY['id'], $value['id'], 4);
         }
         $this->assign('title', self::$MAJORY['name']);
         $this->assign('list', $list);
         $this->assign('image', true);
         $this->assign('page', $page);
         $this->display('majory/list.php');
     }
     $page = HttpNamespace::getGET('p');
     list($list, $result['count']) = DBXapian::searchImageByName($name_id, $page, 16);
     //组合list
     $result['list'] = array(array('id' => $image['id'], 'majory_id' => self::$MAJORY['id'], 'name' => $image['name'], 'list' => $list));
     $result['title'] = self::$MAJORY['name'] . '-' . $image['name'];
     $result['type_id'] = $this->typeId;
     $result['page'] = $this->_showPage($result['count']);
     $this->assign($result);
     $this->display('majory/list.php');
 }
Exemplo n.º 2
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());
 }
Exemplo n.º 3
0
 /**
  * @brief 相关文章
  */
 private function _getRelatedArticle()
 {
     //日记的话 推荐相关日记本
     return DetailNamespace::getRelateArticle(self::$ARTICLE);
 }