summaryrefslogtreecommitdiff
path: root/htdocs/index.php
diff options
context:
space:
mode:
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";