private function listPosts($page_no = 0)
 {
     $blog = new eatStaticBlog();
     $page = new adminPage('posts.php');
     $page->context['posts'] = $blog->getSlicedPosts($page_no, 100);
     $page->context['title'] = "Posts";
     $page->render();
 }
Exemplo n.º 2
0
      */
 /**
  * blog post page
  */
 case "posts":
     switch ($path[1]) {
         case "all":
             switch ($path[2]) {
                 case "":
                     // probably 404, as we never want to return all posts?
                     break;
                 default:
                     require EATSTATIC_ROOT . '/eatStaticBlog.class.php';
                     // return appropriate slice depending on specified page
                     $blog = new eatStaticBlog();
                     $posts = $blog->getSlicedPosts($path[2] - 1);
                     $page_title = BLOG_TITLE . ' :: ' . BLOG_TAG_LINE;
                     $current_page = $path[2];
                     // set up paginator
                     //$blog->getPostFiles();
                     $paginator = new eatStaticPaginator();
                     $paginator->current = $path[2];
                     $paginator->total = sizeof($blog->post_files);
                     $paginator->pagination_root = 'posts/all/';
                     $stub = "blog_index.php";
                     break;
             }
             break;
         default:
             $stub = "post.php";
             $slug = str_replace(PAGE_EXT, "", $path[1]);