public function index()
 {
     //处理导航栏
     $current = array('index' => "", 'myblog' => "class=\"current\"", 'loginAction' => "");
     $categoryArray = C('BLOG_CATEGORY');
     $requestPage = intval(I('get.page', 1));
     $article = new \Admin\Model\ArticleManageModel();
     $blogNumbers = $article->getBlogCount();
     $page = blogPage($blogNumbers, $requestPage, C('EVERY_PAGE_SHOW'));
     $page || $this->error("分页错误!");
     $start = ($requestPage - 1) * C('EVERY_PAGE_SHOW');
     $len = C('EVERY_PAGE_SHOW');
     $blogs = $article->listBlog($start, $len);
     foreach ($blogs as $key => $value) {
         $blogs[$key]['category'] = $categoryArray[$value['category']];
         $blogs[$key]['content'] = blogDigest($value['content']);
     }
     $this->assign('content', $blogs);
     //每页博客详情
     $this->assign('pages', $page);
     //分页详情
     $this->assign("current", $current);
     //导航栏选中状态
     $this->assign('currentPage', I('get.page', 1));
     //当前页数
     $this->assign('totalBlogs', $page[0][0]);
     //一共有多少页
     $this->assign('lastPage', $page[0][1]);
     $this->assign('nextPage', $page[0][2]);
     $this->display();
 }
 public function index()
 {
     //处理导航栏
     $current = array('index' => "class=\"current\"", 'myblog' => "", 'loginAction' => "");
     $requestPage = intval(I('get.page', 1));
     //当前请求页数
     $article = new \Admin\Model\ArticleManageModel();
     //实例化文章管理模型
     $blogNumbers = $article->getBlogCount();
     $page = blogPage($blogNumbers, $requestPage, C('EVERY_PAGE_SHOW'));
     $page || $this->error("分页错误!");
     $start = ($requestPage - 1) * C('EVERY_PAGE_SHOW');
     $len = C('EVERY_PAGE_SHOW');
     $blogs = $article->listBlog($start, $len);
     //友链处理
     $friendLinkConfig = C('BLOG_LINK');
     $frienfLink = array();
     foreach ($friendLinkConfig as $key => $value) {
         $linkTmp = explode("@", $value);
         $frienfLink[$key]['url'] = $linkTmp[0];
         $frienfLink[$key]['name'] = $linkTmp[1];
         $frienfLink[$key]['introduce'] = $linkTmp[2];
     }
     //截取博客内容
     foreach ($blogs as $key => $value) {
         $blogs[$key]['content'] = blogDigest($value['content']);
     }
     $this->assign('friendLink', $frienfLink);
     $this->assign('content', $blogs);
     //每页博客详情
     $this->assign('pages', $page);
     //分页详情
     $this->assign("current", $current);
     //导航栏选中状态
     $this->assign('currentPage', I('get.page', 1));
     //当前页数
     $this->assign('totalBlogs', $page[0][0]);
     //一共有多少页
     $this->assign('lastPage', $page[0][1]);
     $this->assign('nextPage', $page[0][2]);
     $this->display();
 }