aboutsummaryrefslogtreecommitdiff
path: root/mod/blog
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog')
-rw-r--r--mod/blog/read.php16
-rw-r--r--mod/blog/views/default/blog/notfound.php21
2 files changed, 35 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
diff --git a/mod/blog/views/default/blog/notfound.php b/mod/blog/views/default/blog/notfound.php
new file mode 100644
index 000000000..ae716df89
--- /dev/null
+++ b/mod/blog/views/default/blog/notfound.php
@@ -0,0 +1,21 @@
+<?php
+
+ /**
+ * Elgg blog not found page
+ *
+ * @package ElggBlog
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@curverider.co.uk>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+?>
+
+ <p>
+ <?php
+
+ echo elgg_echo("blog:notfound");
+
+ ?>
+ </p> \ No newline at end of file