summaryrefslogtreecommitdiff
path: root/htdocs/index.php
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-05-12 17:37:31 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-12 17:37:31 -0700
commitc7ede0038e98b386cbd1ef333d89faa2568b1cb1 (patch)
treedd8d5e83ae20a3b2389bd4721b0c45285c83475f /htdocs/index.php
parentdd24e2c973a7979894971bdc38d904d2aecc7d5d (diff)
Now we have some basic functionality
Diffstat (limited to 'htdocs/index.php')
-rw-r--r--htdocs/index.php23
1 files changed, 21 insertions, 2 deletions
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 "<h2>Recent Posts</h2>";
+
+// 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("<div class=\"post\"><p><a href=\"postings/%s.html\">%s</a></p>"
+ . "<div class=\"desc\"><span class=\"location\">%s</span>"
+ . " <span class=\"age\">%s</span></div></div>",
+
+ $id, $post->getName(), $post->getLocation(), $post->getAge());
+ }
+
+} else {
+ echo "<p>No recent posts.</p>";
+}
require_once "src/footer.inc.php";