aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/read.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/read.php')
-rw-r--r--mod/blog/read.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/mod/blog/read.php b/mod/blog/read.php
index 35ee0c997..84e29d0ea 100644
--- a/mod/blog/read.php
+++ b/mod/blog/read.php
@@ -14,7 +14,9 @@
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Get the specified blog post
- $post = (int) get_input('blogpost');
+ $post = (int) get_input('blogpost');
+
+ // If we can get out the blog post ...
if ($blogpost = get_entity($post)) {
// Get any comments
@@ -31,10 +33,20 @@
'comments' => $comments,
'full' => true
));
+
+ // Set the title appropriately
+ $title = sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title);
+
+ // If we're not allowed to see the blog post
+ } else {
+
+ // Display the 'post not found' page instead
+ $body = elgg_view("blog/notfound");
+ $title = elgg_echo("blog:notfound");
}
// Display page
- page_draw(sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title),$body);
+ page_draw($title,$body);
?> \ No newline at end of file