* */ require_once "src/base.inc.php"; require_once "src/header.inc.php"; echo "

Recent Posts

"; // Get all recent, approved posts. $posts = new PostIterator(); $posts->filterStage('approved'); $posts->limit(5); $posts->query(); if ($posts->valid()) { for ($i = 0; $i < 10; $i++) { foreach ($posts as $id => $post) { printf("

%s

" . "
%s" . " %s
", $id, $post->getName(), $post->getLocation(), $post->getAge()); } } } else { echo "

No recent posts.

"; } require_once "src/footer.inc.php"; ?>