From c7ede0038e98b386cbd1ef333d89faa2568b1cb1 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 12 May 2011 17:37:31 -0700 Subject: Now we have some basic functionality --- htdocs/index.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'htdocs/index.php') diff --git a/htdocs/index.php b/htdocs/index.php index 4777b05..a5f5456 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -8,11 +8,30 @@ * */ -require_once "src/config.inc.php"; +require_once "src/base.inc.php"; require_once "src/header.inc.php"; -echo "Content"; +echo "

Recent Posts

"; + +// Get all recent, approved posts. +$posts = new PostIterator(); +$posts->filterStage('approved'); +$posts->limit(5); +$posts->query(); + +if ($posts->valid()) { + 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"; -- cgit v1.2.3