assign('post', "$year/$month/$day/$safe.html"); $smarty->display('.post.html'); } # Display a page of blog posts function posts($page = 0) { global $smarty; $posts = blog_crawl(); # Paginate! $smarty->assign('page', $page); if ($page) { --$page; } $posts = array_slice($posts, BLOG_PER_PAGE * $page, BLOG_PER_PAGE); $smarty->assign('posts', $posts); $smarty->display('.posts.html'); } # Show all posts with the given tag function tag($tag) { } # Show all posts from the given year function year($year) { blog_date_archive("!^/$year!"); } # Show all posts from the given month function month($year, $month) { blog_date_archive("!^/$year/$month!"); } # Show all posts from the given day function day($year, $month, $day) { blog_date_archive("!^/$year/$month/$day!"); } ?>