diff --git a/docs/www/blog/index.php b/docs/www/blog/index.php index a34a75d..b27b8a8 100755 --- a/docs/www/blog/index.php +++ b/docs/www/blog/index.php @@ -6,8 +6,9 @@ include_once($COMMONS."/header.php"); /** * Display a blog-preview div */ -function display_blog_preview($blogpost_id, $title, $abstract, +function display_blog_preview($blogpost_id, $blogpost_addr, $title, $abstract, $date_posted, $tags){ + if(is_null($blogpost_addr)) { printf("
@@ -16,6 +17,17 @@ function display_blog_preview($blogpost_id, $title, $abstract, ", $blogpost_id, $title); + } + else { + printf(" +
+ +

+ %s +

+
+", $blogpost_addr, $title); + } print_r("
"); @@ -53,8 +65,8 @@ function display_blog_previews($conn){ } // Prepare statement for selecting all the blogposts - $stmt = $conn->prepare("SELECT blogpost_id, title, abstract, date_posted - FROM blogposts ORDER BY date_posted DESC;"); + $stmt = $conn->prepare("SELECT blogpost_id, readable_address, title, + abstract, date_posted FROM blogposts ORDER BY date_posted DESC;"); // Execute the statement $stmt->execute(); @@ -81,8 +93,9 @@ function display_blog_previews($conn){ $tags_arr = $stmt->fetchall(PDO::FETCH_ASSOC); // Display the blog - display_blog_preview($blog["blogpost_id"], $blog["title"], - $blog["abstract"], $blog["date_posted"], $tags_arr); + display_blog_preview($blog["blogpost_id"], $blog["readable_address"], + $blog["title"], $blog["abstract"], $blog["date_posted"], + $tags_arr); } }